Skip to contentSkip to conversation

libqos: usb-hcd-ehci: use 32-bit write for config register

PATCH In review Paolo Bonzini 3 participants 5 messages Jun 23, 2020 – Jun 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libqos: usb-hcd-ehci: use 32-bit write for config register

The memory region ops have min_access_size == 4 so obey it.

---
 tests/qtest/usb-hcd-ehci-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/usb-hcd-ehci-test.c +1 -1
index 5251d539e9..c51e8bb223 100644
@@ -96,7 +96,7 @@ static void pci_ehci_port_1(void)
 static void pci_ehci_config(void)
 {
     /* hands over all ports from companion uhci to ehci */
-    qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1);
+    qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1);
 }
 
 static void pci_uhci_port_2(void)
Signature · 1 line
2.26.2
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Paolo Bonzini

The memory region ops have min_access_size == 4 so obey it.

Makes sense.

I assume you are queueing this with the memory core change.

Quoted 19 lines
---
 tests/qtest/usb-hcd-ehci-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/usb-hcd-ehci-test.c +1 -1
index 5251d539e9..c51e8bb223 100644
@@ -96,7 +96,7 @@ static void pci_ehci_port_1(void)
 static void pci_ehci_config(void)
 {
     /* hands over all ports from companion uhci to ehci */
-    qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1);
+    qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1);
 }
 
 static void pci_uhci_port_2(void)
Signature · 1 line
2.26.2
#2 lore raw
Quoted 10 lines · Michael S. Tsirkin
Quoted 3 lines · Paolo Bonzini

The memory region ops have min_access_size == 4 so obey it.

Makes sense.

I assume you are queueing this with the memory core change.

Yes, I am.

Paolo

Quoted 20 lines
Quoted 19 lines
---
 tests/qtest/usb-hcd-ehci-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/usb-hcd-ehci-test.c +1 -1
index 5251d539e9..c51e8bb223 100644
@@ -96,7 +96,7 @@ static void pci_ehci_port_1(void)
 static void pci_ehci_config(void)
 {
     /* hands over all ports from companion uhci to ehci */
-    qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1);
+    qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1);
 }
 
 static void pci_uhci_port_2(void)
Signature · 1 line
2.26.2
Tested-by on v1 1/1
#3 lore raw
In reply to Paolo Bonzini
Quoted 12 lines · Paolo Bonzini

The memory region ops have min_access_size == 4 so obey it.

---
  tests/qtest/usb-hcd-ehci-test.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/usb-hcd-ehci-test.c +0 -0
index 5251d539e9..c51e8bb223 100644

tests/qtest/usb-hcd-ehci-test.c static void pci_ehci_port_1(void) · line 102

Quoted 8 lines
tests/qtest/usb-hcd-ehci-test.c +1 -1
@@ -96,7 +96,7 @@ static void pci_ehci_port_1(void)
  static void pci_ehci_config(void)
  {
      /* hands over all ports from companion uhci to ehci */
-    qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1);
+    qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1);
  }
 
  static void pci_uhci_port_2(void)

Passes "make check-qtest-x86_64" on a s390x host, too:

#4 lore raw
Quoted 11 lines · Thomas Huth
Quoted 7 lines

  {
      /* hands over all ports from companion uhci to ehci */ -    qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1); +    qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1); }
    static void pci_uhci_port_2(void)

Passes "make check-qtest-x86_64" on a s390x host, too:

Ah, I see what you mean now, so I'll clarify. Endianness is handled by the memory core and libqos so for little-endian devices (such as PCI devices) it's okay. For big-endian using the wrong size would not work, but it should fail the same on LE and BE hosts. endianness-test checks that.

Paolo