netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Baruch Siach <baruch@tkos.co.il>
Cc: Vivien Didelot <vivien.didelot@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH] net: dsa: mv88e6xxx: wait after reset deactivation
Date: Thu, 27 Jun 2019 15:13:23 +0200	[thread overview]
Message-ID: <20190627131323.GA31189@lunn.ch> (raw)
In-Reply-To: <92655572ed0c232b490967bed1245d121cc5a299.1561609786.git.baruch@tkos.co.il>

On Thu, Jun 27, 2019 at 07:29:46AM +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>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index f4e2db44ad91..549f528f216c 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -4910,6 +4910,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
>  		err = PTR_ERR(chip->reset);
>  		goto out;
>  	}
> +	mdelay(1);
>  
>  	err = mv88e6xxx_detect(chip);
>  	if (err)

Hi Baruch

So your switch is held in reset by default, by the bootloader? So you
need to take it out of reset in order to detect it. Yes, this makes
sense.

However, please use usleep_range(10000, 20000), and only do this if
the GPIO is valid.

Thanks

	Andrew

      reply	other threads:[~2019-06-27 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27  4:29 [PATCH] net: dsa: mv88e6xxx: wait after reset deactivation Baruch Siach
2019-06-27 13:13 ` Andrew Lunn [this message]

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=20190627131323.GA31189@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=baruch@tkos.co.il \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).