[Top][All Lists]

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

Re: [PATCH for-8.0 4/9] hw/usb/hcd-xhci: Reset the XHCIState with device

From: Philippe Mathieu-Daudé
Subject: Re: [PATCH for-8.0 4/9] hw/usb/hcd-xhci: Reset the XHCIState with device_cold_reset()
Date: Wed, 30 Nov 2022 11:11:29 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

On 4/11/22 17:15, Peter Maydell wrote:
Currently the hcd-xhci-pci and hcd-xhci-sysbus devices, which are

s/which// ?

mostly wrappers around the TYPE_XHCI device, which is a direct
subclass of TYPE_DEVICE.  Since TYPE_DEVICE devices are not on any
qbus and do not get automatically reset, the wrapper devices both
reset the TYPE_XHCI device in their own reset functions.  However,
they do this using device_legacy_reset(), which will reset the device
itself but not any bus it has.

Switch to device_cold_reset(), which avoids using a deprecated
function and also propagates reset along any child buses.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
It's possible this might result in USB devices on the bus getting
reset more than once (once via the descent-along-qbus and once when
xhci_reset() etc manually reset each port), but in my testing with
gdb I couldn't get that to happen.  It should be harmless anyway.
  hw/usb/hcd-xhci-pci.c    | 2 +-
  hw/usb/hcd-xhci-sysbus.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

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

reply via email to

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