[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/7] hw/usb/hcd-xhci: Reset the XHCIState with device_cold_reset()
From: |
Gerd Hoffmann |
Subject: |
[PULL 5/7] hw/usb/hcd-xhci: Reset the XHCIState with device_cold_reset() |
Date: |
Wed, 23 Nov 2022 15:44:34 +0100 |
From: Peter Maydell <peter.maydell@linaro.org>
Currently the hcd-xhci-pci and hcd-xhci-sysbus devices, which are
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>
Message-Id: <20221014145423.2102706-1-peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/hcd-xhci-pci.c | 2 +-
hw/usb/hcd-xhci-sysbus.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index e934b1a5b1fb..643d4643e4d6 100644
--- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c
@@ -85,7 +85,7 @@ static void xhci_pci_reset(DeviceState *dev)
{
XHCIPciState *s = XHCI_PCI(dev);
- device_legacy_reset(DEVICE(&s->xhci));
+ device_cold_reset(DEVICE(&s->xhci));
}
static int xhci_pci_vmstate_post_load(void *opaque, int version_id)
diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index a14e4381960e..faf57b47975d 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -29,7 +29,7 @@ void xhci_sysbus_reset(DeviceState *dev)
{
XHCISysbusState *s = XHCI_SYSBUS(dev);
- device_legacy_reset(DEVICE(&s->xhci));
+ device_cold_reset(DEVICE(&s->xhci));
}
static void xhci_sysbus_realize(DeviceState *dev, Error **errp)
--
2.38.1
- [PULL 0/7] Fixes 20221123 patches, Gerd Hoffmann, 2022/11/23
- [PULL 1/7] Revert "usbredir: avoid queuing hello packet on snapshot restore", Gerd Hoffmann, 2022/11/23
- [PULL 5/7] hw/usb/hcd-xhci: Reset the XHCIState with device_cold_reset(),
Gerd Hoffmann <=
- [PULL 3/7] hw/usb/hcd-xhci.c: spelling: tranfer, Gerd Hoffmann, 2022/11/23
- [PULL 4/7] ui/gtk: prevent ui lock up when dpy_gl_update called again before current draw event occurs, Gerd Hoffmann, 2022/11/23
- [PULL 6/7] hw/audio/intel-hda: don't reset codecs twice, Gerd Hoffmann, 2022/11/23
- [PULL 7/7] hw/audio/intel-hda: Drop unnecessary prototype, Gerd Hoffmann, 2022/11/23
- [PULL 2/7] gtk: disable GTK Clipboard with a new meson option, Gerd Hoffmann, 2022/11/23
- Re: [PULL 0/7] Fixes 20221123 patches, Peter Maydell, 2022/11/23
- Re: [PULL 0/7] Fixes 20221123 patches, Stefan Hajnoczi, 2022/11/23