]> git.sur5r.net Git - u-boot/commitdiff
net/e1000: Fix EEPROM access error
authorYork Sun <yorksun@freescale.com>
Fri, 17 Oct 2014 20:44:06 +0000 (13:44 -0700)
committerTom Rini <trini@ti.com>
Mon, 27 Oct 2014 21:54:09 +0000 (17:54 -0400)
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 <yorksun@freescale.com>
CC: Marek Vasut <marex@denx.de>
CC: Tim Harvey <tharvey@gateworks.com>
Acked-by: Marcel Ziswiler <marcel@ziswiler.com>
drivers/net/e1000.c

index 6e8765cf7b61bebc6060e26ef31143d8b784f25b..b092867272f5bbc7c9a84eeda6777f22ee5e2abc 100644 (file)
@@ -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) */