cpuidle: psci: Move the per CPU variable domain_state to a struct
To prepare to extend the per CPU variable domain_state to include more data, let's move it into a struct. A subsequent change will add the new data. This change have no intended functional impact. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20250314100103.1294715-3-ulf.hansson@linaro.orgpull/1250/head
parent
9861f21ff1
commit
3290e9f98a
|
|
@ -36,19 +36,28 @@ struct psci_cpuidle_data {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct psci_cpuidle_domain_state {
|
||||||
|
u32 state;
|
||||||
|
};
|
||||||
|
|
||||||
static DEFINE_PER_CPU_READ_MOSTLY(struct psci_cpuidle_data, psci_cpuidle_data);
|
static DEFINE_PER_CPU_READ_MOSTLY(struct psci_cpuidle_data, psci_cpuidle_data);
|
||||||
static DEFINE_PER_CPU(u32, domain_state);
|
static DEFINE_PER_CPU(struct psci_cpuidle_domain_state, psci_domain_state);
|
||||||
static bool psci_cpuidle_use_syscore;
|
static bool psci_cpuidle_use_syscore;
|
||||||
static bool psci_cpuidle_use_cpuhp;
|
static bool psci_cpuidle_use_cpuhp;
|
||||||
|
|
||||||
void psci_set_domain_state(u32 state)
|
void psci_set_domain_state(u32 state)
|
||||||
{
|
{
|
||||||
__this_cpu_write(domain_state, state);
|
__this_cpu_write(psci_domain_state.state, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u32 psci_get_domain_state(void)
|
static inline u32 psci_get_domain_state(void)
|
||||||
{
|
{
|
||||||
return __this_cpu_read(domain_state);
|
return __this_cpu_read(psci_domain_state.state);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void psci_clear_domain_state(void)
|
||||||
|
{
|
||||||
|
__this_cpu_write(psci_domain_state.state, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __cpuidle int __psci_enter_domain_idle_state(struct cpuidle_device *dev,
|
static __cpuidle int __psci_enter_domain_idle_state(struct cpuidle_device *dev,
|
||||||
|
|
@ -87,7 +96,7 @@ static __cpuidle int __psci_enter_domain_idle_state(struct cpuidle_device *dev,
|
||||||
cpu_pm_exit();
|
cpu_pm_exit();
|
||||||
|
|
||||||
/* Clear the domain state to start fresh when back from idle. */
|
/* Clear the domain state to start fresh when back from idle. */
|
||||||
psci_set_domain_state(0);
|
psci_clear_domain_state();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,7 +130,7 @@ static int psci_idle_cpuhp_down(unsigned int cpu)
|
||||||
if (pd_dev) {
|
if (pd_dev) {
|
||||||
pm_runtime_put_sync(pd_dev);
|
pm_runtime_put_sync(pd_dev);
|
||||||
/* Clear domain state to start fresh at next online. */
|
/* Clear domain state to start fresh at next online. */
|
||||||
psci_set_domain_state(0);
|
psci_clear_domain_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -147,7 +156,7 @@ static void psci_idle_syscore_switch(bool suspend)
|
||||||
|
|
||||||
/* Clear domain state to re-start fresh. */
|
/* Clear domain state to re-start fresh. */
|
||||||
if (!cleared) {
|
if (!cleared) {
|
||||||
psci_set_domain_state(0);
|
psci_clear_domain_state();
|
||||||
cleared = true;
|
cleared = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue