Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ansuel Smith and committed by
David S. Miller
77091933 b097bea1

+9 -2
+9 -2
drivers/net/mdio/mdio-ipq8064.c
··· 65 65 ((reg_offset << MII_REG_SHIFT) & MII_REG_MASK); 66 66 67 67 regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr); 68 - usleep_range(8, 10); 68 + usleep_range(10, 13); 69 69 70 70 err = ipq8064_mdio_wait_busy(priv); 71 71 if (err) ··· 91 91 ((reg_offset << MII_REG_SHIFT) & MII_REG_MASK); 92 92 93 93 regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr); 94 - usleep_range(8, 10); 94 + 95 + /* For the specific reg 31 extra time is needed or the next 96 + * read will produce garbage data. 97 + */ 98 + if (reg_offset == 31) 99 + usleep_range(30, 43); 100 + else 101 + usleep_range(10, 13); 95 102 96 103 return ipq8064_mdio_wait_busy(priv); 97 104 }