]> git.baikalelectronics.ru Git - kernel.git/commit
clocksource/drivers/timer-ti-dm: Implement cpu_pm notifier for context save and restore
authorLokesh Vutla <lokeshvutla@ti.com>
Mon, 16 Mar 2020 11:14:53 +0000 (16:44 +0530)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 16 Mar 2020 11:40:29 +0000 (12:40 +0100)
commit3feab2351587e0bd0ee07604655283816604772b
treed2738b1ba9e62adb1f07a58f9b264e9f8b0fa11a
parent9b38084f8c81cbf0d60952bf5f034344624e11e6
clocksource/drivers/timer-ti-dm: Implement cpu_pm notifier for context save and restore

omap_dm_timer_enable() restores the entire context(including counter)
based on 2 conditions:
- If get_context_loss_count is populated and context is lost.
- If get_context_loss_count is not populated update unconditionally.

Case2 has a side effect of updating the counter register even though
context is not lost. When timer is configured in pwm mode, this is
causing undesired behaviour in the pwm period.

Instead of using get_context_loss_count call back, implement cpu_pm
notifier with context save and restore support. And delete the
get_context_loss_count callback all together.

Suggested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[tony@atomide.com: removed pm_runtime calls from cpuidle calls]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200316111453.15441-1-lokeshvutla@ti.com
drivers/clocksource/timer-ti-dm.c
include/clocksource/timer-ti-dm.h