Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-10 Thread Florian Fainelli
On 2/10/21 3:20 AM, Michael Walle wrote: > > Am 2021-02-09 17:38, schrieb Michael Walle: >> --- a/drivers/net/phy/phy.c >> +++ b/drivers/net/phy/phy.c >> @@ -308,7 +308,7 @@ void phy_ethtool_ksettings_get(struct phy_device >> *phydev, >> if (phydev->interface == PHY_INTERFACE_MODE_MOCA) >>   

Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-10 Thread Michael Walle
Am 2021-02-10 12:54, schrieb Russell King - ARM Linux admin: On Wed, Feb 10, 2021 at 12:20:02PM +0100, Michael Walle wrote: Am 2021-02-09 17:38, schrieb Michael Walle: > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -308,7 +308,7 @@ void phy_ethtool_ksettings_get(struct phy_dev

Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-10 Thread Russell King - ARM Linux admin
On Wed, Feb 10, 2021 at 12:20:02PM +0100, Michael Walle wrote: > > Am 2021-02-09 17:38, schrieb Michael Walle: > > --- a/drivers/net/phy/phy.c > > +++ b/drivers/net/phy/phy.c > > @@ -308,7 +308,7 @@ void phy_ethtool_ksettings_get(struct phy_device > > *phydev, > > if (phydev->interface == PHY_

Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-10 Thread Michael Walle
Am 2021-02-09 17:38, schrieb Michael Walle: --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -308,7 +308,7 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev, if (phydev->interface == PHY_INTERFACE_MODE_MOCA) cmd->base.port = PORT_BNC; else -

Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-10 Thread Russell King - ARM Linux admin
On Wed, Feb 10, 2021 at 02:51:34AM +0100, Andrew Lunn wrote: > This is a general comment, not a problem specific to this patch. > > There is some interesting race conditions here. The marvell driver > first checks the fibre page and gets the status of the fiber port. As > you can see from the hunk

Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-09 Thread Andrew Lunn
On Tue, Feb 09, 2021 at 05:38:52PM +0100, Michael Walle wrote: > At the moment, PORT_MII is reported in the ethtool ops. This is odd > because it is an interface between the MAC and the PHY and no external > port. Some network card drivers will overwrite the port to twisted pair > or fiber, though.

Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-09 Thread Andrew Lunn
> @@ -1552,6 +1552,7 @@ static int marvell_read_status_page(struct phy_device > *phydev, int page) > phydev->asym_pause = 0; > phydev->speed = SPEED_UNKNOWN; > phydev->duplex = DUPLEX_UNKNOWN; > + phydev->port = fiber ? PORT_FIBRE : PORT_TP; > > if (phydev->autoneg ==

Re: [PATCH net-next] net: phy: introduce phydev->port

2021-02-09 Thread Florian Fainelli
On 2/9/21 8:38 AM, Michael Walle wrote: > At the moment, PORT_MII is reported in the ethtool ops. This is odd > because it is an interface between the MAC and the PHY and no external > port. Some network card drivers will overwrite the port to twisted pair > or fiber, though. Even worse, the MDI/MD