Module Name:    src
Committed By:   knakahara
Date:           Fri Apr 14 09:34:46 UTC 2017

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

Log Message:
disable msi/msix when the system doesn't detect ioapic. This would fix PR 
kern/52111.

Some system does not detect ioapic when "boot -1", disable acpi, and so on.
In such cases, msi/msix doesn't work, so disable them.

This patch is implemented by nonaka@n.o, I just commit by proxy, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/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/x86/pci/pci_msi_machdep.c
diff -u src/sys/arch/x86/pci/pci_msi_machdep.c:1.10 src/sys/arch/x86/pci/pci_msi_machdep.c:1.11
--- src/sys/arch/x86/pci/pci_msi_machdep.c:1.10	Mon Nov 28 05:00:41 2016
+++ src/sys/arch/x86/pci/pci_msi_machdep.c	Fri Apr 14 09:34:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_msi_machdep.c,v 1.10 2016/11/28 05:00:41 knakahara Exp $	*/
+/*	$NetBSD: pci_msi_machdep.c,v 1.11 2017/04/14 09:34:46 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -34,9 +34,10 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.10 2016/11/28 05:00:41 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.11 2017/04/14 09:34:46 knakahara Exp $");
 
 #include "opt_intrdebug.h"
+#include "ioapic.h"
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -162,6 +163,13 @@ pci_msi_alloc_common(pci_intr_handle_t *
 	pci_intr_handle_t *vectors;
 	int error, i;
 
+#if NIOAPIC > 0
+	if (nioapics == 0) {
+		DPRINTF(("no IOAPIC.\n"));
+		return ENODEV;
+	}
+#endif
+
 	if ((pa->pa_flags & PCI_FLAGS_MSI_OKAY) == 0) {
 		DPRINTF(("PCI host bridge does not support MSI.\n"));
 		return ENODEV;
@@ -244,6 +252,13 @@ pci_msix_alloc_common(pci_intr_handle_t 
 	pci_intr_handle_t *vectors;
 	int error, i;
 
+#if NIOAPIC > 0
+	if (nioapics == 0) {
+		DPRINTF(("no IOAPIC.\n"));
+		return ENODEV;
+	}
+#endif
+
 	if ((pa->pa_flags & PCI_FLAGS_MSIX_OKAY) == 0) {
 		DPRINTF(("PCI host bridge does not support MSI-X.\n"));
 		return ENODEV;

Reply via email to