net/e1000: Fix EEPROM access error
RFC 1/1 net/e1000: Fix EEPROM access error
Commit 951860634fdb557bbb58e0f99215391bc0c29779 may have changed the logic unintentially from "if (!(swfw_sync & (fwmask | swmask)))" to "if ((swfw_sync & swmask) && !(swfw_sync & fwmask))". This change breaks some e1000 NIC with a message "ERROR: Unable to read EEPROM!".
---
Marek, please take a look at this change. I have no knowledge about e1000 driver. So I don't know if the original change was intended. Reverting this change fixes the problem I have on my board.
drivers/net/e1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/e1000.c +1 -1
@@ -1113,7 +1113,7 @@ e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask)return -E1000_ERR_SWFW_SYNC ; swfw_sync =E1000_READ_REG (hw,SW_FW_SYNC ); -if ((swfw_sync & swmask) && !(swfw_sync & fwmask)) +if (!(swfw_sync & (fwmask | swmask)))break ;/* firmware currently using resource (fwmask) */
Signature · 1 line
1.7.9.5
Quoted 21 lines · York Sun
Commit
951860634fdb557bbb58e0f99215391bc0c29779may have changed the logic unintentially from "if (!(swfw_sync & (fwmask | swmask)))" to "if ((swfw_sync& swmask) && !(swfw_sync & fwmask))". This change breaks some e1000 NIC with a message "ERROR: Unable to read EEPROM!".Signed-off-by York Sun <[email protected]>CC Marek Vasut <[email protected]>CC Tim Harvey <[email protected]>---
Marek, please take a look at this change. I have no knowledge about e1000 driver. So I don't know if the original change was intended. Reverting this change fixes the problem I have on my board.drivers/net/e1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/e1000.c +0
-0
drivers/net/e1000.c e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t · line 1119
Quoted 8 lines
drivers/net/e1000.c +1
-1@@ -1113,7 +1113,7 @@ e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask) return -E1000_ERR_SWFW_SYNC; swfw_sync =E1000_READ_REG (hw,SW_FW_SYNC ); -if ((swfw_sync & swmask) && !(swfw_sync & fwmask)) +if (!(swfw_sync & (fwmask | swmask)))break ;/* firmware currently using resource (fwmask) */
+CC Marcel. Marcel, can you please take a look at this and test this with i210 card ?
Thanks!
Best regards,
Marek Vasut
Marcel Ziswiler
Acked-byQuoted 2 lines · Marek Vasut
+CC Marcel. Marcel, can you please take a look at this and test this with i210 card ?
Good catch. Yes, I can confirm that this properly fixes at least one of the remaining issues as previously seen on the i210/i211.
Quoted 9 lines · York Sun
Commit
951860634fdb557bbb58e0f99215391bc0c29779may have changed the logic unintentially from "if (!(swfw_sync & (fwmask | swmask)))" to "if ((swfw_sync& swmask) && !(swfw_sync & fwmask))". This change breaks some e1000 NIC with a message "ERROR: Unable to read EEPROM!".Signed-off-by York Sun <[email protected]>CC Marek Vasut <[email protected]>CC Tim Harvey <[email protected]>Acked-by Marcel Ziswiler <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141027/08796c7b/attachment.pgp>