Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci In query_bus(), use the parent pciconf_bus_t's P...



details:   https://anonhg.NetBSD.org/src/rev/dae2ec832caa
branches:  trunk
changeset: 517268:dae2ec832caa
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Nov 09 19:20:19 2001 +0000

description:
In query_bus(), use the parent pciconf_bus_t's PCI chipset tag,
not the new bus's (which is potentially uninitialized when some
calls are made).

diffstat:

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

diffs (36 lines):

diff -r 08becec87280 -r dae2ec832caa sys/dev/pci/pciconf.c
--- a/sys/dev/pci/pciconf.c     Fri Nov 09 19:04:23 2001 +0000
+++ b/sys/dev/pci/pciconf.c     Fri Nov 09 19:20:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciconf.c,v 1.10 2001/09/03 03:46:26 thorpej Exp $     */
+/*     $NetBSD: pciconf.c,v 1.11 2001/11/09 19:20:19 thorpej Exp $     */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -322,7 +322,7 @@
        busreg  =  parent->busno << PCI_BRIDGE_BUS_PRIMARY_SHIFT;
        busreg |=      pb->busno << PCI_BRIDGE_BUS_SECONDARY_SHIFT;
        busreg |= pb->last_busno << PCI_BRIDGE_BUS_SUBORDINATE_SHIFT;
-       pci_conf_write(pb->pc, pd->tag, PCI_BRIDGE_BUS_REG, busreg);
+       pci_conf_write(parent->pc, pd->tag, PCI_BRIDGE_BUS_REG, busreg);
 
        pb->swiz = parent->swiz + dev;
 
@@ -334,7 +334,7 @@
 
        pb->io_32bit = 0;
        if (parent->io_32bit) {
-               io = pci_conf_read(pb->pc, pd->tag, PCI_BRIDGE_STATIO_REG);
+               io = pci_conf_read(parent->pc, pd->tag, PCI_BRIDGE_STATIO_REG);
                if (PCI_BRIDGE_IO_32BITS(io)) {
                        pb->io_32bit = 1;
                }
@@ -342,7 +342,7 @@
 
        pb->pmem_64bit = 0;
        if (parent->pmem_64bit) {
-               pmem = pci_conf_read(pb->pc, pd->tag,
+               pmem = pci_conf_read(parent->pc, pd->tag,
                    PCI_BRIDGE_PREFETCHMEM_REG);
                if (PCI_BRIDGE_PREFETCHMEM_64BITS(pmem)) {
                        pb->pmem_64bit = 1;



Home | Main Index | Thread Index | Old Index