Re: [PATCH 0/7] rust: reset: add reset control abstractions

From: Nicolas Dufresne

Date: Thu Nov 26 2026 - 13:46:58 EST


Le jeudi 26 novembre 2026 à 15:36 -0300, Daniel Almeida a écrit :
>
> > On 26 Nov 2026, at 15:11, Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx> 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.

Which comes back to my point, if the drivers have no back-channel, the lonely
driver wanting to reset will wait forever. And the interaction with runtime PM
seems a bit undefined too no? My question is if this is actually usable in
practice.

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

Maybe I'm just missing concrete examples.

Nicolas

>
> -- Daniel

Attachment: signature.asc
Description: This is a digitally signed message part