--- sys/dev/bge/if_bge.c.orig Mon Oct 3 13:27:44 2005 +++ sys/dev/bge/if_bge.c Tue Oct 11 12:56:21 2005 @@ -2583,7 +2583,7 @@ struct bge_softc *sc; { device_t dev; - u_int32_t cachesize, command, pcistate, reset; + u_int32_t cachesize, command, pcistate, new_pcistate, reset; int i, val = 0; dev = sc->bge_dev; @@ -2673,10 +2673,16 @@ * results. */ for (i = 0; i < BGE_TIMEOUT; i++) { - if (pci_read_config(dev, BGE_PCI_PCISTATE, 4) == pcistate) + new_pcistate = pci_read_config(dev, BGE_PCI_PCISTATE, 4); + if ((new_pcistate & ~BGE_PCISTATE_RESERVED) == + (pcistate & ~BGE_PCISTATE_RESERVED)) break; DELAY(10); } + + if ((new_pcistate & ~BGE_PCISTATE_RESERVED) != + (pcistate & ~BGE_PCISTATE_RESERVED)) + printf("bge%d: pcistate failed to revert\n", sc->bge_unit); /* Fix up byte swapping */ CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_MODECTL_BYTESWAP_NONFRAME| --- sys/dev/bge/if_bgereg.h.orig Mon Jun 13 09:24:40 2005 +++ sys/dev/bge/if_bgereg.h Tue Oct 11 12:55:35 2005 @@ -306,6 +306,7 @@ #define BGE_PCISTATE_EXPROM_RETRY 0x00000040 #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 +#define BGE_PCISTATE_RESERVED ((1 << 12) + (1 <<7)) /* * PCI Clock Control register -- note, this register is read only