lkml.org 
[lkml]   [2022]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net 1/1] net: phy: marvell: add link status check before enabling phy loopback
> @@ -2015,14 +2016,23 @@ static int m88e1510_loopback(struct phy_device *phydev, bool enable)
> if (err < 0)
> return err;
>
> - /* FIXME: Based on trial and error test, it seem 1G need to have
> - * delay between soft reset and loopback enablement.
> - */
> - if (phydev->speed == SPEED_1000)
> - msleep(1000);
> + if (phydev->speed == SPEED_1000) {
> + err = phy_read_poll_timeout(phydev, MII_BMSR, val, val & BMSR_LSTATUS,
> + PHY_LOOP_BACK_SLEEP,
> + PHY_LOOP_BACK_TIMEOUT, true);

Is this link with itself?

Have you tested this with the cable unplugged?

> + if (err)
> + return err;

I'm just trying to ensure we don't end up here with -ETIMEDOUT.

>
> +#define PHY_LOOP_BACK_SLEEP 1000000
> +#define PHY_LOOP_BACK_TIMEOUT 8000000

The kernel seems to be pretty consistent in having loopback as one
word.

Andrew

\
 
 \ /
  Last update: 2022-08-25 15:27    [W:0.093 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site