From: Andrew Lunn <andrew@lunn.ch>
To: Alfred Lee <l00g33k@gmail.com>
Cc: netdev@vger.kernel.org, f.fainelli@gmail.com, olteanv@gmail.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, sgarzare@redhat.com, AVKrasnov@sberdevices.ru,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: dsa: mv88e6xxx: Wait for EEPROM done before HW reset
Date: Fri, 11 Aug 2023 22:59:24 +0200 [thread overview]
Message-ID: <6ed334ea-3670-4620-8653-baf70de145f1@lunn.ch> (raw)
In-Reply-To: <CANZWyGJDC6GMf1L+JqPEWv_c1ydnYh6rmjAY3+wrNtDOevALQA@mail.gmail.com>
On Fri, Aug 11, 2023 at 01:30:20PM -0700, Alfred Lee wrote:
> If the switch is reset during active EEPROM transactions, as in
> just after an SoC reset after power up, the I2C bus transaction
> may be cut short leaving the EEPROM internal I2C state machine
> in the wrong state. When the switch is reset again, the bad
> state machine state may result in data being read from the wrong
> memory location causing the switch to enter unexpect mode
> rendering it inoperational.
>
> Fixes: 8abbffd27ced ("net: dsa: mv88e6xxx: Wait for EEPROM done after HW
> reset")
> Signed-off-by: Alfred Lee <l00g33k@gmail.com>
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/
> chip.c
> index c7d51a539451..7af2f08a62f1 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -3034,6 +3034,14 @@ static void mv88e6xxx_hardware_reset(struct
> mv88e6xxx_chip *chip)
> /* If there is a GPIO connected to the reset pin, toggle it */
> if (gpiod) {
> + /* If the switch has just been reset and not yet completed
> + * loading EEPROM, the reset may interrupt the I2C transaction
> + * mid-byte, causing the first EEPROM read after the reset
> + * from the wrong location resulting in the switch booting
> + * to wrong mode and inoperable.
> + */
> + mv88e6xxx_g1_wait_eeprom_done(chip);
> +
> gpiod_set_value_cansleep(gpiod, 1);
> usleep_range(10000, 20000);
> gpiod_set_value_cansleep(gpiod, 0);
Hi Alfred
It looks like all the white spacing in the email has been
destroyed. Please check your mail configuration. You might want to
email the patch to only yourself, and then make sure it cleanly
applies via 'git am'
Andrew
---
pw-bot: cr
next parent reply other threads:[~2023-08-11 21:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANZWyGJDC6GMf1L+JqPEWv_c1ydnYh6rmjAY3+wrNtDOevALQA@mail.gmail.com>
2023-08-11 20:59 ` Andrew Lunn [this message]
2023-08-11 23:23 Alfred Lee
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=6ed334ea-3670-4620-8653-baf70de145f1@lunn.ch \
--to=andrew@lunn.ch \
--cc=AVKrasnov@sberdevices.ru \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@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 \
--cc=sgarzare@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
all inboxes | Powered by JetHome®