aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2019-02-24 12:01:18 -0500
committerDavid S. Miller <davem@davemloft.net>2019-02-25 01:29:14 -0500
commit0f3b1cf23f0ee72017ee6daebcf6cbe601be8bee (patch)
tree55a73e898c3b20ef7d090b82a7cd3c7623793aa7
parent726097d6d6d8e928c62f459305d74856f7cab155 (diff)
net: phy: fix reading fixed phy status
With the switch to phy_resolve_aneg_linkmode() we don't read from the chip any longer what is advertised but use phydev->advertising directly. For a fixed phy however this bitmap is empty so far, what results in no common mode being found. This breaks DSA. Fix this by advertising everything that is supported. For a normal phy this done by phy_probe(). Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status") Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/fixed_phy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index b0d1368c3400..1acd8bfdb3bc 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -22,6 +22,7 @@
22#include <linux/seqlock.h> 22#include <linux/seqlock.h>
23#include <linux/idr.h> 23#include <linux/idr.h>
24#include <linux/netdevice.h> 24#include <linux/netdevice.h>
25#include <linux/linkmode.h>
25 26
26#include "swphy.h" 27#include "swphy.h"
27 28
@@ -300,6 +301,8 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
300 phy->supported); 301 phy->supported);
301 } 302 }
302 303
304 linkmode_copy(phy->advertising, phy->supported);
305
303 ret = phy_device_register(phy); 306 ret = phy_device_register(phy);
304 if (ret) { 307 if (ret) {
305 phy_device_free(phy); 308 phy_device_free(phy);