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

From: Daniel Almeida

Date: Thu Nov 26 2026 - 13:04:17 EST


Hi Nicolas,

> On 26 Nov 2026, at 13:33, Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx> wrote:
>
> Hi Daniel,
>
> Le jeudi 26 novembre 2026 à 13:04 -0300, Daniel Almeida a écrit :
>> This series adds a Rust abstraction for the consumer side of the reset
>> controller API. A driver can get the reset lines of its device, as an
>> exclusive or a shared reset control, and assert and deassert them.
>>
>> This will be used by the upcoming rkvenc driver that my colleagues
>> Detlev Casanova, Nicolas Dufresne and I are working on, to recover a
>> hung core of the encoder without stopping the other one. More details on
>> this driver can be found by watching Nicolas Dufresne's talk at LPC 2026
>> [0]. Samsung's Rust UFS RFC [1] also uses reset lines, through an
>> abstraction that it has not posted.
>
> I don't mind being cited, but please give a heads-up, we haven't discussed any
> of this, so I can't really comment if its a good or bad idea. On the C side,
> shared reset don't really work today, so I'm left wondering.
>
> Nicolas
>

Fair, sorry for not giving you a heads-up. I have a branch a bit
further ahead where I have tested both encoder cores at once, including
this change. Due to the hierarchy of the power domains, to power down
core 0, you also need to power down core 1. In other words, if core 0
becomes stuck, there is no way to bring it back by means of a power
cycle without also stopping the jobs running on core 1.

This series mainly makes it possible to access the reset lines in an
established pattern (e.g. Regulator<T> already uses it, and so does the
Clk<T> series). For rkvenc, it allows pulsing only the lines of the
affected core.

Reset lines haven't come up so far because with only a single core
powered up, a power cycle is fine, since there is no other core to
affect anyway.

Also note that rkvenc does not use SharedResetControl, but I ended up
deciding to make it available as well. The same can be said of Clk<T>,
where we have devm_ and other conveniences like guards that are not
necessarily used at the moment, but that make sense when you look at
what a lot of C drivers tend to need and carry that over to Rust.

What does not work with shared resets on the C side?

— Daniel