[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-8.0 5/7] hw/intc/xics: Reset TYPE_ICS objects with device

From: Philippe Mathieu-Daudé
Subject: Re: [PATCH for-8.0 5/7] hw/intc/xics: Reset TYPE_ICS objects with device_cold_reset()
Date: Wed, 30 Nov 2022 11:21:41 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

On 25/11/22 14:45, Greg Kurz wrote:
On Fri, 25 Nov 2022 13:24:00 +0100
Cédric Le Goater <clg@kaod.org> wrote:

On 11/25/22 12:52, Peter Maydell wrote:
The realize method for the TYPE_ICS class uses qemu_register_reset()
to register a reset handler, as a workaround for the fact that
currently objects which directly inherit from TYPE_DEVICE don't get
automatically reset.  However, the reset function directly calls
ics_reset(), which is the function that implements the legacy reset
method.  This means that only the parent class's data gets reset, and
a subclass which also needs to handle reset, like TYPE_PHB3_MSI, has
to register its own reset function.

Make the TYPE_ICS reset function call device_cold_reset() instead:
this will handle reset for both the parent class and the subclass,
and will work whether the classes are using legacy reset or 3-phase
reset. This allows us to remove the reset function that the subclass
currently has to set up.

Nice !


Thirded :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Greg Kurz <groug@kaod.org>

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]