[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/6] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsuppor
From: |
Phil Dennis-Jordan |
Subject: |
[PATCH v2 3/6] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported |
Date: |
Fri, 13 Dec 2024 17:06:16 +0100 |
The XHCI specification, section 4.17.1 specifies that "If Interrupter
Mapping is not supported, the Interrupter Target field shall be
ignored by the xHC and all Events targeted at Interrupter 0."
QEMU's XHCI device has so far not specially addressed this case,
so we add a check to xhci_event() to redirect to event ring and
interrupt 0 if mapping is disabled.
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
---
hw/usb/hcd-xhci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index d85adaca0dc..5fb140c2382 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -644,6 +644,10 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event,
int v)
dma_addr_t erdp;
unsigned int dp_idx;
+ if (xhci->numintrs == 1) {
+ v = 0;
+ }
+
if (v >= xhci->numintrs) {
DPRINTF("intr nr out of range (%d >= %d)\n", v, xhci->numintrs);
return;
--
2.39.5 (Apple Git-154)
- [PATCH v2 0/6] hw/usb/hcd-xhci: Fixes, improvements, and macOS workaround, Phil Dennis-Jordan, 2024/12/13
- [PATCH v2 2/6] hw/usb/hcd-xhci-pci: Move msi/msix properties from NEC to superclass, Phil Dennis-Jordan, 2024/12/13
- [PATCH v2 3/6] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported,
Phil Dennis-Jordan <=
- [PATCH v2 6/6] hw/vmapple: XHCI controller's interrupt mapping workaround for macOS, Phil Dennis-Jordan, 2024/12/13
- [PATCH v2 1/6] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec, Phil Dennis-Jordan, 2024/12/13
- [PATCH v2 5/6] hw/usb/hcd-xhci-pci: Indentation fix, Phil Dennis-Jordan, 2024/12/13
- [PATCH v2 4/6] hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode, Phil Dennis-Jordan, 2024/12/13