[PATCH v2 3/3] e1000: Don't poll for FLSWCTL.GLDONE before starting a flash transaction

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Oct 9 12:06:27 PDT 2017


While FLSWCTL.GLDONE is set when the last transaction was fully
completed, there is no good reason to depend on this. According to the
i210 datasheet having FLSWCTL.DONE is enough.

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

diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
index 739bc17a519e..2a71fb1b159c 100644
--- a/drivers/net/e1000/eeprom.c
+++ b/drivers/net/e1000/eeprom.c
@@ -701,17 +701,8 @@ static int32_t e1000_spi_eeprom_ready(struct e1000_hw *hw)
 
 static int e1000_flash_mode_wait_for_idle(struct e1000_hw *hw)
 {
-	/* Strictly speaking we need to poll FLSWCTL.DONE only if we
-	 * are executing this code after a reset event, but it
-	 * shouldn't hurt to do this everytime, besided we need to
-	 * poll got FLSWCTL.GLDONE to make sure that back to back
-	 * calls to that function work correctly, since we finish
-	 * execution by polling only FLSWCTL.DONE */
-
-	const int ret = e1000_poll_reg(hw, E1000_FLSWCTL,
-				       E1000_FLSWCTL_DONE | E1000_FLSWCTL_GLDONE,
-				       E1000_FLSWCTL_DONE | E1000_FLSWCTL_GLDONE,
-				       SECOND);
+	const int ret = e1000_poll_reg(hw, E1000_FLSWCTL, E1000_FLSWCTL_DONE,
+				       E1000_FLSWCTL_DONE, SECOND);
 	if (ret < 0)
 		dev_err(hw->dev,
 			"Timeout waiting for FLSWCTL.DONE to be set\n");
-- 
2.11.0




More information about the barebox mailing list