Module Name:    src
Committed By:   jmcneill
Date:           Thu Jul 25 00:42:43 UTC 2019

Modified Files:
        src/sys/arch/arm/pci: pci_msi_machdep.c

Log Message:
Support pci_intr_release for INTx interrupts


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/pci/pci_msi_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/pci/pci_msi_machdep.c
diff -u src/sys/arch/arm/pci/pci_msi_machdep.c:1.5 src/sys/arch/arm/pci/pci_msi_machdep.c:1.6
--- src/sys/arch/arm/pci/pci_msi_machdep.c:1.5	Sat Dec  1 20:38:45 2018
+++ src/sys/arch/arm/pci/pci_msi_machdep.c	Thu Jul 25 00:42:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_msi_machdep.c,v 1.5 2018/12/01 20:38:45 skrll Exp $ */
+/* $NetBSD: pci_msi_machdep.c,v 1.6 2019/07/25 00:42:43 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.5 2018/12/01 20:38:45 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.6 2019/07/25 00:42:43 jmcneill Exp $");
 
 #include <sys/kernel.h>
 #include <sys/kmem.h>
@@ -237,14 +237,16 @@ pci_intr_alloc(const struct pci_attach_a
 void 
 pci_intr_release(pci_chipset_tag_t pc, pci_intr_handle_t *pih, int count)
 {
-	struct arm_pci_msi *msi;
+	struct arm_pci_msi *msi = NULL;
 
 	if (pih == NULL || count == 0)
 		return;
 
-	msi = arm_pci_msi_find_frame(pih[0]);
-	KASSERT(msi != NULL);
-	msi->msi_intr_release(msi, pih, count);
+	if ((pih[0] & (ARM_PCI_INTR_MSIX|ARM_PCI_INTR_MSI)) != 0) {
+		msi = arm_pci_msi_find_frame(pih[0]);
+		KASSERT(msi != NULL);
+		msi->msi_intr_release(msi, pih, count);
+	}
 
 	kmem_free(pih, sizeof(*pih) * count);
 }

Reply via email to