summaryrefslogtreecommitdiff
path: root/drivers/net/e1000.c
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2014-10-17 13:44:06 -0700
committerTom Rini <trini@ti.com>2014-10-27 17:54:09 -0400
commit76f8cdb2036bf86ec7193ed13129797f0a32d13d (patch)
treeefcc487ebcfe8916a8b9d54707c990713010cdc3 /drivers/net/e1000.c
parent998194584e53db13a9ed01f78c8f856e8f0bec67 (diff)
downloadu-boot-imx-76f8cdb2036bf86ec7193ed13129797f0a32d13d.zip
u-boot-imx-76f8cdb2036bf86ec7193ed13129797f0a32d13d.tar.gz
u-boot-imx-76f8cdb2036bf86ec7193ed13129797f0a32d13d.tar.bz2
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 <yorksun@freescale.com> CC: Marek Vasut <marex@denx.de> CC: Tim Harvey <tharvey@gateworks.com> Acked-by: Marcel Ziswiler <marcel@ziswiler.com>
Diffstat (limited to 'drivers/net/e1000.c')
-rw-r--r--drivers/net/e1000.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 6e8765c..b092867 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -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) */