From: "Tommaso Califano" <tcalifano@redhat.com>
To: "Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>,
qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
<qemu-arm@nongnu.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Helge Deller" <deller@gmx.de>,
<qemu-devel-bounces+tcalifano=redhat.com@nongnu.org>
Subject: Re: [PATCH 06/11] hw/usb/hcd-uhci: Convert to Resettable interface
Date: Tue, 01 Dec 2026 15:51:11 +0100 [thread overview]
Message-ID: <DN9HB7QKJ5RX.1MFWXJWWP9TKV@redhat.com> (raw)
In-Reply-To: <20261130-b4-usb-resettable-v1-6-2ee503f50c8a@gmail.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);
> }
>
next prev parent reply other threads:[~2026-12-01 15:25 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
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-12-01 13:47 ` Bin Meng
2026-12-01 14:46 ` Tommaso Califano
2026-12-01 21:38 ` Philippe Mathieu-Daudé
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
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
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
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
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 [this message]
2026-12-01 14:52 ` Tommaso Califano
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
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
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
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
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DN9HB7QKJ5RX.1MFWXJWWP9TKV@redhat.com \
--to=tcalifano@redhat.com \
--cc=aleszlucero@gmail.com \
--cc=deller@gmx.de \
--cc=jcd@tribudubois.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel-bounces+tcalifano=redhat.com@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.