public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <stefan.roese@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Revert "net: phy: delay only if reset handler is registered"
Date: Wed, 18 Nov 2015 06:54:21 +0100	[thread overview]
Message-ID: <564C128D.1040806@gmail.com> (raw)
In-Reply-To: <1447777546-18122-1-git-send-email-fabio.estevam@freescale.com>

Hi Fabio,

On 17.11.2015 17:25, Fabio Estevam wrote:
> This reverts commit 59370f3fcd135089c402c93720a87c688abe600c.
>
> This commit breaks ethernet on at least mx6 Riotboard and
> mx6sxsabresd boards.
>
> Reported-by: Catalin Crenguta <catalin.crenguta@gmail.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>   drivers/net/phy/phy.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index d7364ff..9e68f1d 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -771,13 +771,11 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask,
>   		phy_interface_t interface)
>   {
>   	/* Reset the bus */
> -	if (bus->reset) {
> +	if (bus->reset)
>   		bus->reset(bus);
>
> -		/* Wait 15ms to make sure the PHY has come out of hard reset */
> -		udelay(15000);
> -	}
> -
> +	/* Wait 15ms to make sure the PHY has come out of hard reset */
> +	udelay(15000);
>   	return get_phy_device_by_mask(bus, phy_mask, interface);
>   }

I'm not sure if this revert is the right way to solve this problem.
Please take a look at my answer a few weeks ago:

https://www.mail-archive.com/u-boot at lists.denx.de/msg191206.html

As mentioned in my mail above, the delay should be added after
the deassertion of the PHY reset signal. And not here in
phy_find_by_mask() for all boards.

I just checked the code in mx6sxsabresd.c. Here also the delay is
missing:

         /* Reset AR8031 PHY */
         gpio_direction_output(IMX_GPIO_NR(2, 7) , 0);
         udelay(500);
         gpio_set_value(IMX_GPIO_NR(2, 7), 1);

Could you please test with this change:

	/* Reset AR8031 PHY */
	gpio_direction_output(IMX_GPIO_NR(2, 7) , 0);
	udelay(500);
	gpio_set_value(IMX_GPIO_NR(2, 7), 1);
+	udelay(1500);

Or even better, check how long the reset needs to be inactive
before the PHY starts to work.

Thanks,
Stefan

  reply	other threads:[~2015-11-18  5:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 16:25 [U-Boot] [PATCH] Revert "net: phy: delay only if reset handler is registered" Fabio Estevam
2015-11-18  5:54 ` Stefan Roese [this message]
2015-11-18 11:30   ` Fabio Estevam
2015-11-18  8:44 ` Jörg Krause
2015-11-18 11:34   ` Fabio Estevam
2015-11-19  8:13     ` Jörg Krause
2015-11-20 20:37       ` Fabio Estevam
2015-11-23 18:16         ` Fabio Estevam
2015-11-23 20:08           ` Jörg Krause
2015-12-23 15:42           ` Fabio Estevam
2016-01-04 11:19             ` Fabio Estevam
2016-01-04 12:49             ` Jörg Krause
2016-01-04 12:57               ` Fabio Estevam
2016-01-04 13:48                 ` Jörg Krause
2016-01-04 14:24                   ` Fabio Estevam
2016-01-04 18:35                     ` Joe Hershberger
2016-01-04 18:37                       ` Fabio Estevam

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=564C128D.1040806@gmail.com \
    --to=stefan.roese@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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