netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: of_mdio: fix of_set_phy_supported after driver probing
@ 2014-02-13 21:14 Florian Fainelli
  2014-02-14 20:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2014-02-13 21:14 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli

Commit 8fdade4 ("net: of_mdio: parse "max-speed" property to set PHY
supported features") introduced a typo in of_set_phy_supported for the
first assignment of phydev->supported which will not effectively limit
the PHY device supported features bits if the PHY driver contains
"higher" features (e.g: max-speed = <100> and PHY driver has
PHY_GBIT_FEATURES set).

Fix this by making sure that the very first thing is to reset to sane
defaults (PHY_BASIC_FEATURES) and then progressively add speed features
as we parse them.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/of/of_mdio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 875b7b6..495facc 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -24,7 +24,11 @@ MODULE_LICENSE("GPL");
 
 static void of_set_phy_supported(struct phy_device *phydev, u32 max_speed)
 {
-	phydev->supported |= PHY_DEFAULT_FEATURES;
+	/* The default values for phydev->supported are provided by the PHY
+	 * driver "features" member, we want to reset to sane defaults fist
+	 * before supporting higher speeds.
+	 */
+	phydev->supported &= PHY_DEFAULT_FEATURES;
 
 	switch (max_speed) {
 	default:
-- 
1.8.3.2

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

* Re: [PATCH net] net: of_mdio: fix of_set_phy_supported after driver probing
  2014-02-13 21:14 [PATCH net] net: of_mdio: fix of_set_phy_supported after driver probing Florian Fainelli
@ 2014-02-14 20:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-02-14 20:52 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 13 Feb 2014 13:14:48 -0800

> Commit 8fdade4 ("net: of_mdio: parse "max-speed" property to set PHY
> supported features") introduced a typo in of_set_phy_supported for the
> first assignment of phydev->supported which will not effectively limit
> the PHY device supported features bits if the PHY driver contains
> "higher" features (e.g: max-speed = <100> and PHY driver has
> PHY_GBIT_FEATURES set).
> 
> Fix this by making sure that the very first thing is to reset to sane
> defaults (PHY_BASIC_FEATURES) and then progressively add speed features
> as we parse them.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2014-02-14 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 21:14 [PATCH net] net: of_mdio: fix of_set_phy_supported after driver probing Florian Fainelli
2014-02-14 20:52 ` 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).