summaryrefslogtreecommitdiff
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-04-02 16:35:22 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-04-02 16:35:22 +0000
commit0508ee0c007a1cd5735e367fb7b0d717b3494f64 (patch)
tree0da6fb5862e1d9a6fa6da2b52ded3f597f7fe0d2 /target/linux/generic/files
parentf5eeb3f74d47dec3468627dc863adb8addfa2cf8 (diff)
downloadmtk-20170518-0508ee0c007a1cd5735e367fb7b0d717b3494f64.zip
mtk-20170518-0508ee0c007a1cd5735e367fb7b0d717b3494f64.tar.gz
mtk-20170518-0508ee0c007a1cd5735e367fb7b0d717b3494f64.tar.bz2
rtl8306: do not overwrite registers in the phy fixup, it could mess up other switches (fixes #8911)
SVN-Revision: 26410
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8306.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8306.c b/target/linux/generic/files/drivers/net/phy/rtl8306.c
index 4fa910a..78ded0a 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8306.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8306.c
@@ -56,6 +56,7 @@ struct rtl_priv {
int do_cpu;
struct mii_bus *bus;
char hwname[sizeof(RTL_NAME_UNKNOWN)];
+ bool fixup;
};
struct rtl_phyregs {
@@ -256,6 +257,9 @@ rtl_set_page(struct rtl_priv *priv, unsigned int page)
struct mii_bus *bus = priv->bus;
u16 pgsel;
+ if (priv->fixup)
+ return;
+
if (priv->page == page)
return;
@@ -923,6 +927,8 @@ rtl8306_fixup(struct phy_device *pdev)
if (pdev->addr != 0 && pdev->addr != 4)
return 0;
+ memset(&priv, 0, sizeof(priv));
+ priv.fixup = true;
priv.page = -1;
priv.bus = pdev->bus;
chipid = rtl_get(&priv.dev, RTL_REG_CHIPID);