Commit 2b566873 authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Jakub Kicinski

net: ethernet: ti: cpsw: fix cpts irq after suspend

Depending on the SoC/platform the CPSW can completely lose context after a
suspend/resume cycle, including CPSW wrapper (WR) which will cause reset of
WR_C0_MISC_EN register, so CPTS IRQ will became disabled.

Fix it by moving CPTS IRQ enabling in cpsw_ndo_open() where CPTS is
actually started.

Fixes: 84ea9c0a ("net: ethernet: ti: cpsw: enable cpts irq")
Reported-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20201112111546.20343-1-grygorii.strashko@ti.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1395f8df
...@@ -838,9 +838,12 @@ static int cpsw_ndo_open(struct net_device *ndev) ...@@ -838,9 +838,12 @@ static int cpsw_ndo_open(struct net_device *ndev)
if (ret < 0) if (ret < 0)
goto err_cleanup; goto err_cleanup;
if (cpts_register(cpsw->cpts)) if (cpsw->cpts) {
dev_err(priv->dev, "error registering cpts device\n"); if (cpts_register(cpsw->cpts))
dev_err(priv->dev, "error registering cpts device\n");
else
writel(0x10, &cpsw->wr_regs->misc_en);
}
} }
cpsw_restore(priv); cpsw_restore(priv);
...@@ -1716,7 +1719,6 @@ static int cpsw_probe(struct platform_device *pdev) ...@@ -1716,7 +1719,6 @@ static int cpsw_probe(struct platform_device *pdev)
/* Enable misc CPTS evnt_pend IRQ */ /* Enable misc CPTS evnt_pend IRQ */
cpts_set_irqpoll(cpsw->cpts, false); cpts_set_irqpoll(cpsw->cpts, false);
writel(0x10, &cpsw->wr_regs->misc_en);
skip_cpts: skip_cpts:
cpsw_notice(priv, probe, cpsw_notice(priv, probe,
......
...@@ -873,8 +873,12 @@ static int cpsw_ndo_open(struct net_device *ndev) ...@@ -873,8 +873,12 @@ static int cpsw_ndo_open(struct net_device *ndev)
if (ret < 0) if (ret < 0)
goto err_cleanup; goto err_cleanup;
if (cpts_register(cpsw->cpts)) if (cpsw->cpts) {
dev_err(priv->dev, "error registering cpts device\n"); if (cpts_register(cpsw->cpts))
dev_err(priv->dev, "error registering cpts device\n");
else
writel(0x10, &cpsw->wr_regs->misc_en);
}
napi_enable(&cpsw->napi_rx); napi_enable(&cpsw->napi_rx);
napi_enable(&cpsw->napi_tx); napi_enable(&cpsw->napi_tx);
...@@ -2006,7 +2010,6 @@ static int cpsw_probe(struct platform_device *pdev) ...@@ -2006,7 +2010,6 @@ static int cpsw_probe(struct platform_device *pdev)
/* Enable misc CPTS evnt_pend IRQ */ /* Enable misc CPTS evnt_pend IRQ */
cpts_set_irqpoll(cpsw->cpts, false); cpts_set_irqpoll(cpsw->cpts, false);
writel(0x10, &cpsw->wr_regs->misc_en);
skip_cpts: skip_cpts:
ret = cpsw_register_notifiers(cpsw); ret = cpsw_register_notifiers(cpsw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment