From: Florian Fainelli <f.fainelli@gmail.com>
To: Fabio Estevam <festevam@gmail.com>, kuba@kernel.org
Cc: andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, l00g33k@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Fabio Estevam <festevam@denx.de>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: Avoid EEPROM timeout when EEPROM is absent
Date: Wed, 20 Sep 2023 10:41:16 -0700 [thread overview]
Message-ID: <dbff79f7-8fb2-7473-8a11-57810a25da37@gmail.com> (raw)
In-Reply-To: <20230920173508.63449-1-festevam@gmail.com>
On 9/20/23 10:35, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
>
> Since commit 23d775f12dcd ("net: dsa: mv88e6xxx: Wait for EEPROM done
> before HW reset") the following error is seen on a imx8mn board with
> a 88E6320 switch:
>
> mv88e6085 30be0000.ethernet-1:00: Timeout waiting for EEPROM done
>
> This board does not have an EEPROM attached to the switch though.
>
> This problem is well explained by Andrew Lunn:
>
> "If there is an EEPROM, and the EEPROM contains a lot of data, it could
> be that when we perform a hardware reset towards the end of probe, it
> interrupts an I2C bus transaction, leaving the I2C bus in a bad state,
> and future reads of the EEPROM do not work.
>
> The work around for this was to poll the EEInt status and wait for it
> to go true before performing the hardware reset.
>
> However, we have discovered that for some boards which do not have an
> EEPROM, EEInt never indicates complete. As a result,
> mv88e6xxx_g1_wait_eeprom_done() spins for a second and then prints a
> warning.
>
> We probably need a different solution than calling
> mv88e6xxx_g1_wait_eeprom_done(). The datasheet for 6352 documents the
> EEPROM Command register:
>
> bit 15 is:
>
> EEPROM Unit Busy. This bit must be set to a one to start an EEPROM
> operation (see EEOp below). Only one EEPROM operation can be
> executing at one time so this bit must be zero before setting it to
> a one. When the requested EEPROM operation completes this bit will
> automatically be cleared to a zero. The transition of this bit from
> a one to a zero can be used to generate an interrupt (the EEInt in
> Global 1, offset 0x00).
>
> and more interesting is bit 11:
>
> Register Loader Running. This bit is set to one whenever the
> register loader is busy executing instructions contained in the
> EEPROM."
>
> Change to calling mv88e6xxx_g1_wait_eeprom_done() to fix the timeout
> error when the EEPROM chip is not present.
>
> Fixes: 23d775f12dcd ("net: dsa: mv88e6xxx: Wait for EEPROM done before HW reset")
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
prev parent reply other threads:[~2023-09-20 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 17:35 [PATCH] net: dsa: mv88e6xxx: Avoid EEPROM timeout when EEPROM is absent Fabio Estevam
2023-09-20 17:41 ` Florian Fainelli [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=dbff79f7-8fb2-7473-8a11-57810a25da37@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=festevam@denx.de \
--cc=festevam@gmail.com \
--cc=kuba@kernel.org \
--cc=l00g33k@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).