netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: dsa: mv88e6xxx: wait after reset deactivation
@ 2019-06-27 18:17 Baruch Siach
  2019-06-27 18:27 ` Andrew Lunn
  2019-06-29 19:21 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Baruch Siach @ 2019-06-27 18:17 UTC (permalink / raw)
  To: Andrew Lunn, Vivien Didelot; +Cc: netdev, Baruch Siach

Add a 1ms delay after reset deactivation. Otherwise the chip returns
bogus ID value. This is observed with 88E6390 (Peridot) chip.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
v2: Address Andrew Lunn's comments:
  Use usleep_range.
  Delay only when reset line is valid.
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index ae750ab9a4d7..5f81d9a3a2a6 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -4910,6 +4910,8 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
 		err = PTR_ERR(chip->reset);
 		goto out;
 	}
+	if (chip->reset)
+		usleep_range(1000, 2000);
 
 	err = mv88e6xxx_detect(chip);
 	if (err)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] net: dsa: mv88e6xxx: wait after reset deactivation
  2019-06-27 18:17 [PATCH v2] net: dsa: mv88e6xxx: wait after reset deactivation Baruch Siach
@ 2019-06-27 18:27 ` Andrew Lunn
  2019-06-29 19:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2019-06-27 18:27 UTC (permalink / raw)
  To: Baruch Siach; +Cc: Vivien Didelot, netdev

On Thu, Jun 27, 2019 at 09:17:39PM +0300, Baruch Siach wrote:
> Add a 1ms delay after reset deactivation. Otherwise the chip returns
> bogus ID value. This is observed with 88E6390 (Peridot) chip.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] net: dsa: mv88e6xxx: wait after reset deactivation
  2019-06-27 18:17 [PATCH v2] net: dsa: mv88e6xxx: wait after reset deactivation Baruch Siach
  2019-06-27 18:27 ` Andrew Lunn
@ 2019-06-29 19:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-06-29 19:21 UTC (permalink / raw)
  To: baruch; +Cc: andrew, vivien.didelot, netdev

From: Baruch Siach <baruch@tkos.co.il>
Date: Thu, 27 Jun 2019 21:17:39 +0300

> Add a 1ms delay after reset deactivation. Otherwise the chip returns
> bogus ID value. This is observed with 88E6390 (Peridot) chip.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> v2: Address Andrew Lunn's comments:
>   Use usleep_range.
>   Delay only when reset line is valid.

Applied and queuedu up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-29 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 18:17 [PATCH v2] net: dsa: mv88e6xxx: wait after reset deactivation Baruch Siach
2019-06-27 18:27 ` Andrew Lunn
2019-06-29 19:21 ` David Miller

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).