mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org, Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: Re: [PATCH 3/3] HACK: e1000: don't check for FLSWCTL.GLDONE when waiting for idle
Date: Mon, 9 Oct 2017 16:24:08 +0200	[thread overview]
Message-ID: <20171009142408.2g7k4mrfjq3tffwa@pengutronix.de> (raw)
In-Reply-To: <20171009093616.12686-4-u.kleine-koenig@pengutronix.de>

On Mon, Oct 09, 2017 at 11:36:16AM +0200, Uwe Kleine-König wrote:
> I don't understand all the consequences of this patch yet, but this makes reading
> out the flash chip connected to an i210 work for me.
> ---
>  drivers/net/e1000/eeprom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
> index 739bc17a519e..482a969f8d56 100644
> --- a/drivers/net/e1000/eeprom.c
> +++ b/drivers/net/e1000/eeprom.c
> @@ -709,8 +709,8 @@ static int e1000_flash_mode_wait_for_idle(struct e1000_hw *hw)
>  	 * 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,
> +				       E1000_FLSWCTL_DONE,
> +				       E1000_FLSWCTL_DONE,

I tested a bit with and without this change at it seems as long as
nothing "strange" happens, testing for both FLSWCTL.DONE and
FLSWCTL.GLDONE (i.e. not applying my HACK patch) works fine.

Still I think only testing for FLSWCTL.DONE is better because it works
well even if the state machine is in the middle of a read request and
then changing the command (which is always done after
e1000_flash_mode_wait_for_idle()) should work well.

I'll resend with a better commit log once I tested this.

Alexey: I didn't understand the comment above the patched line, maybe
I'm missing something?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-10-09 14:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  9:36 [PATCH 0/3] e1000: access to flash on i210 Uwe Kleine-König
2017-10-09  9:36 ` [PATCH 1/3] e1000: implement register mapping for E1000_{EERD, FLSW{CTL, DATA, CNT}} Uwe Kleine-König
2017-10-09 18:22   ` Andrey Smirnov
2017-10-09 18:33     ` [PATCH 1/3] e1000: implement register mapping for E1000_{EERD,FLSW{CTL,DATA,CNT}} Uwe Kleine-König
2017-10-09  9:36 ` [PATCH 2/3] e1000: implement support for smaller flash chips Uwe Kleine-König
2017-10-09 18:24   ` Andrey Smirnov
2017-10-09  9:36 ` [PATCH 3/3] HACK: e1000: don't check for FLSWCTL.GLDONE when waiting for idle Uwe Kleine-König
2017-10-09 14:24   ` Uwe Kleine-König [this message]
2017-10-09 18:15     ` Andrey Smirnov
2017-10-09 18:41       ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171009142408.2g7k4mrfjq3tffwa@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox