From f56d52eb5419325cecac674156b200ed61f82ed6 Mon Sep 17 00:00:00 2001 From: York Sun Date: Fri, 17 Oct 2014 13:44:06 -0700 Subject: 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!". Signed-off-by: York Sun CC: Marek Vasut CC: Tim Harvey --- drivers/net/e1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 3c9115cfd6..a13c03b8c9 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -1116,7 +1116,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) */ -- cgit v1.2.3