All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Ulf Hansson <ulf.hansson@linaro.org>, Hector Martin <marcan@marcan.st>
Cc: Sibi Sankar <sibis@codeaurora.org>,
	Saravana Kannan <saravanak@google.com>,
	linux-arm-kernel@lists.infradead.org,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Sven Peter <sven@svenpeter.dev>, Marc Zyngier <maz@kernel.org>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 4/9] opp: core: Don't warn if required OPP device does not exist
Date: Thu, 14 Oct 2021 12:26:36 +0530	[thread overview]
Message-ID: <20211014065636.lkv77aqbugp3qhif@vireshk-i7> (raw)
In-Reply-To: <0db8e994-ac2c-8fad-55d0-1b5a9e2e21f2@marcan.st>

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

WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Ulf Hansson <ulf.hansson@linaro.org>, Hector Martin <marcan@marcan.st>
Cc: Sibi Sankar <sibis@codeaurora.org>,
	Saravana Kannan <saravanak@google.com>,
	linux-arm-kernel@lists.infradead.org,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Sven Peter <sven@svenpeter.dev>, Marc Zyngier <maz@kernel.org>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 4/9] opp: core: Don't warn if required OPP device does not exist
Date: Thu, 14 Oct 2021 12:26:36 +0530	[thread overview]
Message-ID: <20211014065636.lkv77aqbugp3qhif@vireshk-i7> (raw)
In-Reply-To: <0db8e994-ac2c-8fad-55d0-1b5a9e2e21f2@marcan.st>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-10-14  6:56 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 16:56 [RFC PATCH 0/9] Apple SoC CPU P-state switching Hector Martin
2021-10-11 16:56 ` Hector Martin
2021-10-11 16:56 ` [RFC PATCH 1/9] MAINTAINERS: apple: Add apple-mcc and clk-apple-cluster paths Hector Martin
2021-10-11 16:56   ` Hector Martin
2021-10-11 16:57 ` [RFC PATCH 2/9] dt-bindings: memory-controller: Add apple,mcc binding Hector Martin
2021-10-11 16:57   ` [RFC PATCH 2/9] dt-bindings: memory-controller: Add apple, mcc binding Hector Martin
2021-10-12  8:48   ` [RFC PATCH 2/9] dt-bindings: memory-controller: Add apple,mcc binding Krzysztof Kozlowski
2021-10-12  8:48     ` Krzysztof Kozlowski
2021-10-19 22:43     ` Rob Herring
2021-10-19 22:43       ` Rob Herring
2021-10-11 16:57 ` [RFC PATCH 3/9] dt-bindings: clock: Add apple,cluster-clk binding Hector Martin
2021-10-11 16:57   ` Hector Martin
2021-10-12  8:51   ` Krzysztof Kozlowski
2021-10-12  8:51     ` [RFC PATCH 3/9] dt-bindings: clock: Add apple, cluster-clk binding Krzysztof Kozlowski
2021-10-12  9:35     ` [RFC PATCH 3/9] dt-bindings: clock: Add apple,cluster-clk binding Viresh Kumar
2021-10-12  9:35       ` [RFC PATCH 3/9] dt-bindings: clock: Add apple, cluster-clk binding Viresh Kumar
     [not found]       ` <D0DE08FE-562E-4A48-BCA0-9094DAFCA564@marcan.st>
     [not found]         ` <20211012094302.3cownyzr4phxwifs@vireshk-i7>
     [not found]           ` <64584F8C-D49F-41B5-9658-CF8A25186E67@marcan.st>
     [not found]             ` <20211012095735.mhh2lzu52ohtotl6@vireshk-i7>
2021-10-12 13:48               ` [RFC PATCH 3/9] dt-bindings: clock: Add apple,cluster-clk binding Hector Martin
2021-10-12 13:48                 ` [RFC PATCH 3/9] dt-bindings: clock: Add apple, cluster-clk binding Hector Martin
2021-10-14 21:47   ` Stephen Boyd
2021-10-11 16:57 ` [RFC PATCH 4/9] opp: core: Don't warn if required OPP device does not exist Hector Martin
2021-10-11 16:57   ` Hector Martin
2021-10-12  3:21   ` Viresh Kumar
2021-10-12  3:21     ` Viresh Kumar
2021-10-12  5:34     ` Hector Martin
2021-10-12  5:34       ` Hector Martin
2021-10-12  5:51       ` Viresh Kumar
2021-10-12  5:51         ` Viresh Kumar
2021-10-12  5:57         ` Hector Martin
2021-10-12  5:57           ` Hector Martin
2021-10-12  9:26           ` Viresh Kumar
2021-10-12  9:26             ` Viresh Kumar
2021-10-12  9:31             ` Hector Martin "marcan"
2021-10-12  9:31               ` Hector Martin "marcan"
2021-10-12  9:32               ` Viresh Kumar
2021-10-12  9:32                 ` Viresh Kumar
2021-10-14  6:52                 ` Hector Martin
2021-10-14  6:52                   ` Hector Martin
2021-10-14  6:56                   ` Viresh Kumar [this message]
2021-10-14  6:56                     ` Viresh Kumar
2021-10-14  7:03                     ` Hector Martin
2021-10-14  7:03                       ` Hector Martin
2021-10-14  7:22                       ` Viresh Kumar
2021-10-14  7:22                         ` Viresh Kumar
2021-10-14  7:23                       ` Hector Martin
2021-10-14  7:23                         ` Hector Martin
2021-10-14 11:08                         ` Ulf Hansson
2021-10-14 11:08                           ` Ulf Hansson
2021-10-14  9:55           ` Ulf Hansson
2021-10-14  9:55             ` Ulf Hansson
2021-10-14 11:43             ` Hector Martin
2021-10-14 11:43               ` Hector Martin
2021-10-14 12:55               ` Ulf Hansson
2021-10-14 12:55                 ` Ulf Hansson
2021-10-14 17:02                 ` Hector Martin
2021-10-14 17:02                   ` Hector Martin
2021-10-15 11:26                   ` Ulf Hansson
2021-10-15 11:26                     ` Ulf Hansson
2021-10-11 16:57 ` [RFC PATCH 5/9] PM: domains: Add of_genpd_add_provider_simple_noclk() Hector Martin
2021-10-11 16:57   ` Hector Martin
2021-10-11 16:57 ` [RFC PATCH 6/9] memory: apple: Add apple-mcc driver to manage MCC perf in Apple SoCs Hector Martin
2021-10-11 16:57   ` Hector Martin
2021-10-12  7:24   ` kernel test robot
2021-10-12  9:19   ` Krzysztof Kozlowski
2021-10-12  9:19     ` Krzysztof Kozlowski
2021-10-14  6:59     ` Hector Martin
2021-10-14  6:59       ` Hector Martin
2021-10-14  7:36       ` Krzysztof Kozlowski
2021-10-14  7:36         ` Krzysztof Kozlowski
2021-10-14  7:52         ` Hector Martin
2021-10-14  7:52           ` Hector Martin
2021-10-14  8:04           ` Krzysztof Kozlowski
2021-10-14  8:04             ` Krzysztof Kozlowski
2021-10-14  8:31             ` Hector Martin
2021-10-14  8:31               ` Hector Martin
2021-10-11 16:57 ` [RFC PATCH 7/9] clk: apple: Add clk-apple-cluster driver to manage CPU p-states Hector Martin
2021-10-11 16:57   ` Hector Martin
2021-10-13  3:45   ` kernel test robot
2021-10-14 22:07   ` Stephen Boyd
2021-10-17  9:16     ` Hector Martin
2021-10-17  9:16       ` Hector Martin
2021-10-11 16:57 ` [RFC PATCH 8/9] arm64: apple: Select MEMORY and APPLE_MCC Hector Martin
2021-10-11 16:57   ` Hector Martin
2021-10-11 16:57 ` [RFC PATCH 9/9] arm64: apple: Add CPU frequency scaling support for t8103 Hector Martin
2021-10-11 16:57   ` Hector Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211014065636.lkv77aqbugp3qhif@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=alyssa@rosenzweig.io \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@kernel.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=mark.kettenis@xs4all.nl \
    --cc=maz@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=saravanak@google.com \
    --cc=sboyd@kernel.org \
    --cc=sibis@codeaurora.org \
    --cc=sven@svenpeter.dev \
    --cc=ulf.hansson@linaro.org \
    --cc=vireshk@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.