OSDN Git Service

ravb: add workaround for clock when resuming with WoL enabled
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tue, 1 Aug 2017 10:14:37 +0000 (12:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Aug 2017 00:54:38 +0000 (17:54 -0700)
commitfbf3d034f2ff6264183cfa6845770e8cc2a986c8
treec7efbaf014ad54feebde4329a8581b74518c9681
parent3e3d647715d40173e359c91c69059b9cec7ba6ca
ravb: add workaround for clock when resuming with WoL enabled

The renesas-cpg-mssr clock driver are not yet aware of PSCI sleep where
power is cut to the SoC. When resuming from this state with WoL enabled
the enable count of the ravb clock is 1 and the clock driver thinks the
clock is already on when PM core enables the clock and increments the
enable count to 2. This will result in the ravb driver failing to talk
to the hardware since the module clock is off. Work around this by
forcing the enable count to 0 and then back to 2 when resuming with WoL
enabled.

This workaround should be reverted once the renesas-cpg-mssr clock
driver becomes aware of this PSCI sleep behavior.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/ravb_main.c