mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] net/e1000: use correct bit to check for flash presence
Date: Thu, 25 Jan 2018 08:21:04 +0100	[thread overview]
Message-ID: <20180125072104.u4nhlvk25zov6yqt@pengutronix.de> (raw)
In-Reply-To: <20180124113216.16950-1-l.stach@pengutronix.de>

On Wed, Jan 24, 2018 at 12:32:14PM +0100, Lucas Stach wrote:
> This code path was checking the same bit (E1000_EECD_EE_PRES) twice,
> which doesn't look right. Use the correct bit to check for flash
> presence.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/net/e1000/e1000.h  | 1 -
>  drivers/net/e1000/eeprom.c | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
> index 1558b3c7f5c7..0c83a47e9aab 100644
> --- a/drivers/net/e1000/e1000.h
> +++ b/drivers/net/e1000/e1000.h
> @@ -794,7 +794,6 @@ struct e1000_eeprom_info {
>  #ifndef E1000_EEPROM_GRANT_ATTEMPTS
>  #define E1000_EEPROM_GRANT_ATTEMPTS 1000 /* EEPROM # attempts to gain grant */
>  #endif
> -#define E1000_EECD_FLASH_IN_USE     0x00000100  /* Flash is present with a valid signature */

I think the right fix here is:

-#define E1000_EECD_FLASH_IN_USE     0x00000100  /* Flash is present with a valid signature */
+#define E1000_EECD_FLASH_IN_USE     0x00000040  /* Flash is present with a valid signature */

Fixes commit 95c346ccaa6da2257f605d18ac7595b99f628419.

>  #define E1000_EECD_EE_PRES          0x00000100
>  #define E1000_EECD_AUTO_RD          0x00000200  /* EEPROM Auto Read done */
>  #define E1000_EECD_SIZE_EX_MASK     0x00007800  /* EEprom Size */
> diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
> index 748d8afe7922..ee4f768bb4cd 100644
> --- a/drivers/net/e1000/eeprom.c
> +++ b/drivers/net/e1000/eeprom.c
> @@ -1569,7 +1569,7 @@ int e1000_register_eeprom(struct e1000_hw *hw)
>  
>  		if (eecd & E1000_EECD_AUTO_RD) {
>  			if (eecd & E1000_EECD_EE_PRES) {
> -				if (eecd & E1000_EECD_FLASH_IN_USE) {
> +				if (eecd & E1000_EECD_I210_FLASH_DETECTED) {
>  					uint32_t fla = e1000_read_reg(hw, E1000_FLA);
>  					dev_info(hw->dev,
>  						 "Hardware programmed from flash (%ssecure)\n",
> -- 
> 2.15.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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

      parent reply	other threads:[~2018-01-25  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 11:32 Lucas Stach
2018-01-24 11:32 ` [PATCH 2/3] net/e1000: mark EEPROM as invalid if external flash is absent Lucas Stach
2018-01-24 11:32 ` [PATCH 3/3] net/e1000: don't check EEPROM signature if populated from iNVM Lucas Stach
2018-01-25  7:21 ` Uwe Kleine-König [this message]

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=20180125072104.u4nhlvk25zov6yqt@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    /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