lkml.org 
[lkml]   [2019]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net 2/2] net: phy: Use C45 Helpers in PHY_FORCING state
On Fri, Mar 01, 2019 at 11:54:24AM +0100, Jose Abreu wrote:
> +static inline int phy_update_link(struct phy_device *phydev)
> +{
> + if (!phydev->drv)
> + return -EIO;
> +
> + if (phydev->drv->read_status)
> + return phydev->drv->read_status(phydev);
> + else if (phydev->is_c45)
> + return gen10g_read_status(phydev);
> + else
> + return genphy_update_link(phydev);
> +}

Hi Jose

The asymmetry here could be an issue. We might fall into the trap
that a c45 PHY has the full state in phydev updated, were as a c22
only has the link updated. Somebody testing on C45 might miss a bug
for a C22 device.

Maybe this should be called phy_read_state(), and calls
genphy_read_status() not genphy_update_link().

Andrew

\
 
 \ /
  Last update: 2019-03-01 14:53    [W:0.080 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site