* [PATCH 01/11] hw/usb/hcd-dwc3: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:47 ` Bin Meng
` (2 more replies)
2026-11-30 20:02 ` [PATCH 02/11] hw/usb/hcd-ehci-pci: " Oscar Alejandro Sánchez Lucero
` (9 subsequent siblings)
10 siblings, 3 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
usb_dwc3_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-dwc3.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-dwc3.c b/hw/usb/hcd-dwc3.c
index 785732f..29328be 100644
--- a/hw/usb/hcd-dwc3.c
+++ b/hw/usb/hcd-dwc3.c
@@ -568,9 +568,9 @@ static const RegisterAccessInfo usb_dwc3_regs_info[] = {
}
};
-static void usb_dwc3_reset(DeviceState *dev)
+static void usb_dwc3_reset_hold(Object *obj, ResetType type)
{
- USBDWC3 *s = USB_DWC3(dev);
+ USBDWC3 *s = USB_DWC3(obj);
unsigned int i;
for (i = 0; i < ARRAY_SIZE(s->regs_info); ++i) {
@@ -669,8 +669,9 @@ static const Property usb_dwc3_properties[] = {
static void usb_dwc3_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
- device_class_set_legacy_reset(dc, usb_dwc3_reset);
+ rc->phases.hold = usb_dwc3_reset_hold;
dc->realize = usb_dwc3_realize;
dc->vmsd = &vmstate_usb_dwc3;
device_class_set_props(dc, usb_dwc3_properties);
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 01/11] hw/usb/hcd-dwc3: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 01/11] hw/usb/hcd-dwc3: Convert " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:47 ` Bin Meng
2026-12-01 14:46 ` Tommaso Califano
2026-12-01 21:38 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:47 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:07 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_dwc3_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-dwc3.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 01/11] hw/usb/hcd-dwc3: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 01/11] hw/usb/hcd-dwc3: Convert " Oscar Alejandro Sánchez Lucero
2026-12-01 13:47 ` Bin Meng
@ 2026-12-01 14:46 ` Tommaso Califano
2026-12-01 21:38 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:46 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_dwc3_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-dwc3.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/usb/hcd-dwc3.c b/hw/usb/hcd-dwc3.c
> index 785732f..29328be 100644
> --- a/hw/usb/hcd-dwc3.c
> +++ b/hw/usb/hcd-dwc3.c
> @@ -568,9 +568,9 @@ static const RegisterAccessInfo usb_dwc3_regs_info[] = {
> }
> };
>
> -static void usb_dwc3_reset(DeviceState *dev)
> +static void usb_dwc3_reset_hold(Object *obj, ResetType type)
> {
> - USBDWC3 *s = USB_DWC3(dev);
> + USBDWC3 *s = USB_DWC3(obj);
> unsigned int i;
>
> for (i = 0; i < ARRAY_SIZE(s->regs_info); ++i) {
> @@ -669,8 +669,9 @@ static const Property usb_dwc3_properties[] = {
> static void usb_dwc3_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> - device_class_set_legacy_reset(dc, usb_dwc3_reset);
> + rc->phases.hold = usb_dwc3_reset_hold;
> dc->realize = usb_dwc3_realize;
> dc->vmsd = &vmstate_usb_dwc3;
> device_class_set_props(dc, usb_dwc3_properties);
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH 01/11] hw/usb/hcd-dwc3: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 01/11] hw/usb/hcd-dwc3: Convert " Oscar Alejandro Sánchez Lucero
2026-12-01 13:47 ` Bin Meng
2026-12-01 14:46 ` Tommaso Califano
@ 2026-12-01 21:38 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-12-01 21:38 UTC (permalink / raw)
To: Peter Maydell, Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Jean-Christophe Dubois, qemu-arm, Richard Henderson, Helge Deller
Hi Oscar,
On 30/11/26 21:02, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_dwc3_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-dwc3.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/usb/hcd-dwc3.c b/hw/usb/hcd-dwc3.c
> index 785732f..29328be 100644
> --- a/hw/usb/hcd-dwc3.c
> +++ b/hw/usb/hcd-dwc3.c
> @@ -568,9 +568,9 @@ static const RegisterAccessInfo usb_dwc3_regs_info[] = {
> }
> };
>
> -static void usb_dwc3_reset(DeviceState *dev)
> +static void usb_dwc3_reset_hold(Object *obj, ResetType type)
We need to be cautious with this one.
DWC3 directly resets XHCI (as child object, not via Reset Tree).
There is also a MMIO access:
usb_dwc3_gctl_postw
-> reset_csr
-> xhci_sysbus_reset
-> device_cold_reset
I guess _hold is correct but I'd rather have extra review from
Peter here.
See also:
https://lore.kernel.org/qemu-devel/CAFEAcA8-b7xjuawxOR4bJwfEYPpu7doXAtoyvZ+RU3xWc0FgQA@mail.gmail.com/
> {
> - USBDWC3 *s = USB_DWC3(dev);
> + USBDWC3 *s = USB_DWC3(obj);
> unsigned int i;
>
> for (i = 0; i < ARRAY_SIZE(s->regs_info); ++i) {
> @@ -669,8 +669,9 @@ static const Property usb_dwc3_properties[] = {
> static void usb_dwc3_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> - device_class_set_legacy_reset(dc, usb_dwc3_reset);
> + rc->phases.hold = usb_dwc3_reset_hold;
> dc->realize = usb_dwc3_realize;
> dc->vmsd = &vmstate_usb_dwc3;
> device_class_set_props(dc, usb_dwc3_properties);
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 02/11] hw/usb/hcd-ehci-pci: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
2026-11-30 20:02 ` [PATCH 01/11] hw/usb/hcd-dwc3: Convert " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:47 ` Bin Meng
2026-12-01 14:47 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 03/11] hw/usb/hcd-ehci-sysbus: " Oscar Alejandro Sánchez Lucero
` (8 subsequent siblings)
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
usb_ehci_pci_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-ehci-pci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index fd35d25..31bee22 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -111,10 +111,9 @@ static void usb_ehci_pci_exit(PCIDevice *dev)
s->irq = NULL;
}
-static void usb_ehci_pci_reset(DeviceState *dev)
+static void usb_ehci_pci_reset_hold(Object *obj, ResetType type)
{
- PCIDevice *pci_dev = PCI_DEVICE(dev);
- EHCIPCIState *i = PCI_EHCI(pci_dev);
+ EHCIPCIState *i = PCI_EHCI(obj);
EHCIState *s = &i->ehci;
ehci_reset(s);
@@ -154,6 +153,7 @@ static void ehci_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
k->realize = usb_ehci_pci_realize;
k->exit = usb_ehci_pci_exit;
@@ -161,7 +161,7 @@ static void ehci_class_init(ObjectClass *klass, const void *data)
k->config_write = usb_ehci_pci_write_config;
dc->vmsd = &vmstate_ehci_pci;
device_class_set_props(dc, ehci_pci_properties);
- device_class_set_legacy_reset(dc, usb_ehci_pci_reset);
+ rc->phases.hold = usb_ehci_pci_reset_hold;
}
static const TypeInfo ehci_pci_type_info = {
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 02/11] hw/usb/hcd-ehci-pci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 02/11] hw/usb/hcd-ehci-pci: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:47 ` Bin Meng
2026-12-01 14:47 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:47 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:06 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ehci_pci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-ehci-pci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 02/11] hw/usb/hcd-ehci-pci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 02/11] hw/usb/hcd-ehci-pci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:47 ` Bin Meng
@ 2026-12-01 14:47 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:47 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ehci_pci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-ehci-pci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
> index fd35d25..31bee22 100644
> --- a/hw/usb/hcd-ehci-pci.c
> +++ b/hw/usb/hcd-ehci-pci.c
> @@ -111,10 +111,9 @@ static void usb_ehci_pci_exit(PCIDevice *dev)
> s->irq = NULL;
> }
>
> -static void usb_ehci_pci_reset(DeviceState *dev)
> +static void usb_ehci_pci_reset_hold(Object *obj, ResetType type)
> {
> - PCIDevice *pci_dev = PCI_DEVICE(dev);
> - EHCIPCIState *i = PCI_EHCI(pci_dev);
> + EHCIPCIState *i = PCI_EHCI(obj);
> EHCIState *s = &i->ehci;
>
> ehci_reset(s);
> @@ -154,6 +153,7 @@ static void ehci_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> k->realize = usb_ehci_pci_realize;
> k->exit = usb_ehci_pci_exit;
> @@ -161,7 +161,7 @@ static void ehci_class_init(ObjectClass *klass, const void *data)
> k->config_write = usb_ehci_pci_write_config;
> dc->vmsd = &vmstate_ehci_pci;
> device_class_set_props(dc, ehci_pci_properties);
> - device_class_set_legacy_reset(dc, usb_ehci_pci_reset);
> + rc->phases.hold = usb_ehci_pci_reset_hold;
> }
>
> static const TypeInfo ehci_pci_type_info = {
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 03/11] hw/usb/hcd-ehci-sysbus: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
2026-11-30 20:02 ` [PATCH 01/11] hw/usb/hcd-dwc3: Convert " Oscar Alejandro Sánchez Lucero
2026-11-30 20:02 ` [PATCH 02/11] hw/usb/hcd-ehci-pci: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:47 ` Bin Meng
2026-12-01 14:47 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 04/11] hw/usb/hcd-ohci-pci: " Oscar Alejandro Sánchez Lucero
` (7 subsequent siblings)
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
usb_ehci_sysbus_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-ehci-sysbus.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index 7f7c7f8..1288bbd 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -46,10 +46,9 @@ static void usb_ehci_sysbus_realize(DeviceState *dev, Error **errp)
sysbus_init_irq(d, &s->irq);
}
-static void usb_ehci_sysbus_reset(DeviceState *dev)
+static void usb_ehci_sysbus_reset_hold(Object *obj, ResetType type)
{
- SysBusDevice *d = SYS_BUS_DEVICE(dev);
- EHCISysBusState *i = SYS_BUS_EHCI(d);
+ EHCISysBusState *i = SYS_BUS_EHCI(obj);
EHCIState *s = &i->ehci;
ehci_reset(s);
@@ -84,6 +83,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
sec->portscbase = 0x44;
sec->portnr = EHCI_PORTS;
@@ -91,7 +91,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, const void *data)
dc->realize = usb_ehci_sysbus_realize;
dc->vmsd = &vmstate_ehci_sysbus;
device_class_set_props(dc, ehci_sysbus_properties);
- device_class_set_legacy_reset(dc, usb_ehci_sysbus_reset);
+ rc->phases.hold = usb_ehci_sysbus_reset_hold;
set_bit(DEVICE_CATEGORY_USB, dc->categories);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 03/11] hw/usb/hcd-ehci-sysbus: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 03/11] hw/usb/hcd-ehci-sysbus: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:47 ` Bin Meng
2026-12-01 14:47 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:47 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:09 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ehci_sysbus_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-ehci-sysbus.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 03/11] hw/usb/hcd-ehci-sysbus: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 03/11] hw/usb/hcd-ehci-sysbus: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:47 ` Bin Meng
@ 2026-12-01 14:47 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:47 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ehci_sysbus_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-ehci-sysbus.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
> index 7f7c7f8..1288bbd 100644
> --- a/hw/usb/hcd-ehci-sysbus.c
> +++ b/hw/usb/hcd-ehci-sysbus.c
> @@ -46,10 +46,9 @@ static void usb_ehci_sysbus_realize(DeviceState *dev, Error **errp)
> sysbus_init_irq(d, &s->irq);
> }
>
> -static void usb_ehci_sysbus_reset(DeviceState *dev)
> +static void usb_ehci_sysbus_reset_hold(Object *obj, ResetType type)
> {
> - SysBusDevice *d = SYS_BUS_DEVICE(dev);
> - EHCISysBusState *i = SYS_BUS_EHCI(d);
> + EHCISysBusState *i = SYS_BUS_EHCI(obj);
> EHCIState *s = &i->ehci;
>
> ehci_reset(s);
> @@ -84,6 +83,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> sec->portscbase = 0x44;
> sec->portnr = EHCI_PORTS;
> @@ -91,7 +91,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, const void *data)
> dc->realize = usb_ehci_sysbus_realize;
> dc->vmsd = &vmstate_ehci_sysbus;
> device_class_set_props(dc, ehci_sysbus_properties);
> - device_class_set_legacy_reset(dc, usb_ehci_sysbus_reset);
> + rc->phases.hold = usb_ehci_sysbus_reset_hold;
> set_bit(DEVICE_CATEGORY_USB, dc->categories);
> }
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 04/11] hw/usb/hcd-ohci-pci: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (2 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 03/11] hw/usb/hcd-ehci-sysbus: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:48 ` Bin Meng
2026-12-01 14:48 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 05/11] hw/usb/hcd-ohci-sysbus: " Oscar Alejandro Sánchez Lucero
` (6 subsequent siblings)
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
usb_ohci_reset_pci_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-ohci-pci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c
index 70c9e9a..78135aa 100644
--- a/hw/usb/hcd-ohci-pci.c
+++ b/hw/usb/hcd-ohci-pci.c
@@ -99,10 +99,9 @@ static void usb_ohci_exit(PCIDevice *dev)
timer_free(s->eof_timer);
}
-static void usb_ohci_reset_pci(DeviceState *d)
+static void usb_ohci_reset_pci_hold(Object *obj, ResetType type)
{
- PCIDevice *dev = PCI_DEVICE(d);
- OHCIPCIState *ohci = PCI_OHCI(dev);
+ OHCIPCIState *ohci = PCI_OHCI(obj);
OHCIState *s = &ohci->state;
ohci_hard_reset(s);
@@ -129,6 +128,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
k->realize = usb_ohci_realize_pci;
k->exit = usb_ohci_exit;
@@ -140,7 +140,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
device_class_set_props(dc, ohci_pci_properties);
dc->hotpluggable = false;
dc->vmsd = &vmstate_ohci;
- device_class_set_legacy_reset(dc, usb_ohci_reset_pci);
+ rc->phases.hold = usb_ohci_reset_pci_hold;
}
static const TypeInfo ohci_pci_info = {
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 04/11] hw/usb/hcd-ohci-pci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 04/11] hw/usb/hcd-ohci-pci: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:48 ` Bin Meng
2026-12-01 14:48 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:48 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:09 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ohci_reset_pci_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-ohci-pci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 04/11] hw/usb/hcd-ohci-pci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 04/11] hw/usb/hcd-ohci-pci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:48 ` Bin Meng
@ 2026-12-01 14:48 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:48 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ohci_reset_pci_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-ohci-pci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c
> index 70c9e9a..78135aa 100644
> --- a/hw/usb/hcd-ohci-pci.c
> +++ b/hw/usb/hcd-ohci-pci.c
> @@ -99,10 +99,9 @@ static void usb_ohci_exit(PCIDevice *dev)
> timer_free(s->eof_timer);
> }
>
> -static void usb_ohci_reset_pci(DeviceState *d)
> +static void usb_ohci_reset_pci_hold(Object *obj, ResetType type)
> {
> - PCIDevice *dev = PCI_DEVICE(d);
> - OHCIPCIState *ohci = PCI_OHCI(dev);
> + OHCIPCIState *ohci = PCI_OHCI(obj);
> OHCIState *s = &ohci->state;
>
> ohci_hard_reset(s);
> @@ -129,6 +128,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> k->realize = usb_ohci_realize_pci;
> k->exit = usb_ohci_exit;
> @@ -140,7 +140,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
> device_class_set_props(dc, ohci_pci_properties);
> dc->hotpluggable = false;
> dc->vmsd = &vmstate_ohci;
> - device_class_set_legacy_reset(dc, usb_ohci_reset_pci);
> + rc->phases.hold = usb_ohci_reset_pci_hold;
> }
>
> static const TypeInfo ohci_pci_info = {
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 05/11] hw/usb/hcd-ohci-sysbus: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (3 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 04/11] hw/usb/hcd-ohci-pci: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:48 ` Bin Meng
2026-12-01 14:49 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 06/11] hw/usb/hcd-uhci: " Oscar Alejandro Sánchez Lucero
` (5 subsequent siblings)
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
ohci_sysbus_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-ohci-sysbus.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-ohci-sysbus.c b/hw/usb/hcd-ohci-sysbus.c
index 4f51eeb..de3e688 100644
--- a/hw/usb/hcd-ohci-sysbus.c
+++ b/hw/usb/hcd-ohci-sysbus.c
@@ -48,9 +48,9 @@ static void ohci_sysbus_realize(DeviceState *dev, Error **errp)
sysbus_init_mmio(sbd, &s->ohci.mem);
}
-static void ohci_sysbus_reset(DeviceState *dev)
+static void ohci_sysbus_reset_hold(Object *obj, ResetType type)
{
- OHCISysBusState *s = SYSBUS_OHCI(dev);
+ OHCISysBusState *s = SYSBUS_OHCI(obj);
OHCIState *ohci = &s->ohci;
ohci_hard_reset(ohci);
@@ -66,12 +66,13 @@ static const Property ohci_sysbus_properties[] = {
static void ohci_sysbus_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
dc->realize = ohci_sysbus_realize;
set_bit(DEVICE_CATEGORY_USB, dc->categories);
dc->desc = "OHCI USB Controller";
device_class_set_props(dc, ohci_sysbus_properties);
- device_class_set_legacy_reset(dc, ohci_sysbus_reset);
+ rc->phases.hold = ohci_sysbus_reset_hold;
}
static const TypeInfo ohci_sysbus_types[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 05/11] hw/usb/hcd-ohci-sysbus: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 05/11] hw/usb/hcd-ohci-sysbus: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:48 ` Bin Meng
2026-12-01 14:49 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:48 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:09 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> ohci_sysbus_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-ohci-sysbus.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 05/11] hw/usb/hcd-ohci-sysbus: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 05/11] hw/usb/hcd-ohci-sysbus: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:48 ` Bin Meng
@ 2026-12-01 14:49 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:49 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> ohci_sysbus_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-ohci-sysbus.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/usb/hcd-ohci-sysbus.c b/hw/usb/hcd-ohci-sysbus.c
> index 4f51eeb..de3e688 100644
> --- a/hw/usb/hcd-ohci-sysbus.c
> +++ b/hw/usb/hcd-ohci-sysbus.c
> @@ -48,9 +48,9 @@ static void ohci_sysbus_realize(DeviceState *dev, Error **errp)
> sysbus_init_mmio(sbd, &s->ohci.mem);
> }
>
> -static void ohci_sysbus_reset(DeviceState *dev)
> +static void ohci_sysbus_reset_hold(Object *obj, ResetType type)
> {
> - OHCISysBusState *s = SYSBUS_OHCI(dev);
> + OHCISysBusState *s = SYSBUS_OHCI(obj);
> OHCIState *ohci = &s->ohci;
>
> ohci_hard_reset(ohci);
> @@ -66,12 +66,13 @@ static const Property ohci_sysbus_properties[] = {
> static void ohci_sysbus_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> dc->realize = ohci_sysbus_realize;
> set_bit(DEVICE_CATEGORY_USB, dc->categories);
> dc->desc = "OHCI USB Controller";
> device_class_set_props(dc, ohci_sysbus_properties);
> - device_class_set_legacy_reset(dc, ohci_sysbus_reset);
> + rc->phases.hold = ohci_sysbus_reset_hold;
> }
>
> static const TypeInfo ohci_sysbus_types[] = {
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 06/11] hw/usb/hcd-uhci: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (4 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 05/11] hw/usb/hcd-ohci-sysbus: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:49 ` Bin Meng
` (2 more replies)
2026-11-30 20:02 ` [PATCH 07/11] hw/usb/hcd-xhci-pci: " Oscar Alejandro Sánchez Lucero
` (4 subsequent siblings)
10 siblings, 3 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Extract the core reset logic into a uhci_reset() helper for internal
register-triggered resets, and replace the transitional
device_class_set_legacy_reset() wrapper with the ResettableClass
interface by implementing the hold phase in uhci_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-uhci.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index a7b9fe1..cfeeee8 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -302,10 +302,8 @@ static void uhci_update_irq(UHCIState *s)
qemu_set_irq(s->irq, level);
}
-static void uhci_reset(DeviceState *dev)
+static void uhci_reset(UHCIState *s)
{
- PCIDevice *d = PCI_DEVICE(dev);
- UHCIState *s = UHCI(d);
uint8_t *pci_conf;
int i;
UHCIPort *port;
@@ -409,11 +407,11 @@ static void uhci_port_write(void *opaque, hwaddr addr,
port = &s->ports[i];
usb_device_reset(port->port.dev);
}
- uhci_reset(DEVICE(s));
+ uhci_reset(s);
return;
}
if (val & UHCI_CMD_HCRESET) {
- uhci_reset(DEVICE(s));
+ uhci_reset(s);
return;
}
s->cmd = val;
@@ -1266,14 +1264,20 @@ static const Property uhci_properties_standalone[] = {
DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
};
+static void uhci_reset_hold(Object *obj, ResetType type)
+{
+ uhci_reset(UHCI(obj));
+}
+
static void uhci_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
k->class_id = PCI_CLASS_SERIAL_USB;
dc->vmsd = &vmstate_uhci;
- device_class_set_legacy_reset(dc, uhci_reset);
+ rc->phases.hold = uhci_reset_hold;
set_bit(DEVICE_CATEGORY_USB, dc->categories);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 06/11] hw/usb/hcd-uhci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 06/11] hw/usb/hcd-uhci: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:49 ` Bin Meng
2026-12-01 14:51 ` Tommaso Califano
2026-12-01 14:52 ` Tommaso Califano
2 siblings, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:49 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:06 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Extract the core reset logic into a uhci_reset() helper for internal
> register-triggered resets, and replace the transitional
> device_class_set_legacy_reset() wrapper with the ResettableClass
> interface by implementing the hold phase in uhci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-uhci.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 06/11] hw/usb/hcd-uhci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 06/11] hw/usb/hcd-uhci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:49 ` Bin Meng
@ 2026-12-01 14:51 ` Tommaso Califano
2026-12-01 14:52 ` Tommaso Califano
2 siblings, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:51 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Extract the core reset logic into a uhci_reset() helper for internal
> register-triggered resets, and replace the transitional
> device_class_set_legacy_reset() wrapper with the ResettableClass
> interface by implementing the hold phase in uhci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-uhci.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
> index a7b9fe1..cfeeee8 100644
> --- a/hw/usb/hcd-uhci.c
> +++ b/hw/usb/hcd-uhci.c
> @@ -302,10 +302,8 @@ static void uhci_update_irq(UHCIState *s)
> qemu_set_irq(s->irq, level);
> }
>
> -static void uhci_reset(DeviceState *dev)
> +static void uhci_reset(UHCIState *s)
> {
> - PCIDevice *d = PCI_DEVICE(dev);
> - UHCIState *s = UHCI(d);
> uint8_t *pci_conf;
> int i;
> UHCIPort *port;
> @@ -409,11 +407,11 @@ static void uhci_port_write(void *opaque, hwaddr addr,
> port = &s->ports[i];
> usb_device_reset(port->port.dev);
> }
> - uhci_reset(DEVICE(s));
> + uhci_reset(s);
> return;
> }
> if (val & UHCI_CMD_HCRESET) {
> - uhci_reset(DEVICE(s));
> + uhci_reset(s);
> return;
> }
> s->cmd = val;
> @@ -1266,14 +1264,20 @@ static const Property uhci_properties_standalone[] = {
> DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
> };
>
> +static void uhci_reset_hold(Object *obj, ResetType type)
> +{
> + uhci_reset(UHCI(obj));
> +}
> +
> static void uhci_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> k->class_id = PCI_CLASS_SERIAL_USB;
> dc->vmsd = &vmstate_uhci;
> - device_class_set_legacy_reset(dc, uhci_reset);
> + rc->phases.hold = uhci_reset_hold;
> set_bit(DEVICE_CATEGORY_USB, dc->categories);
> }
>
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH 06/11] hw/usb/hcd-uhci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 06/11] hw/usb/hcd-uhci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:49 ` Bin Meng
2026-12-01 14:51 ` Tommaso Califano
@ 2026-12-01 14:52 ` Tommaso Califano
2 siblings, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:52 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Extract the core reset logic into a uhci_reset() helper for internal
> register-triggered resets, and replace the transitional
> device_class_set_legacy_reset() wrapper with the ResettableClass
> interface by implementing the hold phase in uhci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-uhci.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
> index a7b9fe1..cfeeee8 100644
> --- a/hw/usb/hcd-uhci.c
> +++ b/hw/usb/hcd-uhci.c
> @@ -302,10 +302,8 @@ static void uhci_update_irq(UHCIState *s)
> qemu_set_irq(s->irq, level);
> }
>
> -static void uhci_reset(DeviceState *dev)
> +static void uhci_reset(UHCIState *s)
> {
> - PCIDevice *d = PCI_DEVICE(dev);
> - UHCIState *s = UHCI(d);
> uint8_t *pci_conf;
> int i;
> UHCIPort *port;
> @@ -409,11 +407,11 @@ static void uhci_port_write(void *opaque, hwaddr addr,
> port = &s->ports[i];
> usb_device_reset(port->port.dev);
> }
> - uhci_reset(DEVICE(s));
> + uhci_reset(s);
> return;
> }
> if (val & UHCI_CMD_HCRESET) {
> - uhci_reset(DEVICE(s));
> + uhci_reset(s);
> return;
> }
> s->cmd = val;
> @@ -1266,14 +1264,20 @@ static const Property uhci_properties_standalone[] = {
> DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
> };
>
> +static void uhci_reset_hold(Object *obj, ResetType type)
> +{
> + uhci_reset(UHCI(obj));
> +}
> +
> static void uhci_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> k->class_id = PCI_CLASS_SERIAL_USB;
> dc->vmsd = &vmstate_uhci;
> - device_class_set_legacy_reset(dc, uhci_reset);
> + rc->phases.hold = uhci_reset_hold;
> set_bit(DEVICE_CATEGORY_USB, dc->categories);
> }
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 07/11] hw/usb/hcd-xhci-pci: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (5 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 06/11] hw/usb/hcd-uhci: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:49 ` Bin Meng
2026-12-01 14:53 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 08/11] hw/usb/hcd-xhci-sysbus: " Oscar Alejandro Sánchez Lucero
` (3 subsequent siblings)
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
xhci_pci_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-xhci-pci.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index a3615b2..0a642d2 100644
--- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c
@@ -97,9 +97,9 @@ static bool xhci_pci_intr_mapping_conditional(XHCIState *xhci)
return msix_enabled(pci_dev) || msi_enabled(pci_dev);
}
-static void xhci_pci_reset(DeviceState *dev)
+static void xhci_pci_reset_hold(Object *obj, ResetType type)
{
- XHCIPciState *s = XHCI_PCI(dev);
+ XHCIPciState *s = XHCI_PCI(obj);
device_cold_reset(DEVICE(&s->xhci));
}
@@ -245,8 +245,9 @@ static void xhci_class_init(ObjectClass *klass, const void *data)
{
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
- device_class_set_legacy_reset(dc, xhci_pci_reset);
+ rc->phases.hold = xhci_pci_reset_hold;
dc->vmsd = &vmstate_xhci_pci;
set_bit(DEVICE_CATEGORY_USB, dc->categories);
k->realize = usb_xhci_pci_realize;
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 07/11] hw/usb/hcd-xhci-pci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 07/11] hw/usb/hcd-xhci-pci: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:49 ` Bin Meng
2026-12-01 14:53 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:49 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:06 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> xhci_pci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-xhci-pci.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 07/11] hw/usb/hcd-xhci-pci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 07/11] hw/usb/hcd-xhci-pci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:49 ` Bin Meng
@ 2026-12-01 14:53 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:53 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> xhci_pci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-xhci-pci.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
> index a3615b2..0a642d2 100644
> --- a/hw/usb/hcd-xhci-pci.c
> +++ b/hw/usb/hcd-xhci-pci.c
> @@ -97,9 +97,9 @@ static bool xhci_pci_intr_mapping_conditional(XHCIState *xhci)
> return msix_enabled(pci_dev) || msi_enabled(pci_dev);
> }
>
> -static void xhci_pci_reset(DeviceState *dev)
> +static void xhci_pci_reset_hold(Object *obj, ResetType type)
> {
> - XHCIPciState *s = XHCI_PCI(dev);
> + XHCIPciState *s = XHCI_PCI(obj);
>
> device_cold_reset(DEVICE(&s->xhci));
> }
> @@ -245,8 +245,9 @@ static void xhci_class_init(ObjectClass *klass, const void *data)
> {
> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> DeviceClass *dc = DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> - device_class_set_legacy_reset(dc, xhci_pci_reset);
> + rc->phases.hold = xhci_pci_reset_hold;
> dc->vmsd = &vmstate_xhci_pci;
> set_bit(DEVICE_CATEGORY_USB, dc->categories);
> k->realize = usb_xhci_pci_realize;
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 08/11] hw/usb/hcd-xhci-sysbus: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (6 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 07/11] hw/usb/hcd-xhci-pci: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:49 ` Bin Meng
2026-12-01 14:54 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 09/11] hw/usb/hcd-xhci: " Oscar Alejandro Sánchez Lucero
` (2 subsequent siblings)
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
xhci_sysbus_reset_hold(), keeping xhci_sysbus_reset() for external callers.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-xhci-sysbus.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index 8dd50fb..8c0d67b 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -97,11 +97,17 @@ static const VMStateDescription vmstate_xhci_sysbus = {
}
};
+static void xhci_sysbus_reset_hold(Object *obj, ResetType type)
+{
+ xhci_sysbus_reset(DEVICE(obj));
+}
+
static void xhci_sysbus_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
- device_class_set_legacy_reset(dc, xhci_sysbus_reset);
+ rc->phases.hold = xhci_sysbus_reset_hold;
dc->realize = xhci_sysbus_realize;
dc->vmsd = &vmstate_xhci_sysbus;
device_class_set_props(dc, xhci_sysbus_props);
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 08/11] hw/usb/hcd-xhci-sysbus: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 08/11] hw/usb/hcd-xhci-sysbus: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:49 ` Bin Meng
2026-12-01 14:54 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:49 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:08 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> xhci_sysbus_reset_hold(), keeping xhci_sysbus_reset() for external callers.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-xhci-sysbus.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 08/11] hw/usb/hcd-xhci-sysbus: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 08/11] hw/usb/hcd-xhci-sysbus: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:49 ` Bin Meng
@ 2026-12-01 14:54 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:54 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> xhci_sysbus_reset_hold(), keeping xhci_sysbus_reset() for external callers.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-xhci-sysbus.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
> index 8dd50fb..8c0d67b 100644
> --- a/hw/usb/hcd-xhci-sysbus.c
> +++ b/hw/usb/hcd-xhci-sysbus.c
> @@ -97,11 +97,17 @@ static const VMStateDescription vmstate_xhci_sysbus = {
> }
> };
>
> +static void xhci_sysbus_reset_hold(Object *obj, ResetType type)
> +{
> + xhci_sysbus_reset(DEVICE(obj));
> +}
> +
> static void xhci_sysbus_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> - device_class_set_legacy_reset(dc, xhci_sysbus_reset);
> + rc->phases.hold = xhci_sysbus_reset_hold;
> dc->realize = xhci_sysbus_realize;
> dc->vmsd = &vmstate_xhci_sysbus;
> device_class_set_props(dc, xhci_sysbus_props);
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 09/11] hw/usb/hcd-xhci: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (7 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 08/11] hw/usb/hcd-xhci-sysbus: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:50 ` Bin Meng
2026-12-01 14:55 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 10/11] hw/usb/imx-usb-phy: " Oscar Alejandro Sánchez Lucero
2026-11-30 20:02 ` [PATCH 11/11] hw/usb/pc87560-ohci: " Oscar Alejandro Sánchez Lucero
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Extract the core reset logic into an xhci_reset() helper for internal
USBCMD_HCRST resets, and replace the transitional
device_class_set_legacy_reset() wrapper with the ResettableClass
interface by implementing the hold phase in xhci_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/hcd-xhci.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index aac7f67..3d70f42 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2716,9 +2716,8 @@ static void xhci_port_reset(XHCIPort *port, bool warm_reset)
xhci_port_notify(port, PORTSC_PRC);
}
-static void xhci_reset(DeviceState *dev)
+static void xhci_reset(XHCIState *xhci)
{
- XHCIState *xhci = XHCI(dev);
int i;
trace_usb_xhci_reset();
@@ -3005,7 +3004,7 @@ static void xhci_oper_write(void *ptr, hwaddr reg,
xhci->usbcmd = val & 0xc0f;
xhci_mfwrap_update(xhci);
if (val & USBCMD_HCRST) {
- xhci_reset(DEVICE(xhci));
+ xhci_reset(xhci);
}
xhci_intr_update(xhci, 0);
break;
@@ -3702,13 +3701,19 @@ static const Property xhci_properties[] = {
DeviceState *),
};
+static void xhci_reset_hold(Object *obj, ResetType type)
+{
+ xhci_reset(XHCI(obj));
+}
+
static void xhci_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
dc->realize = usb_xhci_realize;
dc->unrealize = usb_xhci_unrealize;
- device_class_set_legacy_reset(dc, xhci_reset);
+ rc->phases.hold = xhci_reset_hold;
device_class_set_props(dc, xhci_properties);
dc->user_creatable = false;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 09/11] hw/usb/hcd-xhci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 09/11] hw/usb/hcd-xhci: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:50 ` Bin Meng
2026-12-01 14:55 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:50 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:09 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Extract the core reset logic into an xhci_reset() helper for internal
> USBCMD_HCRST resets, and replace the transitional
> device_class_set_legacy_reset() wrapper with the ResettableClass
> interface by implementing the hold phase in xhci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/hcd-xhci.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 09/11] hw/usb/hcd-xhci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 09/11] hw/usb/hcd-xhci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:50 ` Bin Meng
@ 2026-12-01 14:55 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:55 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Extract the core reset logic into an xhci_reset() helper for internal
> USBCMD_HCRST resets, and replace the transitional
> device_class_set_legacy_reset() wrapper with the ResettableClass
> interface by implementing the hold phase in xhci_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/hcd-xhci.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
> index aac7f67..3d70f42 100644
> --- a/hw/usb/hcd-xhci.c
> +++ b/hw/usb/hcd-xhci.c
> @@ -2716,9 +2716,8 @@ static void xhci_port_reset(XHCIPort *port, bool warm_reset)
> xhci_port_notify(port, PORTSC_PRC);
> }
>
> -static void xhci_reset(DeviceState *dev)
> +static void xhci_reset(XHCIState *xhci)
> {
> - XHCIState *xhci = XHCI(dev);
> int i;
>
> trace_usb_xhci_reset();
> @@ -3005,7 +3004,7 @@ static void xhci_oper_write(void *ptr, hwaddr reg,
> xhci->usbcmd = val & 0xc0f;
> xhci_mfwrap_update(xhci);
> if (val & USBCMD_HCRST) {
> - xhci_reset(DEVICE(xhci));
> + xhci_reset(xhci);
> }
> xhci_intr_update(xhci, 0);
> break;
> @@ -3702,13 +3701,19 @@ static const Property xhci_properties[] = {
> DeviceState *),
> };
>
> +static void xhci_reset_hold(Object *obj, ResetType type)
> +{
> + xhci_reset(XHCI(obj));
> +}
> +
> static void xhci_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> dc->realize = usb_xhci_realize;
> dc->unrealize = usb_xhci_unrealize;
> - device_class_set_legacy_reset(dc, xhci_reset);
> + rc->phases.hold = xhci_reset_hold;
> device_class_set_props(dc, xhci_properties);
> dc->user_creatable = false;
> }
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 10/11] hw/usb/imx-usb-phy: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (8 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 09/11] hw/usb/hcd-xhci: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:50 ` Bin Meng
2026-12-01 14:58 ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 11/11] hw/usb/pc87560-ohci: " Oscar Alejandro Sánchez Lucero
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
imx_usbphy_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/imx-usb-phy.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/usb/imx-usb-phy.c b/hw/usb/imx-usb-phy.c
index 2b2913c..5b28f14 100644
--- a/hw/usb/imx-usb-phy.c
+++ b/hw/usb/imx-usb-phy.c
@@ -34,9 +34,9 @@ static void imx_usbphy_softreset(IMXUSBPHYState *s)
s->usbphy[USBPHY_CTRL] = 0xc0200000;
}
-static void imx_usbphy_reset(DeviceState *dev)
+static void imx_usbphy_reset_hold(Object *obj, ResetType type)
{
- IMXUSBPHYState *s = IMX_USBPHY(dev);
+ IMXUSBPHYState *s = IMX_USBPHY(obj);
s->usbphy[USBPHY_STATUS] = 0x00000000;
s->usbphy[USBPHY_DEBUG] = 0x7f180000;
@@ -217,8 +217,9 @@ static void imx_usbphy_realize(DeviceState *dev, Error **errp)
static void imx_usbphy_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
- device_class_set_legacy_reset(dc, imx_usbphy_reset);
+ rc->phases.hold = imx_usbphy_reset_hold;
dc->vmsd = &vmstate_imx_usbphy;
dc->desc = "i.MX USB PHY Module";
dc->realize = imx_usbphy_realize;
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 10/11] hw/usb/imx-usb-phy: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 10/11] hw/usb/imx-usb-phy: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:50 ` Bin Meng
2026-12-01 14:58 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:50 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:07 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> imx_usbphy_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/imx-usb-phy.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 10/11] hw/usb/imx-usb-phy: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 10/11] hw/usb/imx-usb-phy: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:50 ` Bin Meng
@ 2026-12-01 14:58 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:58 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> imx_usbphy_reset_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/imx-usb-phy.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/usb/imx-usb-phy.c b/hw/usb/imx-usb-phy.c
> index 2b2913c..5b28f14 100644
> --- a/hw/usb/imx-usb-phy.c
> +++ b/hw/usb/imx-usb-phy.c
> @@ -34,9 +34,9 @@ static void imx_usbphy_softreset(IMXUSBPHYState *s)
> s->usbphy[USBPHY_CTRL] = 0xc0200000;
> }
>
> -static void imx_usbphy_reset(DeviceState *dev)
> +static void imx_usbphy_reset_hold(Object *obj, ResetType type)
> {
> - IMXUSBPHYState *s = IMX_USBPHY(dev);
> + IMXUSBPHYState *s = IMX_USBPHY(obj);
>
> s->usbphy[USBPHY_STATUS] = 0x00000000;
> s->usbphy[USBPHY_DEBUG] = 0x7f180000;
> @@ -217,8 +217,9 @@ static void imx_usbphy_realize(DeviceState *dev, Error **errp)
> static void imx_usbphy_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> - device_class_set_legacy_reset(dc, imx_usbphy_reset);
> + rc->phases.hold = imx_usbphy_reset_hold;
> dc->vmsd = &vmstate_imx_usbphy;
> dc->desc = "i.MX USB PHY Module";
> dc->realize = imx_usbphy_realize;
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 11/11] hw/usb/pc87560-ohci: Convert to Resettable interface
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
` (9 preceding siblings ...)
2026-11-30 20:02 ` [PATCH 10/11] hw/usb/imx-usb-phy: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero
2026-12-01 13:50 ` Bin Meng
2026-12-01 14:59 ` Tommaso Califano
10 siblings, 2 replies; 36+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 20:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
Oscar Alejandro Sánchez Lucero
Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
usb_ohci_reset_pci_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/usb/pc87560-ohci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/usb/pc87560-ohci.c b/hw/usb/pc87560-ohci.c
index cc00f6e..5c18206 100644
--- a/hw/usb/pc87560-ohci.c
+++ b/hw/usb/pc87560-ohci.c
@@ -280,10 +280,9 @@ static void usb_ohci_exit(PCIDevice *dev)
timer_free(s->eof_timer);
}
-static void usb_ohci_reset_pci(DeviceState *d)
+static void usb_ohci_reset_pci_hold(Object *obj, ResetType type)
{
- PCIDevice *dev = PCI_DEVICE(d);
- OHCIPCIState *ohci = NSC_PCI_OHCI(dev);
+ OHCIPCIState *ohci = NSC_PCI_OHCI(obj);
OHCIState *s = &ohci->state;
ohci_hard_reset(s);
@@ -315,6 +314,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
k->realize = usb_ohci_realize_pci;
k->exit = usb_ohci_exit;
@@ -333,7 +333,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
dc->hotpluggable = false;
dc->user_creatable = false;
dc->vmsd = &vmstate_ohci;
- device_class_set_legacy_reset(dc, usb_ohci_reset_pci);
+ rc->phases.hold = usb_ohci_reset_pci_hold;
}
static const TypeInfo ohci_pci_info = {
--
2.53.0
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH 11/11] hw/usb/pc87560-ohci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 11/11] hw/usb/pc87560-ohci: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 13:50 ` Bin Meng
2026-12-01 14:59 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Bin Meng @ 2026-12-01 13:50 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller
On Tue, Dec 1, 2026 at 4:09 AM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ohci_reset_pci_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/usb/pc87560-ohci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH 11/11] hw/usb/pc87560-ohci: Convert to Resettable interface
2026-11-30 20:02 ` [PATCH 11/11] hw/usb/pc87560-ohci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:50 ` Bin Meng
@ 2026-12-01 14:59 ` Tommaso Califano
1 sibling, 0 replies; 36+ messages in thread
From: Tommaso Califano @ 2026-12-01 14:59 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero, qemu-devel
Cc: Peter Maydell, Jean-Christophe Dubois, qemu-arm,
Richard Henderson, Helge Deller,
qemu-devel-bounces+tcalifano=redhat.com
On Mon Nov 30, 2026 at 9:02 PM CET, Oscar Alejandro Sánchez Lucero wrote:
> Replace the transitional device_class_set_legacy_reset() wrapper with
> the ResettableClass interface by implementing the hold phase in
> usb_ohci_reset_pci_hold().
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
Reviewed-by: Tommaso Califano <tcalifano@redhat.com>
> ---
> hw/usb/pc87560-ohci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/usb/pc87560-ohci.c b/hw/usb/pc87560-ohci.c
> index cc00f6e..5c18206 100644
> --- a/hw/usb/pc87560-ohci.c
> +++ b/hw/usb/pc87560-ohci.c
> @@ -280,10 +280,9 @@ static void usb_ohci_exit(PCIDevice *dev)
> timer_free(s->eof_timer);
> }
>
> -static void usb_ohci_reset_pci(DeviceState *d)
> +static void usb_ohci_reset_pci_hold(Object *obj, ResetType type)
> {
> - PCIDevice *dev = PCI_DEVICE(d);
> - OHCIPCIState *ohci = NSC_PCI_OHCI(dev);
> + OHCIPCIState *ohci = NSC_PCI_OHCI(obj);
> OHCIState *s = &ohci->state;
>
> ohci_hard_reset(s);
> @@ -315,6 +314,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> k->realize = usb_ohci_realize_pci;
> k->exit = usb_ohci_exit;
> @@ -333,7 +333,7 @@ static void ohci_pci_class_init(ObjectClass *klass, const void *data)
> dc->hotpluggable = false;
> dc->user_creatable = false;
> dc->vmsd = &vmstate_ohci;
> - device_class_set_legacy_reset(dc, usb_ohci_reset_pci);
> + rc->phases.hold = usb_ohci_reset_pci_hold;
> }
>
> static const TypeInfo ohci_pci_info = {
^ permalink raw reply [flat|nested] 36+ messages in thread