lkml.org 
[lkml]   [2021]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] lan743x: add virtual PHY for PHY-less devices
> > > @@ -1000,8 +1005,10 @@ static void lan743x_phy_close(struct
> > > lan743x_adapter *adapter)>
> > > struct net_device *netdev = adapter->netdev;
> > >
> > > phy_stop(netdev->phydev);
> > >
> > > - phy_disconnect(netdev->phydev);
> > > - netdev->phydev = NULL;
> > > + if (phy_is_pseudo_fixed_link(netdev->phydev))
> > > + lan743x_virtual_phy_disconnect(netdev->phydev);
> > > + else
> > > + phy_disconnect(netdev->phydev);
> >
> > phy_disconnect() should work. You might want to call

There are drivers which call phy_disconnect() on a fixed_link. e.g.

https://elixir.bootlin.com/linux/v5.11-rc4/source/drivers/net/usb/lan78xx.c#L3555.

It could be your missing call to fixed_phy_unregister() is leaving
behind bad state.

> It was to make ethtool show full set of supported speeds and MII only in
> supported ports (without TP and the no any ports in the bare card).

But fixed link does not support the full set of speed. It is fixed. It
supports only one speed it is configured with. And by setting it
wrongly, you are going to allow the user to do odd things, like use
ethtool force the link speed to a speed which is not actually
supported.

Andrew

\
 
 \ /
  Last update: 2021-01-23 00:25    [W:0.062 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site