[OpenWrt-Devel] [PATCH 5/5] ar8216: use genphy_config_aneg also for PHY 0

Heiner Kallweit hkallweit1 at gmail.com
Fri Oct 31 16:38:56 EDT 2014


Kernel 3.14 introduced a switch reset in phy_init_hw in drivers/net/phy
causing BMCR_ANENABLE to get cleared.

Due to the fact that ar8xxx_phy_config_aneg does nothing for
PHY 0 autonegatiation support remains disabled.
This can cause ports to operate at 10MBit/half-duplex only.

Fix this by calling genphy_config_aneg for PHY 0 too as
genphy_config_aneg sets BMCR_ANENABLE if it's not yet set.
Fixes: ticket 17800

Signed-off-by: Heiner Kallweit <hkallweit1 at gmail.com>
---
 target/linux/generic/files/drivers/net/phy/ar8216.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index b0487e5..6b68966 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -2864,15 +2864,6 @@ ar8xxx_phy_read_status(struct phy_device *phydev)
 	return ret;
 }
 
-static int
-ar8xxx_phy_config_aneg(struct phy_device *phydev)
-{
-	if (phydev->addr == 0)
-		return 0;
-
-	return genphy_config_aneg(phydev);
-}
-
 static const u32 ar8xxx_phy_ids[] = {
 	0x004dd033,
 	0x004dd034, /* AR8327 */
@@ -3044,7 +3035,7 @@ static struct phy_driver ar8xxx_phy_driver = {
 	.remove		= ar8xxx_phy_remove,
 	.detach		= ar8xxx_phy_detach,
 	.config_init	= ar8xxx_phy_config_init,
-	.config_aneg	= ar8xxx_phy_config_aneg,
+	.config_aneg	= genphy_config_aneg,
 	.read_status	= ar8xxx_phy_read_status,
 	.driver		= { .owner = THIS_MODULE },
 };
-- 
2.1.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list