From b3797d1a92afe97c173b00fdb7824cedba24eef0 Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sun, 20 Sep 2020 01:00:45 +0800 Subject: [PATCH] dirty hack for an unknown problem...... --- target/linux/generic/files/drivers/net/phy/ar8216.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 7c0745c8a6..4adac6ee88 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -255,12 +255,14 @@ ar8xxx_mii_write32(struct ar8xxx_priv *priv, int phy_id, int regnum, u32 val) u32 ar8xxx_read(struct ar8xxx_priv *priv, int reg) { + unsigned long flags; struct mii_bus *bus = priv->mii_bus; u16 r1, r2, page; u32 val; split_addr((u32) reg, &r1, &r2, &page); + local_irq_save(flags); mutex_lock(&bus->mdio_lock); bus->write(bus, 0x18, 0, page); @@ -268,6 +270,7 @@ ar8xxx_read(struct ar8xxx_priv *priv, int reg) val = ar8xxx_mii_read32(priv, 0x10 | r2, r1); mutex_unlock(&bus->mdio_lock); + local_irq_restore(flags); return val; } @@ -275,11 +278,13 @@ ar8xxx_read(struct ar8xxx_priv *priv, int reg) void ar8xxx_write(struct ar8xxx_priv *priv, int reg, u32 val) { + unsigned long flags; struct mii_bus *bus = priv->mii_bus; u16 r1, r2, page; split_addr((u32) reg, &r1, &r2, &page); + local_irq_save(flags); mutex_lock(&bus->mdio_lock); bus->write(bus, 0x18, 0, page); @@ -287,6 +292,7 @@ ar8xxx_write(struct ar8xxx_priv *priv, int reg, u32 val) ar8xxx_mii_write32(priv, 0x10 | r2, r1, val); mutex_unlock(&bus->mdio_lock); + local_irq_restore(flags); } u32 -- 2.30.2