All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices
@ 2020-11-07 11:13 Philippe Mathieu-Daudé
  2020-11-07 11:13 ` [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract Philippe Mathieu-Daudé
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-07 11:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sai Pavan Boddu, Philippe Mathieu-Daudé, Gerd Hoffmann

Fix few regressions introduced while introducing xhci-sysbus.

Cleaned a bit code style while here, patches included for 6.0.

Philippe Mathieu-Daudé (5):
  hw/usb/hcd-xhci: Make xhci base model abstract
  hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI)
  hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COMMON
  hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro
  hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON

 hw/usb/hcd-xhci-pci.h    |  6 ++----
 hw/usb/hcd-xhci.h        |  4 +++-
 include/hw/usb/xhci.h    |  1 -
 hw/usb/hcd-xhci-nec.c    |  2 +-
 hw/usb/hcd-xhci-pci.c    | 18 +++++++++---------
 hw/usb/hcd-xhci-sysbus.c |  2 +-
 hw/usb/hcd-xhci.c        | 11 ++++++-----
 hw/usb/Kconfig           |  4 +---
 8 files changed, 23 insertions(+), 25 deletions(-)

-- 
2.26.2




^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract
  2020-11-07 11:13 [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices Philippe Mathieu-Daudé
@ 2020-11-07 11:13 ` Philippe Mathieu-Daudé
  2020-11-08 13:38   ` Sai Pavan Boddu
  2020-11-09  9:51   ` Gerd Hoffmann
  2020-11-07 11:13 ` [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI) Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-07 11:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Sai Pavan Boddu, Miroslav Rezanina, Philippe Mathieu-Daudé,
	Gerd Hoffmann

The TYPE_XHCI model is abstract and can not be used as it.
It is meant to be overloaded by children classes. Restore
it as abstract type.

Fixes: 8ddab8dd3d8 ("usb/hcd-xhci: Split pci wrapper for xhci base model")
Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/usb/hcd-xhci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 79ce5c4be6c..57b692ad849 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3595,6 +3595,7 @@ static const TypeInfo xhci_info = {
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(XHCIState),
     .class_init    = xhci_class_init,
+    .abstract      = true,
 };
 
 static void xhci_register_types(void)
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI)
  2020-11-07 11:13 [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices Philippe Mathieu-Daudé
  2020-11-07 11:13 ` [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract Philippe Mathieu-Daudé
@ 2020-11-07 11:13 ` Philippe Mathieu-Daudé
  2020-11-08 13:40   ` Sai Pavan Boddu
  2020-11-09 11:08   ` Gerd Hoffmann
  2020-11-07 11:13 ` [PATCH-for-6.0 3/5] hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COMMON Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-07 11:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sai Pavan Boddu, Philippe Mathieu-Daudé, Gerd Hoffmann

Since commit 755fba11fbc and 8ddab8dd3d8 we can not build
USB_XHCI_NEC without USB_XHCI_PCI. Correct the Kconfig
dependency.

Fixes: 755fba11fbc ("usb/hcd-xhci: Move qemu-xhci device to hcd-xhci-pci.c")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/usb/Kconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index a674ce4c542..6a213b04758 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -42,9 +42,7 @@ config USB_XHCI_PCI
 
 config USB_XHCI_NEC
     bool
-    default y if PCI_DEVICES
-    depends on PCI
-    select USB_XHCI
+    select USB_XHCI_PCI
 
 config USB_XHCI_SYSBUS
     bool
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH-for-6.0 3/5] hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COMMON
  2020-11-07 11:13 [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices Philippe Mathieu-Daudé
  2020-11-07 11:13 ` [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract Philippe Mathieu-Daudé
  2020-11-07 11:13 ` [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI) Philippe Mathieu-Daudé
@ 2020-11-07 11:13 ` Philippe Mathieu-Daudé
  2020-11-07 11:13 ` [PATCH-for-6.0 4/5] hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro Philippe Mathieu-Daudé
  2020-11-07 11:13 ` [PATCH-for-6.0 5/5] hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON Philippe Mathieu-Daudé
  4 siblings, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-07 11:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sai Pavan Boddu, Philippe Mathieu-Daudé, Gerd Hoffmann

Follow the code base style by using the _COMMON suffix to
abstract QOM types.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/usb/hcd-xhci.h        |  4 +++-
 include/hw/usb/xhci.h    |  1 -
 hw/usb/hcd-xhci-pci.c    |  2 +-
 hw/usb/hcd-xhci-sysbus.c |  2 +-
 hw/usb/hcd-xhci.c        | 10 +++++-----
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
index ccf50ae28be..7bd10964f92 100644
--- a/hw/usb/hcd-xhci.h
+++ b/hw/usb/hcd-xhci.h
@@ -27,7 +27,9 @@
 #include "hw/usb/xhci.h"
 #include "sysemu/dma.h"
 
-OBJECT_DECLARE_SIMPLE_TYPE(XHCIState, XHCI)
+#define TYPE_XHCI_COMMON "base-xhci" /* Common to PCI and Sysbus */
+
+OBJECT_DECLARE_SIMPLE_TYPE(XHCIState, XHCI_COMMON)
 
 /* Very pessimistic, let's hope it's enough for all cases */
 #define EV_QUEUE (((3 * 24) + 16) * XHCI_MAXSLOTS)
diff --git a/include/hw/usb/xhci.h b/include/hw/usb/xhci.h
index 5c90e1373e5..90b56429199 100644
--- a/include/hw/usb/xhci.h
+++ b/include/hw/usb/xhci.h
@@ -1,7 +1,6 @@
 #ifndef HW_USB_XHCI_H
 #define HW_USB_XHCI_H
 
-#define TYPE_XHCI "base-xhci"
 #define TYPE_NEC_XHCI "nec-usb-xhci"
 #define TYPE_QEMU_XHCI "qemu-xhci"
 #define TYPE_XHCI_SYSBUS "sysbus-xhci"
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index b78fcd2bb2d..2ca018a4290 100644
--- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c
@@ -193,7 +193,7 @@ static void xhci_instance_init(Object *obj)
      * line, therefore, no need to wait to realize like other devices
      */
     PCI_DEVICE(obj)->cap_present |= QEMU_PCI_CAP_EXPRESS;
-    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI);
+    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI_COMMON);
     qdev_alias_all_properties(DEVICE(&s->xhci), obj);
 }
 
diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index 29185d2261f..f2ec08ffa4e 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -58,7 +58,7 @@ static void xhci_sysbus_instance_init(Object *obj)
 {
     XHCISysbusState *s = XHCI_SYSBUS(obj);
 
-    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI);
+    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI_COMMON);
     qdev_alias_all_properties(DEVICE(&s->xhci), obj);
 
     object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 57b692ad849..3abe416dfd6 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2637,7 +2637,7 @@ static void xhci_port_reset(XHCIPort *port, bool warm_reset)
 
 static void xhci_reset(DeviceState *dev)
 {
-    XHCIState *xhci = XHCI(dev);
+    XHCIState *xhci = XHCI_COMMON(dev);
     int i;
 
     trace_usb_xhci_reset();
@@ -2891,7 +2891,7 @@ static uint64_t xhci_oper_read(void *ptr, hwaddr reg, unsigned size)
 static void xhci_oper_write(void *ptr, hwaddr reg,
                             uint64_t val, unsigned size)
 {
-    XHCIState *xhci = XHCI(ptr);
+    XHCIState *xhci = XHCI_COMMON(ptr);
 
     trace_usb_xhci_oper_write(reg, val);
 
@@ -3327,7 +3327,7 @@ static void usb_xhci_realize(DeviceState *dev, Error **errp)
 {
     int i;
 
-    XHCIState *xhci = XHCI(dev);
+    XHCIState *xhci = XHCI_COMMON(dev);
 
     if (xhci->numintrs > XHCI_MAXINTRS) {
         xhci->numintrs = XHCI_MAXINTRS;
@@ -3381,7 +3381,7 @@ static void usb_xhci_realize(DeviceState *dev, Error **errp)
 static void usb_xhci_unrealize(DeviceState *dev)
 {
     int i;
-    XHCIState *xhci = XHCI(dev);
+    XHCIState *xhci = XHCI_COMMON(dev);
 
     trace_usb_xhci_exit();
 
@@ -3591,7 +3591,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo xhci_info = {
-    .name          = TYPE_XHCI,
+    .name          = TYPE_XHCI_COMMON,
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(XHCIState),
     .class_init    = xhci_class_init,
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH-for-6.0 4/5] hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro
  2020-11-07 11:13 [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-11-07 11:13 ` [PATCH-for-6.0 3/5] hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COMMON Philippe Mathieu-Daudé
@ 2020-11-07 11:13 ` Philippe Mathieu-Daudé
  2020-11-07 11:13 ` [PATCH-for-6.0 5/5] hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON Philippe Mathieu-Daudé
  4 siblings, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-07 11:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Sai Pavan Boddu, qemu-trivial, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Eduardo Habkost

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-trivial@nongnu.org

 hw/usb/hcd-xhci-pci.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h
index aa2e890627c..cf9a180caa4 100644
--- a/hw/usb/hcd-xhci-pci.h
+++ b/hw/usb/hcd-xhci-pci.h
@@ -28,9 +28,7 @@
 #include "hcd-xhci.h"
 
 #define TYPE_XHCI_PCI "pci-xhci"
-#define XHCI_PCI(obj) \
-    OBJECT_CHECK(XHCIPciState, (obj), TYPE_XHCI_PCI)
-
+OBJECT_DECLARE_SIMPLE_TYPE(XHCIPciState, XHCI_PCI)
 
 typedef struct XHCIPciState {
     /*< private >*/
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH-for-6.0 5/5] hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON
  2020-11-07 11:13 [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2020-11-07 11:13 ` [PATCH-for-6.0 4/5] hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro Philippe Mathieu-Daudé
@ 2020-11-07 11:13 ` Philippe Mathieu-Daudé
  4 siblings, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-07 11:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sai Pavan Boddu, Philippe Mathieu-Daudé, Gerd Hoffmann

Follow the code base style by using the _COMMON suffix to
abstract QOM types.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/usb/hcd-xhci-pci.h |  4 ++--
 hw/usb/hcd-xhci-nec.c |  2 +-
 hw/usb/hcd-xhci-pci.c | 16 ++++++++--------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h
index cf9a180caa4..c862e82d964 100644
--- a/hw/usb/hcd-xhci-pci.h
+++ b/hw/usb/hcd-xhci-pci.h
@@ -27,8 +27,8 @@
 #include "hw/usb.h"
 #include "hcd-xhci.h"
 
-#define TYPE_XHCI_PCI "pci-xhci"
-OBJECT_DECLARE_SIMPLE_TYPE(XHCIPciState, XHCI_PCI)
+#define TYPE_XHCI_PCI_COMMON "pci-xhci"
+OBJECT_DECLARE_SIMPLE_TYPE(XHCIPciState, XHCI_PCI_COMMON)
 
 typedef struct XHCIPciState {
     /*< private >*/
diff --git a/hw/usb/hcd-xhci-nec.c b/hw/usb/hcd-xhci-nec.c
index 5707b2cabd1..16b3b46fd59 100644
--- a/hw/usb/hcd-xhci-nec.c
+++ b/hw/usb/hcd-xhci-nec.c
@@ -52,7 +52,7 @@ static void nec_xhci_class_init(ObjectClass *klass, void *data)
 
 static const TypeInfo nec_xhci_info = {
     .name          = TYPE_NEC_XHCI,
-    .parent        = TYPE_XHCI_PCI,
+    .parent        = TYPE_XHCI_PCI_COMMON,
     .class_init    = nec_xhci_class_init,
 };
 
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index 2ca018a4290..9490988b1c9 100644
--- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c
@@ -80,14 +80,14 @@ static void xhci_pci_intr_raise(XHCIState *xhci, int n, bool level)
 
 static void xhci_pci_reset(DeviceState *dev)
 {
-    XHCIPciState *s = XHCI_PCI(dev);
+    XHCIPciState *s = XHCI_PCI_COMMON(dev);
 
     device_legacy_reset(DEVICE(&s->xhci));
 }
 
 static int xhci_pci_vmstate_post_load(void *opaque, int version_id)
 {
-    XHCIPciState *s = XHCI_PCI(opaque);
+    XHCIPciState *s = XHCI_PCI_COMMON(opaque);
     PCIDevice *pci_dev = PCI_DEVICE(s);
     int intr;
 
@@ -105,7 +105,7 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
 {
     int ret;
     Error *err = NULL;
-    XHCIPciState *s = XHCI_PCI(dev);
+    XHCIPciState *s = XHCI_PCI_COMMON(dev);
 
     dev->config[PCI_CLASS_PROG] = 0x30;    /* xHCI */
     dev->config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin 1 */
@@ -165,7 +165,7 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)
 
 static void usb_xhci_pci_exit(PCIDevice *dev)
 {
-    XHCIPciState *s = XHCI_PCI(dev);
+    XHCIPciState *s = XHCI_PCI_COMMON(dev);
     /* destroy msix memory region */
     if (dev->msix_table && dev->msix_pba
         && dev->msix_entry_used) {
@@ -187,7 +187,7 @@ static const VMStateDescription vmstate_xhci_pci = {
 
 static void xhci_instance_init(Object *obj)
 {
-    XHCIPciState *s = XHCI_PCI(obj);
+    XHCIPciState *s = XHCI_PCI_COMMON(obj);
     /*
      * QEMU_PCI_CAP_EXPRESS initialization does not depend on QEMU command
      * line, therefore, no need to wait to realize like other devices
@@ -211,7 +211,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo xhci_pci_info = {
-    .name          = TYPE_XHCI_PCI,
+    .name          = TYPE_XHCI_PCI_COMMON,
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(XHCIPciState),
     .class_init    = xhci_class_init,
@@ -235,7 +235,7 @@ static void qemu_xhci_class_init(ObjectClass *klass, void *data)
 
 static void qemu_xhci_instance_init(Object *obj)
 {
-    XHCIPciState *s = XHCI_PCI(obj);
+    XHCIPciState *s = XHCI_PCI_COMMON(obj);
     XHCIState *xhci = &s->xhci;
 
     s->msi      = ON_OFF_AUTO_OFF;
@@ -247,7 +247,7 @@ static void qemu_xhci_instance_init(Object *obj)
 
 static const TypeInfo qemu_xhci_info = {
     .name          = TYPE_QEMU_XHCI,
-    .parent        = TYPE_XHCI_PCI,
+    .parent        = TYPE_XHCI_PCI_COMMON,
     .class_init    = qemu_xhci_class_init,
     .instance_init = qemu_xhci_instance_init,
 };
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* RE: [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract
  2020-11-07 11:13 ` [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract Philippe Mathieu-Daudé
@ 2020-11-08 13:38   ` Sai Pavan Boddu
  2020-11-09  9:51   ` Gerd Hoffmann
  1 sibling, 0 replies; 13+ messages in thread
From: Sai Pavan Boddu @ 2020-11-08 13:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Miroslav Rezanina, Gerd Hoffmann

Looks good.

Reviewed-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>

Thanks,
Sai Pavan
> -----Original Message-----
> From: Philippe Mathieu-Daudé <philmd@redhat.com>
> Sent: Saturday, November 7, 2020 4:43 PM
> To: qemu-devel@nongnu.org
> Cc: Gerd Hoffmann <kraxel@redhat.com>; Sai Pavan Boddu
> <saipava@xilinx.com>; Philippe Mathieu-Daudé <philmd@redhat.com>;
> Miroslav Rezanina <mrezanin@redhat.com>
> Subject: [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract
> 
> The TYPE_XHCI model is abstract and can not be used as it.
> It is meant to be overloaded by children classes. Restore it as abstract type.
> 
> Fixes: 8ddab8dd3d8 ("usb/hcd-xhci: Split pci wrapper for xhci base model")
> Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/usb/hcd-xhci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index
> 79ce5c4be6c..57b692ad849 100644
> --- a/hw/usb/hcd-xhci.c
> +++ b/hw/usb/hcd-xhci.c
> @@ -3595,6 +3595,7 @@ static const TypeInfo xhci_info = {
>      .parent        = TYPE_DEVICE,
>      .instance_size = sizeof(XHCIState),
>      .class_init    = xhci_class_init,
> +    .abstract      = true,
>  };
> 
>  static void xhci_register_types(void)
> --
> 2.26.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI)
  2020-11-07 11:13 ` [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI) Philippe Mathieu-Daudé
@ 2020-11-08 13:40   ` Sai Pavan Boddu
  2020-11-09 11:08   ` Gerd Hoffmann
  1 sibling, 0 replies; 13+ messages in thread
From: Sai Pavan Boddu @ 2020-11-08 13:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Gerd Hoffmann

Thanks, good fix.

Reviewed-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>

Regards,
Sai Pavan
> -----Original Message-----
> From: Philippe Mathieu-Daudé <philmd@redhat.com>
> Sent: Saturday, November 7, 2020 4:43 PM
> To: qemu-devel@nongnu.org
> Cc: Gerd Hoffmann <kraxel@redhat.com>; Sai Pavan Boddu
> <saipava@xilinx.com>; Philippe Mathieu-Daudé <philmd@redhat.com>
> Subject: [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on
> USB_XHCI_PCI)
> 
> Since commit 755fba11fbc and 8ddab8dd3d8 we can not build USB_XHCI_NEC
> without USB_XHCI_PCI. Correct the Kconfig dependency.
> 
> Fixes: 755fba11fbc ("usb/hcd-xhci: Move qemu-xhci device to hcd-xhci-pci.c")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/usb/Kconfig | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig index
> a674ce4c542..6a213b04758 100644
> --- a/hw/usb/Kconfig
> +++ b/hw/usb/Kconfig
> @@ -42,9 +42,7 @@ config USB_XHCI_PCI
> 
>  config USB_XHCI_NEC
>      bool
> -    default y if PCI_DEVICES
> -    depends on PCI
> -    select USB_XHCI
> +    select USB_XHCI_PCI
> 
>  config USB_XHCI_SYSBUS
>      bool
> --
> 2.26.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract
  2020-11-07 11:13 ` [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract Philippe Mathieu-Daudé
  2020-11-08 13:38   ` Sai Pavan Boddu
@ 2020-11-09  9:51   ` Gerd Hoffmann
  2020-11-09 11:00     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 13+ messages in thread
From: Gerd Hoffmann @ 2020-11-09  9:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Sai Pavan Boddu, Miroslav Rezanina, qemu-devel

On Sat, Nov 07, 2020 at 12:13:03PM +0100, Philippe Mathieu-Daudé wrote:
> The TYPE_XHCI model is abstract and can not be used as it.
> It is meant to be overloaded by children classes. Restore
> it as abstract type.

Breaks "make check".

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} QTEST_QEMU_IMG=./qemu-img G_TEST_DBUS_DAEMON=/home/kraxel/projects/qemu/tests/dbus-vmstate-daemon.sh QTEST_QEMU_BINARY=./qemu-system-x86_64 tests/qtest/usb-hcd-xhci-test --tap -k
**
ERROR:../../qom/object.c:506:object_initialize_with_type: assertion failed: (type->abstract == false)

take care,
  Gerd



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract
  2020-11-09  9:51   ` Gerd Hoffmann
@ 2020-11-09 11:00     ` Philippe Mathieu-Daudé
  2020-11-09 11:30       ` Gerd Hoffmann
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-09 11:00 UTC (permalink / raw)
  To: Gerd Hoffmann, Thomas Huth; +Cc: Sai Pavan Boddu, Miroslav Rezanina, qemu-devel

Cc'ing Thomas who wrote the test.

On 11/9/20 10:51 AM, Gerd Hoffmann wrote:
> On Sat, Nov 07, 2020 at 12:13:03PM +0100, Philippe Mathieu-Daudé wrote:
>> The TYPE_XHCI model is abstract and can not be used as it.
>> It is meant to be overloaded by children classes. Restore
>> it as abstract type.
> 
> Breaks "make check".
> 
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} QTEST_QEMU_IMG=./qemu-img G_TEST_DBUS_DAEMON=/home/kraxel/projects/qemu/tests/dbus-vmstate-daemon.sh QTEST_QEMU_BINARY=./qemu-system-x86_64 tests/qtest/usb-hcd-xhci-test --tap -k
> **
> ERROR:../../qom/object.c:506:object_initialize_with_type: assertion failed: (type->abstract == false)

Well I suppose the test was always incorrect but working,
and 8ddab8dd3d8 revealed the problem. Testing the correct
device should fix the test:

-- >8 --
diff --git a/tests/qtest/usb-hcd-xhci-test.c
b/tests/qtest/usb-hcd-xhci-test.c
index 10ef9d2a91a..09f5ad71158 100644
--- a/tests/qtest/usb-hcd-xhci-test.c
+++ b/tests/qtest/usb-hcd-xhci-test.c
@@ -18,7 +18,7 @@ static void test_xhci_init(void)

 static void test_xhci_hotplug(void)
 {
-    usb_test_hotplug(global_qtest, "xhci", "1", NULL);
+    usb_test_hotplug(global_qtest, "nec-usb-xhci", "1", NULL);
 }

 static void test_usb_uas_hotplug(void)
---

I'll respin including the fix.

> 
> take care,
>   Gerd
> 



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI)
  2020-11-07 11:13 ` [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI) Philippe Mathieu-Daudé
  2020-11-08 13:40   ` Sai Pavan Boddu
@ 2020-11-09 11:08   ` Gerd Hoffmann
  1 sibling, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2020-11-09 11:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Sai Pavan Boddu, qemu-devel

On Sat, Nov 07, 2020 at 12:13:04PM +0100, Philippe Mathieu-Daudé wrote:
> Since commit 755fba11fbc and 8ddab8dd3d8 we can not build
> USB_XHCI_NEC without USB_XHCI_PCI. Correct the Kconfig
> dependency.

Fails make check too:

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} QTEST_QEMU_IMG=./qemu-img G_TEST_DBUS_DAEMON=/home/kraxel/projects/qemu/tests/dbus-vmstate-daemon.sh QTEST_QEMU_BINARY=./qemu-system-ppc64 tests/qtest/device-plug-test --tap -k
**
ERROR:../../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)

take care,
  Gerd



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract
  2020-11-09 11:00     ` Philippe Mathieu-Daudé
@ 2020-11-09 11:30       ` Gerd Hoffmann
  2020-11-09 13:40         ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 13+ messages in thread
From: Gerd Hoffmann @ 2020-11-09 11:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Sai Pavan Boddu, Thomas Huth, Miroslav Rezanina, qemu-devel

>  static void test_xhci_hotplug(void)
>  {
> -    usb_test_hotplug(global_qtest, "xhci", "1", NULL);
> +    usb_test_hotplug(global_qtest, "nec-usb-xhci", "1", NULL);
>  }

Better use qemu-xhci.
I'm wondering how that worked before ...

take care,
  Gerd



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract
  2020-11-09 11:30       ` Gerd Hoffmann
@ 2020-11-09 13:40         ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-09 13:40 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Sai Pavan Boddu, Thomas Huth, Miroslav Rezanina, qemu-devel

On 11/9/20 12:30 PM, Gerd Hoffmann wrote:
>>  static void test_xhci_hotplug(void)
>>  {
>> -    usb_test_hotplug(global_qtest, "xhci", "1", NULL);
>> +    usb_test_hotplug(global_qtest, "nec-usb-xhci", "1", NULL);
>>  }
> 
> Better use qemu-xhci.
> I'm wondering how that worked before ...

Per commit b3937683147 ("tests: usb: Generic usb device hotplug")
this is the name of the bus, so "xhci" is correct, my patch isn't.

> 
> take care,
>   Gerd
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-11-09 13:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-07 11:13 [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices Philippe Mathieu-Daudé
2020-11-07 11:13 ` [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract Philippe Mathieu-Daudé
2020-11-08 13:38   ` Sai Pavan Boddu
2020-11-09  9:51   ` Gerd Hoffmann
2020-11-09 11:00     ` Philippe Mathieu-Daudé
2020-11-09 11:30       ` Gerd Hoffmann
2020-11-09 13:40         ` Philippe Mathieu-Daudé
2020-11-07 11:13 ` [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI) Philippe Mathieu-Daudé
2020-11-08 13:40   ` Sai Pavan Boddu
2020-11-09 11:08   ` Gerd Hoffmann
2020-11-07 11:13 ` [PATCH-for-6.0 3/5] hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COMMON Philippe Mathieu-Daudé
2020-11-07 11:13 ` [PATCH-for-6.0 4/5] hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro Philippe Mathieu-Daudé
2020-11-07 11:13 ` [PATCH-for-6.0 5/5] hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON Philippe Mathieu-Daudé

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.