lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5BGB4paCc=r7H9w1nq9ZCetkmjQBowSAro5WjLW5EG+mw@mail.gmail.com>
Date: Wed, 20 Sep 2023 13:28:36 -0300
From: Fabio Estevam <festevam@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Vladimir Oltean <olteanv@...il.com>, l00g33k@...il.com, netdev <netdev@...r.kernel.org>, 
	Jakub Kicinski <kuba@...nel.org>, sashal@...nel.org
Subject: Re: mv88e6xxx: Timeout waiting for EEPROM done

On Wed, Sep 20, 2023 at 11:52 AM Andrew Lunn <andrew@...n.ch> wrote:

> We have the helper mv88e6xxx_g2_eeprom_wait() which polls both bit 15
> and bit 11. Maybe we should use this instead of
> mv88e6xxx_g1_wait_eeprom_done()?

I tested your suggestion as shown below (sorry for the bad formatting):

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index a73008b9e0b3..6c93f2da5568 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3012,14 +3012,14 @@ static void mv88e6xxx_hardware_reset(struct
mv88e6xxx_chip *chip)
  * from the wrong location resulting in the switch booting
  * to wrong mode and inoperable.
  */
- mv88e6xxx_g1_wait_eeprom_done(chip);
+ mv88e6xxx_g2_eeprom_wait(chip);

  gpiod_set_value_cansleep(gpiod, 1);
  usleep_range(10000, 20000);
  gpiod_set_value_cansleep(gpiod, 0);
  usleep_range(10000, 20000);

- mv88e6xxx_g1_wait_eeprom_done(chip);
+ mv88e6xxx_g2_eeprom_wait(chip);
  }
 }

diff --git a/drivers/net/dsa/mv88e6xxx/global2.c
b/drivers/net/dsa/mv88e6xxx/global2.c
index ec49939968fa..ac302a935ce6 100644
--- a/drivers/net/dsa/mv88e6xxx/global2.c
+++ b/drivers/net/dsa/mv88e6xxx/global2.c
@@ -340,7 +340,7 @@ int mv88e6xxx_g2_pot_clear(struct mv88e6xxx_chip *chip)
  * Offset 0x15: EEPROM Addr (for 8-bit data access)
  */

-static int mv88e6xxx_g2_eeprom_wait(struct mv88e6xxx_chip *chip)
+int mv88e6xxx_g2_eeprom_wait(struct mv88e6xxx_chip *chip)
 {
  int bit = __bf_shf(MV88E6XXX_G2_EEPROM_CMD_BUSY);
  int err;
diff --git a/drivers/net/dsa/mv88e6xxx/global2.h
b/drivers/net/dsa/mv88e6xxx/global2.h
index c05fad5c9f19..6d8d38944b23 100644
--- a/drivers/net/dsa/mv88e6xxx/global2.h
+++ b/drivers/net/dsa/mv88e6xxx/global2.h
@@ -360,6 +360,8 @@ int mv88e6xxx_g2_trunk_clear(struct mv88e6xxx_chip *chip);
 int mv88e6xxx_g2_device_mapping_write(struct mv88e6xxx_chip *chip, int target,
        int port);

+int mv88e6xxx_g2_eeprom_wait(struct mv88e6xxx_chip *chip);
+
 extern const struct mv88e6xxx_irq_ops mv88e6097_watchdog_ops;
 extern const struct mv88e6xxx_irq_ops mv88e6250_watchdog_ops;
 extern const struct mv88e6xxx_irq_ops mv88e6390_watchdog_ops;

If this works for Alfred, I can submit it as a proper patch.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ