Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci explicitly disable INTx interrupts to avoid inte...



details:   https://anonhg.NetBSD.org/src/rev/08088eba4a9d
branches:  trunk
changeset: 934735:08088eba4a9d
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Jun 17 14:04:03 2020 +0000

description:
explicitly disable INTx interrupts to avoid interrupt storm triggered by
unhandled adapter interrupts

fixes PR kern/46596 by Andreas Gustafsson, fix adopted from FreeBSD

diffstat:

 sys/dev/pci/vga_pci.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 307c96cb9f3b -r 08088eba4a9d sys/dev/pci/vga_pci.c
--- a/sys/dev/pci/vga_pci.c     Wed Jun 17 13:09:16 2020 +0000
+++ b/sys/dev/pci/vga_pci.c     Wed Jun 17 14:04:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vga_pci.c,v 1.55 2016/07/07 06:55:41 msaitoh Exp $     */
+/*     $NetBSD: vga_pci.c,v 1.56 2020/06/17 14:04:03 jdolecek Exp $    */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.55 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.56 2020/06/17 14:04:03 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -230,6 +230,16 @@
                            "WARNING: strange BAR @ 0x%02x\n", reg);
        }
 
+       /*
+        * Disable INTx interrupts, there is no specific chipset driver for
+        * this PCI device. Else unhandled display adapter interrupts
+        * might freeze the CPU.
+        */
+       pcireg_t cmd  = pci_conf_read(pa->pa_pc, pa->pa_tag,
+           PCI_COMMAND_STATUS_REG);
+       pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
+           cmd | PCI_COMMAND_INTERRUPT_DISABLE);
+
        /* XXX Expansion ROM? */
 
        vga_common_attach(sc, pa->pa_iot, pa->pa_memt, WSDISPLAY_TYPE_PCIVGA,



Home | Main Index | Thread Index | Old Index