diff options
author | Tobias Weingartner <weingart@cvs.openbsd.org> | 2007-01-26 15:55:31 +0000 |
---|---|---|
committer | Tobias Weingartner <weingart@cvs.openbsd.org> | 2007-01-26 15:55:31 +0000 |
commit | 6c075fc6aa36b5e276387bd092751c5dba415add (patch) | |
tree | cc8fe5540a53198a0b27304cfa268f59e02e9c83 /sys/dev/pci/if_em.c | |
parent | 6a782cae436e033ea60abbcb8cb986260ed1c33b (diff) |
Workaround for an issue with em(4) interfaces on Lenovo X60/T60 laptops where
the interface will fail to initialize with an EEPROM error if the interface
does not have a link upon boot.
Tested by mk@ and janek@
From Jack Vogel@Intel via brad
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r-- | sys/dev/pci/if_em.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index a504381fcfd..cdeaa9acedb 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.165 2007/01/21 18:38:02 kettenis Exp $ */ +/* $OpenBSD: if_em.c,v 1.166 2007/01/26 15:55:30 weingart Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -1553,9 +1553,16 @@ em_hardware_init(struct em_softc *sc) /* Make sure we have a good EEPROM before we read from it */ if (em_validate_eeprom_checksum(&sc->hw) < 0) { - printf("%s: The EEPROM Checksum Is Not Valid\n", - sc->sc_dv.dv_xname); - return (EIO); + /* + * Some PCIe parts fail the first check due to + * the link being in sleep state, call it again, + * if it fails a second time its a real issue. + */ + if (em_validate_eeprom_checksum(&sc->hw) < 0) { + printf("%s: The EEPROM Checksum Is Not Valid\n", + sc->sc_dv.dv_xname); + return (EIO); + } } if (em_read_part_num(&sc->hw, &(sc->part_num)) < 0) { |