Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: rswtich: disable GWCA when removing driver #9

Open
wants to merge 1 commit into
base: v2020.10/rcar-5.1.1.rc7
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions drivers/net/rswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down