Skip to content

PM: Suspend/resume and runtime PM for clock sources/clock event devices in PM domains

Rafael J. Wysocki linux-sh lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15PM / Domains: Introduce simplified power on routine for system resumedrivers/base/power/domain.c+30 -40 replies
2/15PM / Domains: Add power off/on function for system core suspend stagedrivers/base/power/domain.c include/linux/pm_domain.h kernel/power/Kconfig+71 -60 replies
3/15timekeeping: Add suspend and resume of clock event devicesinclude/linux/clockchips.h kernel/time/clockevents.c kernel/time/timekeeping.c+31 -00 replies
4/15sh: TMU: Introduce clocksource/clock events suspend/resume routinesdrivers/clocksource/sh_tmu.c+50 -40 replies
5/15sh: CMT: Introduce clocksource/clock events suspend/resume routinesdrivers/clocksource/sh_cmt.c+31 -40 replies
6/15sh: MTU2: Introduce clock events suspend/resume routinesdrivers/clocksource/sh_mtu2.c+18 -20 replies
7/15PM: Reorganize device PM initializationdrivers/base/power/main.c drivers/base/power/power.h+17 -120 replies
8/15PM / Runtime: Allow helpers to be called by early platform driversdrivers/base/platform.c drivers/base/power/power.h include/linux/pm.h+19 -20 replies
9/15PM / Domains: Rename the always_on device flag to syscoredrivers/base/power/domain.c drivers/clocksource/sh_cmt.c drivers/clocksource/sh_mtu2.c +2 more+18 -180 replies
10/15PM / Domains: Move syscore flag from subsys data to struct devicedrivers/base/power/common.c drivers/base/power/domain.c drivers/base/power/main.c +6 more+58 -380 replies
11/15PM / Domains: Do not measure start time for "irq safe" devicesdrivers/base/power/domain.c+7 -10 replies
12/15sh: TMU: Basic runtime PM supportdrivers/clocksource/sh_tmu.c+65 -150 replies
13/15sh: CMT: Basic runtime PM supportdrivers/clocksource/sh_cmt.c+36 -80 replies
14/15sh: MTU2: Basic runtime PM supportdrivers/clocksource/sh_mtu2.c+22 -62 replies
15/15PM: Do not use the syscore flag for runtime PMdrivers/base/power/common.c drivers/base/power/domain.c drivers/base/power/runtime.c +2 more+10 -220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/15] PM: Suspend/resume and runtime PM for clock sources/clock event devices in PM domains

Hi all,

Quoted 25 lines · Rafael J. Wysocki

There is a problem with clock sources and clock event devices belonging to PM domains that they have to be marked as "always on", to prevent those domains from being turned off unexpectedly, which also prevents the domains from being turned off during system suspend, although that might be done and would be desirable.

The following patch series introduces a mechanism by which the generic PM domains framework can be notified that a given domain may be turned off after timekeeping has been suspended, which allows the domains that contain clock sources and clock event devices to be turned off before the system enters the target sleep state (so that less power is used in that state).

[1/6] Introduce simplified power on routine for PM domains (to be used during
system resume from suspend/hibernation and during "syscore" resume).
[2/6] Introduce function for notifying the generic PM domains framework that
the given device may be treated as suspended (so its domain may be turned off if this has been the last active device in it).
[3/6] Introduce suspend/resume callbacks for clock event devices. [4/6] Make the SH TMU driver use suspend/resume callbacks for clock sources
and clock event devices to notify the generic PM domains framework that those devices may be regarded as suspended (during system suspend) or that they have to be turned on immediately (during system resume).
[5/6] Like [4/6] but for the SH CMT driver.
[6/6] Analogous to [4/6], but for the SH MTU2 driver.

Quoted 1 line

The patchset has been tested on the SH7372 Mackerel board.

There were no comments, so I think I can go a bit further and add runtime PM support to those drivers too. :-)

This requires some core changes, but they aren't too invasive in my opinion.

Patches [1-6/15] are more-or-less the same as before modulo some fixes for bugs found during more thorough testing. The remaining patches make the following changes:

[7/15] - Clean up device PM initialization.
[8/15] - Allow early platform device drivers to use runtime PM helper functions. [9/15] - Rename the "always_on" device flag to "syscore".
[10/15] - Move the "syscore" flag to the core (from PM domains framework). [11/15] - Rework the "starting" of devices flagged as "irq safe" in PM domains. [12/15] - Add runtime PM support to the SH TMU driver.
[13/15] - Add runtime PM support to the SH CMT driver.
[14/15] - Add runtime PM support to the SH MTU2 driver.
[15/15] - Stop using the "syscore" device flag for runtime PM.

Thanks,
Rafael