From dba9fe1b03efd59e4264e9a5fa9c5a4e5d80332c Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 18 Apr 2023 21:22:00 +0000 Subject: [PATCH] Map MSI-X in addition to MSI and INTx on xhci(4). On Qemu apparently the xHCI controller does not support MSIs, but does support MSI-X. With this diff running on Qemu/arm64 we switch over from shared INTx to device- specific MSI-X interrupts. Tested by and ok phessler@ ok dlg@ --- sys/dev/pci/xhci_pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/xhci_pci.c b/sys/dev/pci/xhci_pci.c index 88bdf66dbd7..ca1a0b3431b 100644 --- a/sys/dev/pci/xhci_pci.c +++ b/sys/dev/pci/xhci_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci_pci.c,v 1.11 2022/03/11 18:00:52 mpi Exp $ */ +/* $OpenBSD: xhci_pci.c,v 1.12 2023/04/18 21:22:00 patrick Exp $ */ /* * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -158,7 +158,8 @@ xhci_pci_attach(struct device *parent, struct device *self, void *aux) } /* Map and establish the interrupt. */ - if (pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) { + if (pci_intr_map_msix(pa, 0, &ih) != 0 && + pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) { printf(": couldn't map interrupt\n"); goto unmap_ret; } -- 2.20.1