Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/pci disable msi/msix when the system doesn't de...



details:   https://anonhg.NetBSD.org/src/rev/6cd89ff8d84f
branches:  trunk
changeset: 823163:6cd89ff8d84f
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Apr 14 09:34:46 2017 +0000

description:
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.

diffstat:

 sys/arch/x86/pci/pci_msi_machdep.c |  19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r ab15f6502a9c -r 6cd89ff8d84f sys/arch/x86/pci/pci_msi_machdep.c
--- a/sys/arch/x86/pci/pci_msi_machdep.c        Fri Apr 14 08:48:01 2017 +0000
+++ b/sys/arch/x86/pci/pci_msi_machdep.c        Fri Apr 14 09:34:46 2017 +0000
@@ -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_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_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;



Home | Main Index | Thread Index | Old Index