On Wed, 28 Apr 2021 at 06:03, Markus Armbruster <arm...@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. thanks -- PMM