macb: probe of 10090000.ethernet failed with error -110

243 views
Skip to first unread message

atish patra

unread,
Aug 24, 2018, 1:23:14 PM8/24/18
to RISC-V SW Dev, wes...@sifive.com, Palmer Dabbelt, paul.w...@sifive.com
Hi,
Sorry for the duplicate message. I couldn't send it to SW dev from official email address.
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

Wesley Terpstra

unread,
Aug 24, 2018, 1:39:53 PM8/24/18
to atish patra, RISC-V SW Dev, Palmer Dabbelt, paul.w...@sifive.com
How are you testing this? From a cold restart or from 'reboot' in linux?

If you are testing from a cold restart, do you see the link light turn
orange before the linux heart-beat LED begins to blink?

Support of the PHY is optional. Try removing CONFIG_MICROSEMI_PHY from
your kernel and see if it works reliably then.

atish patra

unread,
Aug 24, 2018, 1:48:13 PM8/24/18
to RISC-V SW Dev, atis...@gmail.com, pal...@sifive.com, paul.w...@sifive.com


On Friday, August 24, 2018 at 10:39:53 AM UTC-7, Wesley Terpstra wrote:
How are you testing this? From a cold restart or from 'reboot' in linux?

cold restart.
 
If you are testing from a cold restart, do you see the link light turn
orange before the linux heart-beat LED begins to blink?


Yeah.
 
Support of the PHY is optional. Try removing CONFIG_MICROSEMI_PHY from
your kernel and see if it works reliably then.


Just wanted to clarify, there is no issue with booting the Unleashed with or without Microsemi board.

I want the networking up. Can I get to networking without CONFIG_MICROSEMI_PHY ?
Reply all
Reply to author
Forward
0 new messages