* [PATCH net-next] net: phy: don't set autoneg if it's not supported
@ 2019-04-16 21:54 Heiner Kallweit
2019-04-18 23:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2019-04-16 21:54 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev
In phy_device_create() we set phydev->autoneg = 1. This isn't changed
even if the PHY doesn't support autoneg. This seems to affect very
few PHY's, and they disable phydev->autoneg in their config_init
callback. So it's more of an improvement, therefore net-next.
The patch also wouldn't apply to older kernel versions because the
link mode bitmaps have been introduced recently.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/phy_device.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 5eb905ab5..2d2b654e8 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2158,6 +2158,10 @@ static int phy_probe(struct device *dev)
if (err)
goto out;
+ if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+ phydev->supported))
+ phydev->autoneg = 0;
+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
phydev->supported))
phydev->is_gigabit_capable = 1;
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: phy: don't set autoneg if it's not supported
2019-04-16 21:54 [PATCH net-next] net: phy: don't set autoneg if it's not supported Heiner Kallweit
@ 2019-04-18 23:28 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-04-18 23:28 UTC (permalink / raw)
To: hkallweit1; +Cc: andrew, f.fainelli, netdev
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Tue, 16 Apr 2019 23:54:00 +0200
> In phy_device_create() we set phydev->autoneg = 1. This isn't changed
> even if the PHY doesn't support autoneg. This seems to affect very
> few PHY's, and they disable phydev->autoneg in their config_init
> callback. So it's more of an improvement, therefore net-next.
> The patch also wouldn't apply to older kernel versions because the
> link mode bitmaps have been introduced recently.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-18 23:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 21:54 [PATCH net-next] net: phy: don't set autoneg if it's not supported Heiner Kallweit
2019-04-18 23:28 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).