diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-04-21 17:42:36 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-04-21 17:42:36 +0100 |
commit | eda1c58358d64e339cdfd4b983a9de9ec01e83db (patch) | |
tree | 548899a1b86b832341e0cb12d2166ef5dfce2966 /src | |
parent | 8958f62a1c85ff6b449a685a729b61b9ea69f50a (diff) | |
download | ipxe-eda1c58358d64e339cdfd4b983a9de9ec01e83db.zip ipxe-eda1c58358d64e339cdfd4b983a9de9ec01e83db.tar.gz ipxe-eda1c58358d64e339cdfd4b983a9de9ec01e83db.tar.bz2 |
[realtek] Do not attempt to access EEPROM on RTL8169 chips
On some RTL8169 onboard NICs (observed with a Lenovo ThinkPad 11e),
the EEPROM is not merely not present: any attempt to read from the
non-existent EEPROM will crash and reboot the system.
The equivalent code to read from the EEPROM was removed from the Linux
r8169 driver in 2009 with a comment suggesting that it was similarly
found to be unreliable on some systems.
Fix by accessing the EEPROM only on RTL8139 NICs, and assuming that
the MAC address will always be correctly preset on RTL8169 NICs.
Reported-by: Evan Prohaska <eprohaska@edkey.org>
Tested-by: Evan Prohaska <eprohaska@edkey.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/net/realtek.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/drivers/net/realtek.c b/src/drivers/net/realtek.c index dafac5c..022b593 100644 --- a/src/drivers/net/realtek.c +++ b/src/drivers/net/realtek.c @@ -198,7 +198,6 @@ static int realtek_init_eeprom ( struct net_device *netdev ) { DBGC ( rtl, "REALTEK %p EEPROM is a 93C46\n", rtl ); init_at93c46 ( &rtl->eeprom, 16 ); } - rtl->eeprom.bus = &rtl->spibit.bus; /* Check for EEPROM presence. Some onboard NICs will have no * EEPROM connected, with the BIOS being responsible for @@ -1089,6 +1088,7 @@ static void realtek_detect ( struct realtek_nic *rtl ) { rtl ); rtl->legacy = 1; } + rtl->eeprom.bus = &rtl->spibit.bus; } } @@ -1136,7 +1136,8 @@ static int realtek_probe ( struct pci_device *pci ) { realtek_detect ( rtl ); /* Initialise EEPROM */ - if ( ( rc = realtek_init_eeprom ( netdev ) ) == 0 ) { + if ( rtl->eeprom.bus && + ( ( rc = realtek_init_eeprom ( netdev ) ) == 0 ) ) { /* Read MAC address from EEPROM */ if ( ( rc = nvs_read ( &rtl->eeprom.nvs, RTL_EEPROM_MAC, |