[PATCH v4 05/12] power-domain: Add refcounting
Miquel Raynal
miquel.raynal at bootlin.com
Mon Mar 3 09:43:24 CET 2025
Hello Simon,
On 08/02/2025 at 08:09:30 -03, Fabio Estevam <festevam at gmail.com> wrote:
> Hi Simon,
>
> On Wed, Jan 29, 2025 at 7:22 AM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>>
>> It is very surprising that such an uclass, specifically designed to
>> handle resources that may be shared by different devices, is not keeping
>> the count of the number of times a power domain has been
>> enabled/disabled to avoid shutting it down unexpectedly or disabling it
>> several times.
>>
>> Doing this causes troubles on eg. i.MX8MP because disabling power
>> domains can be done in recursive loops were the same power domain
>> disabled up to 4 times in a row. PGCs seem to have tight FSM internal
>> timings to respect and it is easy to produce a race condition that puts
>> the power domains in an unstable state, leading to ADB400 errors and
>> later crashes in Linux.
>>
>> CI tests using power domains are slightly updated to make sure the count
>> of on/off calls is even and the results match what we *now* expect.
>>
>> As we do not want to break existing users while stile getting
>> interesting error codes, the implementation is split between:
>> - a low-level helper reporting error codes if the requested transition
>> could not be operated,
>> - a higher-level helper ignoring the "non error" codes, like EALREADY and
>> EBUSY.
>>
>> Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
>
> Are you happy with this version?
Would you have any feedback on this? I believe we agreed on the
implementation but it's been a month and I didn't heard back from you
since then, and I believe Fabio was waiting for your feedback.
Thanks a lot,
Miquèl
More information about the U-Boot
mailing list