Merge 4a39ac5b7d ("Merge tag 'random-6.12-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random") into android-mainline
Steps on the way to 6.12-rc1 Bug: 367265496 Change-Id: I115d487c6294c249dd30b708b3164f34be34d874 Signed-off-by: Matthias Maennich <maennich@google.com>
This commit is contained in:
@@ -67,12 +67,16 @@ static int psci_pd_init(struct device_node *np, bool use_osi)
|
||||
|
||||
/*
|
||||
* Allow power off when OSI has been successfully enabled.
|
||||
* PREEMPT_RT is not yet ready to enter domain idle states.
|
||||
* On a PREEMPT_RT based configuration the domain idle states are
|
||||
* supported, but only during system-wide suspend.
|
||||
*/
|
||||
if (use_osi && !IS_ENABLED(CONFIG_PREEMPT_RT))
|
||||
if (use_osi) {
|
||||
pd->power_off = psci_pd_power_off;
|
||||
else
|
||||
if (IS_ENABLED(CONFIG_PREEMPT_RT))
|
||||
pd->flags |= GENPD_FLAG_RPM_ALWAYS_ON;
|
||||
} else {
|
||||
pd->flags |= GENPD_FLAG_ALWAYS_ON;
|
||||
}
|
||||
|
||||
/* Use governor for CPU PM domains if it has some states to manage. */
|
||||
pd_gov = pd->states ? &pm_domain_cpu_gov : NULL;
|
||||
@@ -138,7 +142,6 @@ static const struct of_device_id psci_of_match[] = {
|
||||
static int psci_cpuidle_domain_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct device_node *node;
|
||||
bool use_osi = psci_has_osi_support();
|
||||
int ret = 0, pd_count = 0;
|
||||
|
||||
@@ -149,15 +152,13 @@ static int psci_cpuidle_domain_probe(struct platform_device *pdev)
|
||||
* Parse child nodes for the "#power-domain-cells" property and
|
||||
* initialize a genpd/genpd-of-provider pair when it's found.
|
||||
*/
|
||||
for_each_child_of_node(np, node) {
|
||||
for_each_child_of_node_scoped(np, node) {
|
||||
if (!of_property_present(node, "#power-domain-cells"))
|
||||
continue;
|
||||
|
||||
ret = psci_pd_init(node, use_osi);
|
||||
if (ret) {
|
||||
of_node_put(node);
|
||||
if (ret)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pd_count++;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ struct psci_cpuidle_data {
|
||||
|
||||
static DEFINE_PER_CPU_READ_MOSTLY(struct psci_cpuidle_data, psci_cpuidle_data);
|
||||
static DEFINE_PER_CPU(u32, domain_state);
|
||||
static bool psci_cpuidle_use_syscore;
|
||||
static bool psci_cpuidle_use_cpuhp;
|
||||
|
||||
void psci_set_domain_state(u32 state)
|
||||
@@ -171,6 +172,12 @@ static struct syscore_ops psci_idle_syscore_ops = {
|
||||
.resume = psci_idle_syscore_resume,
|
||||
};
|
||||
|
||||
static void psci_idle_init_syscore(void)
|
||||
{
|
||||
if (psci_cpuidle_use_syscore)
|
||||
register_syscore_ops(&psci_idle_syscore_ops);
|
||||
}
|
||||
|
||||
static void psci_idle_init_cpuhp(void)
|
||||
{
|
||||
int err;
|
||||
@@ -178,8 +185,6 @@ static void psci_idle_init_cpuhp(void)
|
||||
if (!psci_cpuidle_use_cpuhp)
|
||||
return;
|
||||
|
||||
register_syscore_ops(&psci_idle_syscore_ops);
|
||||
|
||||
err = cpuhp_setup_state_nocalls(CPUHP_AP_CPU_PM_STARTING,
|
||||
"cpuidle/psci:online",
|
||||
psci_idle_cpuhp_up,
|
||||
@@ -227,22 +232,23 @@ static int psci_dt_cpu_init_topology(struct cpuidle_driver *drv,
|
||||
if (!psci_has_osi_support())
|
||||
return 0;
|
||||
|
||||
if (IS_ENABLED(CONFIG_PREEMPT_RT))
|
||||
return 0;
|
||||
|
||||
data->dev = dt_idle_attach_cpu(cpu, "psci");
|
||||
if (IS_ERR_OR_NULL(data->dev))
|
||||
return PTR_ERR_OR_ZERO(data->dev);
|
||||
|
||||
psci_cpuidle_use_syscore = true;
|
||||
|
||||
/*
|
||||
* Using the deepest state for the CPU to trigger a potential selection
|
||||
* of a shared state for the domain, assumes the domain states are all
|
||||
* deeper states.
|
||||
* deeper states. On PREEMPT_RT the hierarchical topology is limited to
|
||||
* s2ram and s2idle.
|
||||
*/
|
||||
drv->states[state_count - 1].flags |= CPUIDLE_FLAG_RCU_IDLE;
|
||||
drv->states[state_count - 1].enter = psci_enter_domain_idle_state;
|
||||
drv->states[state_count - 1].enter_s2idle = psci_enter_s2idle_domain_idle_state;
|
||||
psci_cpuidle_use_cpuhp = true;
|
||||
if (!IS_ENABLED(CONFIG_PREEMPT_RT)) {
|
||||
drv->states[state_count - 1].enter = psci_enter_domain_idle_state;
|
||||
psci_cpuidle_use_cpuhp = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -318,6 +324,7 @@ static void psci_cpu_deinit_idle(int cpu)
|
||||
struct psci_cpuidle_data *data = per_cpu_ptr(&psci_cpuidle_data, cpu);
|
||||
|
||||
dt_idle_detach_cpu(data->dev);
|
||||
psci_cpuidle_use_syscore = false;
|
||||
psci_cpuidle_use_cpuhp = false;
|
||||
}
|
||||
|
||||
@@ -414,6 +421,7 @@ static int psci_cpuidle_probe(struct platform_device *pdev)
|
||||
goto out_fail;
|
||||
}
|
||||
|
||||
psci_idle_init_syscore();
|
||||
psci_idle_init_cpuhp();
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -130,11 +130,10 @@ out:
|
||||
|
||||
int dt_idle_pd_init_topology(struct device_node *np)
|
||||
{
|
||||
struct device_node *node;
|
||||
struct of_phandle_args child, parent;
|
||||
int ret;
|
||||
|
||||
for_each_child_of_node(np, node) {
|
||||
for_each_child_of_node_scoped(np, node) {
|
||||
if (of_parse_phandle_with_args(node, "power-domains",
|
||||
"#power-domain-cells", 0, &parent))
|
||||
continue;
|
||||
@@ -143,10 +142,8 @@ int dt_idle_pd_init_topology(struct device_node *np)
|
||||
child.args_count = 0;
|
||||
ret = of_genpd_add_subdomain(&parent, &child);
|
||||
of_node_put(parent.np);
|
||||
if (ret) {
|
||||
of_node_put(node);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -154,11 +151,10 @@ int dt_idle_pd_init_topology(struct device_node *np)
|
||||
|
||||
int dt_idle_pd_remove_topology(struct device_node *np)
|
||||
{
|
||||
struct device_node *node;
|
||||
struct of_phandle_args child, parent;
|
||||
int ret;
|
||||
|
||||
for_each_child_of_node(np, node) {
|
||||
for_each_child_of_node_scoped(np, node) {
|
||||
if (of_parse_phandle_with_args(node, "power-domains",
|
||||
"#power-domain-cells", 0, &parent))
|
||||
continue;
|
||||
@@ -167,10 +163,8 @@ int dt_idle_pd_remove_topology(struct device_node *np)
|
||||
child.args_count = 0;
|
||||
ret = of_genpd_remove_subdomain(&parent, &child);
|
||||
of_node_put(parent.np);
|
||||
if (ret) {
|
||||
of_node_put(node);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user