linux_dsm_epyc7002/drivers/clk/renesas
Geert Uytterhoeven 560869100b clk: renesas: cpg-mssr: Restore module clocks during resume
During PSCI system suspend, R-Car Gen3 SoCs are powered down, and their
clock register state is lost.  Note that as the boot loader skips most
initialization after system resume, clock register state differs from
the state encountered during normal system boot, too.

Hence after s2ram, some operations may fail because module clocks are
disabled, while drivers expect them to be still enabled.  E.g. EtherAVB
fails when Wake-on-LAN has been enabled using "ethtool -s eth0 wol g":

    ravb e6800000.ethernet eth0: failed to switch device to config mode
    ravb e6800000.ethernet eth0: device will be stopped after h/w processes are done.
    ravb e6800000.ethernet eth0: failed to switch device to config
    PM: Device e6800000.ethernet failed to resume: error -110

In addition, some module clocks that were disabled by
clk_disable_unused() may have been re-enabled, wasting power.

To fix this, restore all bits of the SMSTPCR registers that represent
clocks under control of Linux.

Notes:
  - While this fixes EtherAVB operation after resume from s2ram,
    EtherAVB cannot be used as an actual wake-up source from s2ram, only
    from s2idle, due to PSCI limitations,
  - To avoid overhead on platforms not needing it, the suspend/resume
    code has a build time dependency on sleep and PSCI support, and a
    runtime dependency on PSCI.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
2017-10-20 11:15:29 +02:00
..
clk-div6.c clk: renesas: div6: Document fields used for parent selection 2017-07-17 10:26:48 +02:00
clk-div6.h clk: renesas: div6: use RENESAS for #define 2016-03-15 18:13:02 -07:00
clk-emev2.c
clk-mstp.c clk: renesas: mstp: Delete error messages for failed memory allocations 2017-09-28 17:57:34 +02:00
clk-r8a73a4.c clk: renesas: Rename header file renesas.h 2016-03-15 18:12:14 -07:00
clk-r8a7740.c clk: renesas: Rename header file renesas.h 2016-03-15 18:12:14 -07:00
clk-r8a7778.c clk: renesas: r8a7778: Remove obsolete r8a7778_clocks_init() 2016-11-02 20:44:14 +01:00
clk-r8a7779.c clk: renesas: r8a7779: Remove obsolete r8a7779_clocks_init() 2016-11-02 20:44:17 +01:00
clk-rcar-gen2.c clk: renesas: rcar-gen2: Delete error message for failed memory allocation 2017-09-28 17:57:34 +02:00
clk-rz.c clk: renesas: rz: clk-rz is meant for RZ/A1 2017-10-20 10:59:54 +02:00
clk-sh73a0.c clk: renesas: Rename header file renesas.h 2016-03-15 18:12:14 -07:00
Kconfig clk: renesas: cpg-mssr: Add R8A77970 support 2017-09-19 10:57:35 +02:00
Makefile clk: renesas: cpg-mssr: Add R8A77970 support 2017-09-19 10:57:35 +02:00
r8a7743-cpg-mssr.c clk: renesas: cpg-mssr: Add R8A7743 support 2016-11-10 15:29:28 +01:00
r8a7745-cpg-mssr.c clk: renesas: cpg-mssr: Add du1 clock to R8A7745 2017-10-20 11:00:02 +02:00
r8a7790-cpg-mssr.c clk: renesas: r8a7790: Add new CPG/MSSR driver 2017-05-24 10:19:56 +02:00
r8a7791-cpg-mssr.c clk: renesas: r8a7791/r8a7793: Add new CPG/MSSR driver 2017-05-24 10:19:59 +02:00
r8a7792-cpg-mssr.c clk: renesas: r8a7792: Add IMR-LX3/LSX3 clocks 2017-07-17 10:26:48 +02:00
r8a7794-cpg-mssr.c clk: renesas: r8a7794: Add new CPG/MSSR driver 2017-05-24 10:20:03 +02:00
r8a7795-cpg-mssr.c clk: renesas: r8a7795: Correct parent clock of INTC-AP 2017-10-16 09:38:38 +02:00
r8a7796-cpg-mssr.c clk: renesas: r8a7796: Correct parent clock of INTC-AP 2017-10-16 09:38:38 +02:00
r8a77970-cpg-mssr.c clk: renesas: cpg-mssr: Add R8A77970 support 2017-09-19 10:57:35 +02:00
r8a77995-cpg-mssr.c clk: renesas: r8a77995: Correct parent clock of INTC-AP 2017-10-16 09:38:39 +02:00
rcar-gen2-cpg.c clk: renesas: cpg-mssr: Add common R-Car Gen2 support 2016-11-10 15:29:25 +01:00
rcar-gen2-cpg.h clk: renesas: cpg-mssr: Add common R-Car Gen2 support 2016-11-10 15:29:25 +01:00
rcar-gen3-cpg.c clk: renesas: rcar-gen3: Add support for SCCG/Clean peripheral clocks 2017-08-16 09:51:47 +02:00
rcar-gen3-cpg.h clk: renesas: rcar-gen3: Add support for SCCG/Clean peripheral clocks 2017-08-16 09:51:47 +02:00
rcar-usb2-clock-sel.c clk: renesas: rcar-usb2-clock-sel: Add R-Car USB 2.0 clock selector PHY 2017-08-17 09:22:23 +02:00
renesas-cpg-mssr.c clk: renesas: cpg-mssr: Restore module clocks during resume 2017-10-20 11:15:29 +02:00
renesas-cpg-mssr.h clk: renesas: cpg-mssr: Add R8A77970 support 2017-09-19 10:57:35 +02:00