[PATCH 2/6] net/e1000: don't use the eeprom word size as timeout to get a semaphore

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Wed Nov 22 02:22:27 PST 2017


Nothing in the documentation suggests that the time to get a semaphore
depends on the size of the (optional) eeprom and I doubt there is a
relation. Given that 2048 is the maximal value for word_size unless a
flash is used to emulate the eeprom, pick 2049 as alternative arbitrary
value that probably doesn't result in regressions.

This drops the only user of ->word_size outside of eeprom.c which allows
easier restructurings there in the future.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
 drivers/net/e1000/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 6491623104c3..01c9f39a25f4 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -142,7 +142,7 @@ static int32_t e1000_set_phy_mode(struct e1000_hw *hw)
  ***************************************************************************/
 static int32_t e1000_get_software_semaphore(struct e1000_hw *hw)
 {
-	int32_t timeout = hw->eeprom.word_size + 1;
+	int32_t timeout = 2049;
 	uint32_t swsm;
 
 	DEBUGFUNC();
@@ -214,7 +214,7 @@ static int32_t e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw)
 	}
 
 	/* Get the FW semaphore. */
-	timeout = hw->eeprom.word_size + 1;
+	timeout = 2049;
 	while (timeout) {
 		swsm = e1000_read_reg(hw, E1000_SWSM);
 		swsm |= E1000_SWSM_SWESMBI;
-- 
2.11.0




More information about the barebox mailing list