net: dsa: microchip: lan937x: clear the POR_READY_INT status bit
authorArun Ramadoss <arun.ramadoss@microchip.com>
Fri, 2 Sep 2022 10:32:09 +0000 (16:02 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Sep 2022 12:06:40 +0000 (13:06 +0100)
In the lan937x_reset_switch(), it masks all the switch and port
registers. In the Global_Int_status register, POR ready bit is write 1
to clear bit and all other bits are read only. So, this patch clear the
por_ready_int status bit by writing 1.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/lan937x_main.c

index 7b464f1fb5d88dc7dc0a6cea3a244e9390cef3d7..0466c4d0b10c87edbf9f59de97781e279d03728c 100644 (file)
@@ -225,6 +225,10 @@ int lan937x_reset_switch(struct ksz_device *dev)
        if (ret < 0)
                return ret;
 
+       ret = ksz_write32(dev, REG_SW_INT_STATUS__4, POR_READY_INT);
+       if (ret < 0)
+               return ret;
+
        ret = ksz_write32(dev, REG_SW_PORT_INT_MASK__4, 0xFF);
        if (ret < 0)
                return ret;