Skip to contentSkip to conversation

net/e1000: Fix EEPROM access error

RFC In review York Sun 4 participants 4 messages Oct 17, 2014 – Oct 27, 2014 Network drivers

lore
Share & tools
lore

York Sun

author
#0 lore raw

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!".

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 +1 -1
index 6e8765c..b092867 100644
@@ -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
#1 lore raw
Quoted 21 lines · York Sun

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!".

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
index 6e8765c..b092867 100644

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

#2 lore raw
Quoted 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.

#3 lore raw
In reply to York Sun
Quoted 9 lines · York Sun

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!".

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>