All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: improve setting advertised modes in phy_probe
@ 2019-04-28 13:03 Heiner Kallweit
  2019-04-28 17:04 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Heiner Kallweit @ 2019-04-28 13:03 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev

So far we set the advertising bitmap before setting the pause flags
in the supported bitmap. This may cause pause not being advertised.
At least r8169 driver works around this by copying supported ->
advertising on its own. The linkmode bitmaps have been introduced only
recently, therefore the patch wouldn't apply to older versions.
And behavior has been like this for years, therefore I'd consider it
an improvement.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 2a2aaa5f3..c56897db2 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2177,7 +2177,6 @@ static int phy_probe(struct device *dev)
 		phydev->is_gigabit_capable = 1;
 
 	of_set_phy_supported(phydev);
-	linkmode_copy(phydev->advertising, phydev->supported);
 
 	/* Get the EEE modes we want to prohibit. We will ask
 	 * the PHY stop advertising these mode later on
@@ -2203,6 +2202,8 @@ static int phy_probe(struct device *dev)
 				 phydev->supported);
 	}
 
+	linkmode_copy(phydev->advertising, phydev->supported);
+
 	/* Set the state to READY by default */
 	phydev->state = PHY_READY;
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-28 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-28 13:03 [PATCH net-next] net: phy: improve setting advertised modes in phy_probe Heiner Kallweit
2019-04-28 17:04 ` Andrew Lunn
2019-04-28 18:10   ` Heiner Kallweit
2019-04-28 21:21     ` Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.