summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-29 00:42:38 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-29 00:42:38 +0000
commitd4fe52c16d73e2c36d9fe26334650aace75cf283 (patch)
tree67dc8063a6b0c675944fb0d39510b9b612bfd668
parent3021d3139b7fa96b15649d18c930bd5ba89e5582 (diff)
downloadmaster-31e0f0ae-d4fe52c16d73e2c36d9fe26334650aace75cf283.tar.gz
master-31e0f0ae-d4fe52c16d73e2c36d9fe26334650aace75cf283.tar.bz2
master-31e0f0ae-d4fe52c16d73e2c36d9fe26334650aace75cf283.zip
lantiq: fix PHY state handling issue
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48546
-rw-r--r--target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch b/target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch
new file mode 100644
index 0000000000..a86fe8de40
--- /dev/null
+++ b/target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch
@@ -0,0 +1,38 @@
+--- a/drivers/net/ethernet/lantiq_xrx200.c
++++ b/drivers/net/ethernet/lantiq_xrx200.c
+@@ -1209,13 +1209,18 @@ static void xrx200_gmac_update(struct xr
+ static void xrx200_mdio_link(struct net_device *dev)
+ {
+ struct xrx200_priv *priv = netdev_priv(dev);
++ bool changed = false, link = false;
+ int i;
+
+ for (i = 0; i < priv->num_port; i++) {
+ if (!priv->port[i].phydev)
+ continue;
+
++ if (priv->port[i].phydev->link)
++ link = true;
++
+ if (priv->port[i].link != priv->port[i].phydev->link) {
++ changed = true;
+ xrx200_gmac_update(&priv->port[i]);
+ priv->port[i].link = priv->port[i].phydev->link;
+ netdev_info(dev, "port %d %s link\n",
+@@ -1223,6 +1228,8 @@ static void xrx200_mdio_link(struct net_
+ (priv->port[i].link)?("got"):("lost"));
+ }
+ }
++ if (changed && !link)
++ netif_carrier_off(dev);
+ }
+
+ static inline int xrx200_mdio_poll(struct mii_bus *bus)
+@@ -1300,6 +1307,7 @@ static int xrx200_mdio_probe(struct net_
+ | SUPPORTED_TP);
+ phydev->advertising = phydev->supported;
+ port->phydev = phydev;
++ phydev->no_auto_carrier_off = true;
+
+ pr_info("%s: attached PHY [%s] (phy_addr=%s, irq=%d)\n",
+ dev->name, phydev->drv->name,