From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 18 Nov 2015 06:54:21 +0100 Subject: [U-Boot] [PATCH] Revert "net: phy: delay only if reset handler is registered" In-Reply-To: <1447777546-18122-1-git-send-email-fabio.estevam@freescale.com> References: <1447777546-18122-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <564C128D.1040806@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Signed-off-by: Fabio Estevam > --- > 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