mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Almeida <daniel.almeida@collabora.com>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	"Detlev Casanova" <detlev.casanova@collabora.com>
Subject: Re: [PATCH 0/7] rust: reset: add reset control abstractions
Date: Thu, 26 Nov 2026 15:36:56 -0300	[thread overview]
Message-ID: <D28A86A5-8077-49BA-B366-FF29E9E75736@collabora.com> (raw)
In-Reply-To: <ffb55e45af601f0afaf5071f92e123c81de22a70.camel@collabora.com>



> On 26 Nov 2026, at 15:11, Nicolas Dufresne <nicolas.dufresne@collabora.com> wrote:
> 
> Le jeudi 26 novembre 2026 à 15:02 -0300, Daniel Almeida a écrit :
>> What does not work with shared resets on the C side?
> 
> Above make sense, for shared, you need a mechanism to coordinate the reset. A
> bit like the comment above you made about flushing active jobs, and holding on
> new jobs until the reset has completed. I think for multiple instance of the
> same driver its quite feasible, but when the triggering driver have no clue what
> other driver it shares with, there is nothing as far as I know to help with this
> coordination, and its possibly non-trivial, specially if that was not part of
> the initial design.
> 
> Nicolas


My understanding (correct me if I am wrong?) is that this coordination is
indeed needed, but baked into the C assert/deassert API:

Someone on a shared line has no power to assert the line
unconditionally, all a single consumer can say is "I'd like this line to
be asserted". The line is only asserted when all users agree (i.e.: when
all other users also ask for a reset).

So if driver A wants a reset, it gets its house in order, and asks for
it. Same for all other drivers, and it goes through when the last one
does so. This is the de-facto coordination between consumers and it is
not something that Rust influences one way or the other.

Sure, B is not told that A wants a reset, and A is not told by the reset
APIs when the reset goes through, but at least no user gets its hardware
yanked from them all of a sudden.

In fact, we do enforce this even harder by making sure that one cannot
construct a SharedResetControl<Asserted>, for the reasons above.

-- Daniel

  reply	other threads:[~2026-11-26 18:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 16:04 Daniel Almeida
2026-11-26 16:04 ` [PATCH 1/7] rust: reset: add reset control helpers Daniel Almeida
2026-11-26 16:04 ` [PATCH 2/7] rust: reset: add ExclusiveResetControl Daniel Almeida
2026-11-26 16:04 ` [PATCH 3/7] rust: reset: add ExclusiveResetControl::get_array() and get_array_optional() Daniel Almeida
2026-11-26 16:04 ` [PATCH 4/7] rust: reset: add AssertedGuard Daniel Almeida
2026-11-26 16:04 ` [PATCH 5/7] rust: reset: add SharedResetControl Daniel Almeida
2026-11-26 19:14   ` Alice Ryhl
2026-11-26 16:04 ` [PATCH 6/7] rust: reset: add SharedResetControl::get_array() and get_array_optional() Daniel Almeida
2026-11-26 16:04 ` [PATCH 7/7] rust: reset: add devm_deassert() and devm_deassert_optional() Daniel Almeida
2026-11-26 16:33 ` [PATCH 0/7] rust: reset: add reset control abstractions Nicolas Dufresne
2026-11-26 18:02   ` Daniel Almeida
2026-11-26 18:11     ` Nicolas Dufresne
2026-11-26 18:36       ` Daniel Almeida [this message]
2026-11-26 18:46         ` Nicolas Dufresne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D28A86A5-8077-49BA-B366-FF29E9E75736@collabora.com \
    --to=daniel.almeida@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=detlev.casanova@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=ojeda@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®