From 2be8662f257e32370062fe5cdbbf7fb2eb1ff44e Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 9 Oct 2017 21:06:27 +0200 Subject: e1000: Don't poll for FLSWCTL.GLDONE before starting a flash transaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Sascha Hauer --- 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 739bc17a51..2a71fb1b15 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"); -- cgit v1.2.3