From b34677b0999a7c0de45e57b780508c14cb438ed8 Mon Sep 17 00:00:00 2001 From: Lokesh Vutla Date: Mon, 16 Mar 2020 16:44:53 +0530 Subject: 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 Signed-off-by: Lokesh Vutla [tony@atomide.com: removed pm_runtime calls from cpuidle calls] Signed-off-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200316111453.15441-1-lokeshvutla@ti.com --- include/clocksource/timer-ti-dm.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/clocksource') diff --git a/include/clocksource/timer-ti-dm.h b/include/clocksource/timer-ti-dm.h index eef5de300731..25f05235866e 100644 --- a/include/clocksource/timer-ti-dm.h +++ b/include/clocksource/timer-ti-dm.h @@ -110,13 +110,12 @@ struct omap_dm_timer { unsigned reserved:1; unsigned posted:1; struct timer_regs context; - int (*get_context_loss_count)(struct device *); - int ctx_loss_count; int revision; u32 capability; u32 errata; struct platform_device *pdev; struct list_head node; + struct notifier_block nb; }; int omap_dm_timer_reserve_systimer(int id); -- cgit v1.2.3