Commit 77091933 authored by Ansuel Smith's avatar Ansuel Smith Committed by David S. Miller

net: mdio: ipq8064: enlarge sleep after read/write operation

With the use of the qca8k dsa driver, some problem arised related to
port status detection. With a load on a specific port (for example a
simple speed test), the driver starts to behave in a strange way and
garbage data is produced. To address this, enlarge the sleep delay and
address a bug for the reg offset 31 that require additional delay for
this specific reg.
Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b097bea1
...@@ -65,7 +65,7 @@ ipq8064_mdio_read(struct mii_bus *bus, int phy_addr, int reg_offset) ...@@ -65,7 +65,7 @@ ipq8064_mdio_read(struct mii_bus *bus, int phy_addr, int reg_offset)
((reg_offset << MII_REG_SHIFT) & MII_REG_MASK); ((reg_offset << MII_REG_SHIFT) & MII_REG_MASK);
regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr); regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr);
usleep_range(8, 10); usleep_range(10, 13);
err = ipq8064_mdio_wait_busy(priv); err = ipq8064_mdio_wait_busy(priv);
if (err) if (err)
...@@ -91,7 +91,14 @@ ipq8064_mdio_write(struct mii_bus *bus, int phy_addr, int reg_offset, u16 data) ...@@ -91,7 +91,14 @@ ipq8064_mdio_write(struct mii_bus *bus, int phy_addr, int reg_offset, u16 data)
((reg_offset << MII_REG_SHIFT) & MII_REG_MASK); ((reg_offset << MII_REG_SHIFT) & MII_REG_MASK);
regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr); regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr);
usleep_range(8, 10);
/* For the specific reg 31 extra time is needed or the next
* read will produce garbage data.
*/
if (reg_offset == 31)
usleep_range(30, 43);
else
usleep_range(10, 13);
return ipq8064_mdio_wait_busy(priv); return ipq8064_mdio_wait_busy(priv);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment