aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorUlf Hansson <[email protected]>2024-05-27 16:25:51 +0200
committerUlf Hansson <[email protected]>2024-08-05 13:12:04 +0200
commitd7bdb8e6aabe218fd980768a1486434e42761539 (patch)
treea04ca728f0b95fa0a8e12fa92aacabebdf2e0cef /include/linux
parent328fc9b29810819c4496c6e9fd74491ca458045e (diff)
pmdomain: core: Enable s2idle for CPU PM domains on PREEMPT_RT
To allow a genpd provider for a CPU PM domain to enter a domain-idle-state during s2idle on a PREEMPT_RT based configuration, we can't use the regular spinlock, as they are turned into sleepable locks on PREEMPT_RT. To address this problem, let's convert into using the raw spinlock, but only for genpd providers that have the GENPD_FLAG_CPU_DOMAIN bit set. In this way, the lock can still be acquired/released in atomic context, which is needed in the idle-path for PREEMPT_RT. Do note that the genpd power-on/off notifiers may also be fired during s2idle, but these are already prepared for PREEMPT_RT as they are based on the raw notifiers. However, consumers of them may need to adopt accordingly to work properly on PREEMPT_RT. Signed-off-by: Ulf Hansson <[email protected]> Tested-by: Raghavendra Kakarla <[email protected]> # qcm6490 with PREEMPT_RT set Acked-by: Sebastian Andrzej Siewior <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pm_domain.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 858c8e7851fb..b86bb52858ac 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -198,8 +198,11 @@ struct generic_pm_domain {
spinlock_t slock;
unsigned long lock_flags;
};
+ struct {
+ raw_spinlock_t raw_slock;
+ unsigned long raw_lock_flags;
+ };
};
-
};
static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)