net: dsa: mv88e6xxx: Wait for EEPROM done before HW reset
authorAlfred Lee <l00g33k@gmail.com>
Tue, 15 Aug 2023 00:13:23 +0000 (17:13 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Aug 2023 03:16:51 +0000 (20:16 -0700)
commit23d775f12dcd23d052a4927195f15e970e27ab26
tree3a7e51c58b57e8ae1fcff908bb788a49948b5907
parentde4c5efeeca7172306bdc2e3efc0c6c3953bb338
net: dsa: mv88e6xxx: Wait for EEPROM done before HW reset

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 unexpected mode
rendering it inoperational.

Fixes: a3dcb3e7e70c ("net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset")
Signed-off-by: Alfred Lee <l00g33k@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230815001323.24739-1-l00g33k@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mv88e6xxx/chip.c