lkml.org 
[lkml]   [2021]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 4/9] opp: core: Don't warn if required OPP device does not exist
On 14-10-21, 15:52, Hector Martin wrote:
> The CPU devices aren't attached to their genpd, so the required OPP
> transition fails with the same error.
>
> However, this was easier to fix than I expected. With this patch to
> cpufreq-dt, it all works properly, and I can drop the parent genpd
> from the clock node and related handling. Thoughts?
>
> commit c4f88743374c1f4678ee7f17fb6cae30ded9ed59
> Author: Hector Martin <marcan@marcan.st>
> Date: Thu Oct 14 15:47:45 2021 +0900
>
> cpufreq: dt: Attach CPU devices to power domains
> This allows the required-opps mechanism to work for CPU OPP tables,
> triggering specific OPP levels in a parent power domain.
> Signed-off-by: Hector Martin <marcan@marcan.st>
>
> diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
> index 8fcaba541539..5b22846b557d 100644
> --- a/drivers/cpufreq/cpufreq-dt.c
> +++ b/drivers/cpufreq/cpufreq-dt.c
> @@ -16,6 +16,7 @@
> #include <linux/list.h>
> #include <linux/module.h>
> #include <linux/of.h>
> +#include <linux/pm_domain.h>
> #include <linux/pm_opp.h>
> #include <linux/platform_device.h>
> #include <linux/regulator/consumer.h>
> @@ -264,6 +265,16 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
> goto out;
> }
> + /*
> + * Attach the CPU device to its genpd domain (if any), to allow OPP
> + * dependencies to be satisfied.
> + */
> + ret = genpd_dev_pm_attach(cpu_dev);
> + if (ret <= 0) {
> + dev_err(cpu_dev, "Failed to attach CPU device to genpd\n");
> + goto out;
> + }
> +

Other platform do this from some other place I think.

Ulf, where should this code be moved ? cpu-clk driver ?

--
viresh

\
 
 \ /
  Last update: 2021-10-14 08:57    [W:0.048 / U:2.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site