[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 08/11] hw/core: deprecate old reset functions and introduc
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v8 08/11] hw/core: deprecate old reset functions and introduce new ones |
Date: |
Wed, 28 Apr 2021 15:29:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Peter Maydell <peter.maydell@linaro.org> writes:
> On Wed, 28 Apr 2021 at 06:03, Markus Armbruster <armbru@redhat.com> wrote:
>> For what it's worth, Damien further explained the two helpers in
>> docs/devel/reset.rst:
>>
>> For Devices and Buses, the following helper functions exist:
>>
>> - ``device_cold_reset()``
>> - ``bus_cold_reset()``
>>
>> These are simple wrappers around resettable_reset() function; they only
>> cast the
>> Device or Bus into an Object and pass the cold reset type. When possible
>> prefer to use these functions instead of ``resettable_reset()``.
>>
>> I figure what's missing is guidance on how to transition code from
>> legacy reset to multi-phase reset. Ideally with a working example
>> people can study. Damien, can you help us out?
>
> These are two separate things:
> 1) callsites which want to reset some other device, and currently
> mostly use eg device_legacy_reset() -- the transition to be done
> is to move them to use device_cold_reset(). Similarly, callsites
> which currently reset a bus with qbus_reset_all() and should move
> to bus_cold_reset().
> 2) devices which implement reset and currently do so with a
> single reset method -- the transition to be done is to have
> them implement however many phases of 3-phase reset they need
>
> (1) is easier than (2) because there are many fewer callsites
> trying to manually reset devices or buses than there are
> devices that implement reset.
My ignorance on "these are two separate things" is further evidence that
working examples are needed. Damien? Peter? Pretty-please?