diff --git a/drivers/net/rswitch.c b/drivers/net/rswitch.c index 01b928972f3..5a3a1761b8f 100644 --- a/drivers/net/rswitch.c +++ b/drivers/net/rswitch.c @@ -1299,6 +1299,7 @@ static int rswitch_probe(struct udevice *dev) static int rswitch_remove(struct udevice *dev) { struct rswitch_priv *priv = dev_get_priv(dev); + int ret; if (!priv->parallel_mode) { clk_disable(&priv->rsw_clk); @@ -1308,6 +1309,11 @@ static int rswitch_remove(struct udevice *dev) mdio_unregister(priv->etha.bus); } + /* Turn off GWCA to make sure that there will be no new packets */ + ret = rswitch_gwca_change_mode(priv, GWMC_OPC_DISABLE); + if (ret) + pr_err("Failed to disable GWCA: %d\n", ret); + unmap_physmem(priv->addr, MAP_NOCACHE); unmap_physmem(priv->etha.serdes_addr, MAP_NOCACHE);