When memory mapped I/O isn't enabled, we disable the associated
windows.  Do the same for "port" I/O.  Otherwise we will (incorrectly)
advertise that I/O space is available to devices downstream from the
bridge.

ok?


Index: dev/pci/ppb.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/ppb.c,v
retrieving revision 1.65
diff -u -p -r1.65 ppb.c
--- dev/pci/ppb.c       1 Dec 2015 21:02:04 -0000       1.65
+++ dev/pci/ppb.c       6 Apr 2018 09:07:24 -0000
@@ -620,14 +620,18 @@ ppb_alloc_resources(struct ppb_softc *sc
        csr = pci_conf_read(pc, sc->sc_tag, PCI_COMMAND_STATUS_REG);
 
        /*
-        * Get the bridge in a consistent state.  If memory mapped I/O
-        * is disabled, disabled the associated windows as well.  
+        * Get the bridge in a consistent state.  If memory mapped I/O or
+        * port I/O is disabled, disabled the associated windows as well.
         */
        if ((csr & PCI_COMMAND_MEM_ENABLE) == 0) {
                pci_conf_write(pc, sc->sc_tag, PPB_REG_MEM, 0x0000ffff);
                pci_conf_write(pc, sc->sc_tag, PPB_REG_PREFMEM, 0x0000ffff);
                pci_conf_write(pc, sc->sc_tag, PPB_REG_PREFBASE_HI32, 0);
                pci_conf_write(pc, sc->sc_tag, PPB_REG_PREFLIM_HI32, 0);
+       }
+       if ((csr & PCI_COMMAND_IO_ENABLE) == 0) {
+               pci_conf_write(pc, sc->sc_tag, PPB_REG_IOSTATUS, 0x000000ff);
+               pci_conf_write(pc, sc->sc_tag, PPB_REG_IO_HI, 0x0000ffff);
        }
 
        /* Allocate I/O address space if necessary. */

Reply via email to