Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/pci Pull up following revision(s) (requested by s...



details:   https://anonhg.NetBSD.org/src/rev/22dea4beba0a
branches:  netbsd-7
changeset: 800241:22dea4beba0a
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Jul 08 16:34:35 2017 +0000

description:
Pull up following revision(s) (requested by sborrill in ticket #1431):
        sys/dev/pci/ehci_pci.c: revision 1.65
Deal with broken BIOSes that leave PCI interrupts disabled.
Thanks to nick@

diffstat:

 sys/dev/pci/ehci_pci.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r acebe1b71f2c -r 22dea4beba0a sys/dev/pci/ehci_pci.c
--- a/sys/dev/pci/ehci_pci.c    Sat Jul 08 16:32:48 2017 +0000
+++ b/sys/dev/pci/ehci_pci.c    Sat Jul 08 16:34:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci_pci.c,v 1.58.4.1 2017/04/05 19:54:19 snj Exp $    */
+/*     $NetBSD: ehci_pci.c,v 1.58.4.2 2017/07/08 16:34:35 snj Exp $    */
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.58.4.1 2017/04/05 19:54:19 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.58.4.2 2017/07/08 16:34:35 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -163,10 +163,14 @@
                break;
        }
 
+       pcireg_t intr = pci_conf_read(pc, tag, PCI_INTERRUPT_REG);
+       int pin = PCI_INTERRUPT_PIN(intr);
+
        /* Enable the device. */
        csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
-       pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
-                      csr | PCI_COMMAND_MASTER_ENABLE);
+       csr |= PCI_COMMAND_MASTER_ENABLE;
+       csr &= ~(pin ? PCI_COMMAND_INTERRUPT_DISABLE : 0);
+       pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
 
        /* Map and establish the interrupt. */
        if (pci_intr_map(pa, &ih)) {



Home | Main Index | Thread Index | Old Index