Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/e6f209aced7e
branches:  netbsd-8
changeset: 850729:e6f209aced7e
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Jun 15 05:30:13 2017 +0000

description:
Pull up following revision(s) (requested by sborrill in ticket #33):
        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 e9fd4c4dd12a -r e6f209aced7e sys/dev/pci/ehci_pci.c
--- a/sys/dev/pci/ehci_pci.c    Wed Jun 14 04:58:28 2017 +0000
+++ b/sys/dev/pci/ehci_pci.c    Thu Jun 15 05:30:13 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci_pci.c,v 1.64 2016/10/13 20:05:06 jdolecek Exp $   */
+/*     $NetBSD: ehci_pci.c,v 1.64.8.1 2017/06/15 05:30:13 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.64 2016/10/13 20:05:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.64.8.1 2017/06/15 05:30:13 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -161,10 +161,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