[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dbff79f7-8fb2-7473-8a11-57810a25da37@gmail.com>
Date: Wed, 20 Sep 2023 10:41:16 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Fabio Estevam <festevam@...il.com>, kuba@...nel.org
Cc: andrew@...n.ch, olteanv@...il.com, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, l00g33k@...il.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Fabio Estevam <festevam@...x.de>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: Avoid EEPROM timeout when EEPROM is
absent
On 9/20/23 10:35, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@...x.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@...n.ch>
> Signed-off-by: Fabio Estevam <festevam@...x.de>
Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
--
Florian
Powered by blists - more mailing lists