Skip to content

Commit

Permalink
Revert "ravb: add workaround for clock when resuming with WoL enabled"
Browse files Browse the repository at this point in the history
This reverts commit fbf3d03.

As of commit 5608691 ("clk: renesas: cpg-mssr: Restore module
clocks during resume"), the workaround is no longer needed.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Niklas Söderlund <[email protected]>
Acked-by: Sergei Shtylyov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
geertu authored and davem330 committed Dec 13, 2017
1 parent 30791ac commit 6b782f4
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions drivers/net/ethernet/renesas/ravb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2308,32 +2308,9 @@ static int __maybe_unused ravb_resume(struct device *dev)
struct ravb_private *priv = netdev_priv(ndev);
int ret = 0;

if (priv->wol_enabled) {
/* Reduce the usecount of the clock to zero and then
* restore it to its original value. This is done to force
* the clock to be re-enabled which is a workaround
* for renesas-cpg-mssr driver which do not enable clocks
* when resuming from PSCI suspend/resume.
*
* Without this workaround the driver fails to communicate
* with the hardware if WoL was enabled when the system
* entered PSCI suspend. This is due to that if WoL is enabled
* we explicitly keep the clock from being turned off when
* suspending, but in PSCI sleep power is cut so the clock
* is disabled anyhow, the clock driver is not aware of this
* so the clock is not turned back on when resuming.
*
* TODO: once the renesas-cpg-mssr suspend/resume is working
* this clock dance should be removed.
*/
clk_disable(priv->clk);
clk_disable(priv->clk);
clk_enable(priv->clk);
clk_enable(priv->clk);

/* Set reset mode to rearm the WoL logic */
/* If WoL is enabled set reset mode to rearm the WoL logic */
if (priv->wol_enabled)
ravb_write(ndev, CCC_OPC_RESET, CCC);
}

/* All register have been reset to default values.
* Restore all registers which where setup at probe time and
Expand Down

0 comments on commit 6b782f4

Please sign in to comment.