linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* macb: probe of 10090000.ethernet failed with error -110
@ 2018-08-24 17:18 Atish Patra
  2018-09-15  0:07 ` Atish Patra
  0 siblings, 1 reply; 18+ messages in thread
From: Atish Patra @ 2018-08-24 17:18 UTC (permalink / raw)
  To: linux-riscv

Hi,
I am not able to connect to the network on HiFiveUnleashed board (4/5 
times) because of the following error. I believe the error is due to 
device Microsemi VSC8541 which is enabled CONFIG_MICROSEMI_PHY.

----------------------------------------------------------------------
macb 10090000.ethernet (unnamed net_device) (uninitialized): Could not 
attach to PHY
macb: probe of 10090000.ethernet failed with error -110
----------------------------------------------------------------------

I have all the sifive specific drivers built on top of 4.17. It works 
sometimes. My initial debugging points to following code path.

macb_probe->phy_connect_direct->phy_attach_direct->phy_init_hw()->
genphy_soft_reset()->phy_poll_reset

phy_poll_reset tries to do reset PHY by clearing the BMCR_RESET.

int phy_init_hw(struct phy_device *phydev)
{
         int ret = 0;

         /* Deassert the reset signal */
         phy_device_reset(phydev, 0);

         if (!phydev->drv || !phydev->drv->config_init)
                 return 0;

         if (phydev->drv->soft_reset)
                 ret = phydev->drv->soft_reset(phydev);
         else
                 ret = genphy_soft_reset(phydev);

    ...
}

static int phy_poll_reset(struct phy_device *phydev)
{
         /* Poll until the reset bit clears (50ms per retry == 0.6 sec) */
         unsigned int retries = 12;
         int ret;

         dump_stack();
         do {
                 msleep(50);
                 ret = phy_read(phydev, MII_BMCR);
                 if (ret < 0)
                         return ret;
         } while (ret & BMCR_RESET && --retries);
         if (ret & BMCR_RESET)
                 return -ETIMEDOUT;

         /* Some chips (smsc911x) may still need up to another 1ms after the
          * BMCR_RESET bit is cleared before they are usable.
          */
         msleep(1);
         return 0;
}

It looks like genphy_soft_reset()->phy_poll_reset() timesout after 
trying out 0.6 seconds returning -ETIMEDOUT. I have tried to increase 
the timeout to 20 seconds. Still same timeout happens. I have verified 
the driver is getting registered.

[    5.960025] libphy: Microsemi VSC8541 SyncE: Registered new driver
[    6.455635] libphy: phy_init_hw: In phydev->drv name =[Microsemi 
VSC8541 SyncE]

Has anybody seen this error earlier or know what can be possible reason 
for the timeout?


Regards,
Atish

^ permalink raw reply	[flat|nested] 18+ messages in thread
* macb: probe of 10090000.ethernet failed with error -110
@ 2018-11-28 10:10 Andreas Schwab
  2018-11-28 10:10 ` Andreas Schwab
  2018-11-28 18:15 ` Atish Patra
  0 siblings, 2 replies; 18+ messages in thread
From: Andreas Schwab @ 2018-11-28 10:10 UTC (permalink / raw)
  To: linux-riscv

The PHY probing of the macb driver appears to be rather unreliable.
Most of the time it doesn't work the first time, I have to reload the
module several times to let it succeed.

[   40.530000] macb: GEM doesn't support hardware ptp.
[   40.530000] libphy: MACB_mii_bus: probed
[   41.450000] macb 10090000.ethernet (unnamed net_device) (uninitialized): Could not attach to PHY
[   41.510000] macb: probe of 10090000.ethernet failed with error -110
[ 1354.400000] macb: GEM doesn't support hardware ptp.
[ 1354.410000] libphy: MACB_mii_bus: probed
[ 1355.260000] macb 10090000.ethernet (unnamed net_device) (uninitialized): Could not attach to PHY
[ 1355.300000] macb: probe of 10090000.ethernet failed with error -110
[ 1358.100000] macb: GEM doesn't support hardware ptp.
[ 1358.110000] libphy: MACB_mii_bus: probed
[ 1358.310000] Microsemi VSC8541 SyncE 10090000.ethernet-ffffffff:00: attached PHY driver [Microsemi VSC8541 SyncE] (mii_bus:phy_addr=10090000.ethernet-ffffffff:00, irq=POLL)
[ 1358.320000] macb 10090000.ethernet eth0: Cadence GEM rev 0x10070109 at 0x10090000 irq 12 (70:b3:d5:92:f1:07)

This is 4.20-rc4 on a HiFive-U.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

end of thread, other threads:[~2019-04-10  9:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-24 17:18 macb: probe of 10090000.ethernet failed with error -110 Atish Patra
2018-09-15  0:07 ` Atish Patra
2019-04-10  9:50   ` Andreas Schwab
2018-11-28 10:10 Andreas Schwab
2018-11-28 10:10 ` Andreas Schwab
2018-11-28 18:15 ` Atish Patra
2018-11-28 18:15   ` Atish Patra
2018-11-28 21:33   ` Florian Fainelli
2018-11-28 21:33     ` Florian Fainelli
2018-11-29  2:08     ` Palmer Dabbelt
2018-11-29  2:08       ` Palmer Dabbelt
2018-11-29  2:28       ` Andrew Lunn
2018-11-29  2:28         ` Andrew Lunn
2018-11-29  3:01         ` Palmer Dabbelt
2018-11-29  3:01           ` Palmer Dabbelt
2018-11-29  5:55       ` Andrew Lunn
2018-11-29  5:55         ` Andrew Lunn
2018-11-29 11:55         ` Andreas Schwab

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