netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Fabio Estevam <festevam@gmail.com>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	l00g33k@gmail.com, netdev <netdev@vger.kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	sashal@kernel.org
Subject: Re: mv88e6xxx: Timeout waiting for EEPROM done
Date: Fri, 15 Sep 2023 16:34:44 +0200	[thread overview]
Message-ID: <5b5f24f4-f98f-4ea1-a4a3-f49c8385559d@lunn.ch> (raw)
In-Reply-To: <CAOMZO5AQ6VJi7Qhz4B0VQk5f2_R0bXB_RqipgGMBz9+vtHBMmg@mail.gmail.com>

> Just checked with a scope here and no, the reset pin is not held in
> reset before the driver loads.
> 
> > aim of this code is not to actually reset the switch, but to ensure it
> > is taken out of reset if it was being held in reset. And if it was
> > being held in reset, i would expect that to be for a long time, at
> > least the current Linux boot time.
> 
> That's a point I am concerned about: why don't we follow the datasheet
> with respect to taking the reset pin out of reset?
> 
> Isn't the sequence I used below better suited as it follows the
> datasheet by guaranteeing the 10ms at a low level?
> 
>        chip->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
>        ....
>        if (chip->reset) {
>                 usleep_range(10000, 20000);
>                 gpiod_set_value(chip->reset, 0);
>                 usleep_range(10000, 20000);
>        }

As i said, we do a hardware reset later. All we are trying to do at
this stage is probe the device, does it exist on the bus, and what ID
value does it have. I want to avoid the overhead of doing a reset now,
and then doing it again later.

So you say your device is not held in reset. So ideally there should
not be a change in the GPIO with devm_gpiod_get_optional(), and the
delay afterwards is pointless in your case.

When the device is held in reset, devm_gpiod_get_optional() should
release it from reset, and then we need a delay because experience has
shown the device will not actually respond on the MDIO bus for a short
while.

	Andrew

  reply	other threads:[~2023-09-15 14:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 14:31 mv88e6xxx: Timeout waiting for EEPROM done Fabio Estevam
2023-09-14 15:15 ` Andrew Lunn
2023-09-14 16:22   ` Fabio Estevam
2023-09-14 19:05     ` Fabio Estevam
2023-09-14 21:38       ` Andrew Lunn
2023-09-15  0:40         ` Fabio Estevam
2023-09-15 13:08           ` Andrew Lunn
2023-09-15 14:13             ` Fabio Estevam
2023-09-15 14:34               ` Andrew Lunn [this message]
2023-09-15 17:05                 ` Fabio Estevam
2023-09-15 18:23                   ` Andrew Lunn
2023-09-19 19:23                     ` Fabio Estevam
2023-09-19 19:44                       ` Andrew Lunn
2023-09-20  0:47                         ` Fabio Estevam
2023-09-20 14:52                           ` Andrew Lunn
2023-09-20 16:28                             ` Fabio Estevam
2023-09-20 16:46                               ` Andrew Lunn
2023-09-16 21:43         ` Alfred Lee
2023-09-19 18:14         ` Alfred Lee

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=5b5f24f4-f98f-4ea1-a4a3-f49c8385559d@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=festevam@gmail.com \
    --cc=kuba@kernel.org \
    --cc=l00g33k@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=sashal@kernel.org \
    /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).