All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Markus Mayer <code@mmayer.net>, Florian Fainelli <f.fainelli@gmail.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Brian Norris <computersforpeace@gmail.com>,
	Gregory Fong <gregory.0xf0@gmail.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Power Management List <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jim Quinlan <jim2101024@gmail.com>,
	Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com>,
	Markus Mayer <mmayer@broadcom.com>,
	ARM Kernel List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: prefer SCMI cpufreq if supported
Date: Thu, 19 Apr 2018 11:35:59 +0100	[thread overview]
Message-ID: <0f011724-85fe-d411-b99d-dfd33e206052@arm.com> (raw)
In-Reply-To: <20180418155643.36464-3-code@mmayer.net>



On 18/04/18 16:56, Markus Mayer wrote:
> From: Jim Quinlan <jim2101024@gmail.com>
> 
> If the SCMI cpufreq driver is supported, we bail, so that the new
> approach can be used.
> 
> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>  drivers/cpufreq/brcmstb-avs-cpufreq.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> index b07559b9ed99..b4861a730162 100644
> --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
> +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> @@ -164,6 +164,8 @@
>  #define BRCM_AVS_CPU_INTR	"brcm,avs-cpu-l2-intr"
>  #define BRCM_AVS_HOST_INTR	"sw_intr"
>  
> +#define ARM_SCMI_COMPAT		"arm,scmi"
> +
>  struct pmap {
>  	unsigned int mode;
>  	unsigned int p1;
> @@ -511,6 +513,20 @@ static int brcm_avs_prepare_init(struct platform_device *pdev)
>  	struct device *dev;
>  	int host_irq, ret;
>  

Will this platform have both SCMI and BRCM_AVS_CPU_DATA nodes enabled ?
If so, is it not better to just keep only the preferred node enabled
instead ?

> +	/*
> +	 * If the SCMI cpufreq driver is supported, we bail, so that the more
> +	 * modern approach can be used.
> +	 */
> +	if (IS_ENABLED(CONFIG_ARM_SCMI_PROTOCOL)) {
> +		struct device_node *np;
> +
> +		np = of_find_compatible_node(NULL, NULL, ARM_SCMI_COMPAT);
> +		if (np) {
> +			of_node_put(np);
> +			return -ENXIO;
> +		}
> +	}
> +

Clearly not a good approach.

-- 
Regards,
Sudeep

WARNING: multiple messages have this Message-ID (diff)
From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: prefer SCMI cpufreq if supported
Date: Thu, 19 Apr 2018 11:35:59 +0100	[thread overview]
Message-ID: <0f011724-85fe-d411-b99d-dfd33e206052@arm.com> (raw)
In-Reply-To: <20180418155643.36464-3-code@mmayer.net>



On 18/04/18 16:56, Markus Mayer wrote:
> From: Jim Quinlan <jim2101024@gmail.com>
> 
> If the SCMI cpufreq driver is supported, we bail, so that the new
> approach can be used.
> 
> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>  drivers/cpufreq/brcmstb-avs-cpufreq.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> index b07559b9ed99..b4861a730162 100644
> --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
> +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> @@ -164,6 +164,8 @@
>  #define BRCM_AVS_CPU_INTR	"brcm,avs-cpu-l2-intr"
>  #define BRCM_AVS_HOST_INTR	"sw_intr"
>  
> +#define ARM_SCMI_COMPAT		"arm,scmi"
> +
>  struct pmap {
>  	unsigned int mode;
>  	unsigned int p1;
> @@ -511,6 +513,20 @@ static int brcm_avs_prepare_init(struct platform_device *pdev)
>  	struct device *dev;
>  	int host_irq, ret;
>  

Will this platform have both SCMI and BRCM_AVS_CPU_DATA nodes enabled ?
If so, is it not better to just keep only the preferred node enabled
instead ?

> +	/*
> +	 * If the SCMI cpufreq driver is supported, we bail, so that the more
> +	 * modern approach can be used.
> +	 */
> +	if (IS_ENABLED(CONFIG_ARM_SCMI_PROTOCOL)) {
> +		struct device_node *np;
> +
> +		np = of_find_compatible_node(NULL, NULL, ARM_SCMI_COMPAT);
> +		if (np) {
> +			of_node_put(np);
> +			return -ENXIO;
> +		}
> +	}
> +

Clearly not a good approach.

-- 
Regards,
Sudeep

  parent reply	other threads:[~2018-04-19 10:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 15:56 [PATCH 0/2] brcmstb-avs-cpufreq changes Markus Mayer
2018-04-18 15:56 ` Markus Mayer
2018-04-18 15:56 ` Markus Mayer
2018-04-18 15:56 ` [PATCH 1/2] cpufreq: brcmstb-avs-cpufreq: remove development debug support Markus Mayer
2018-04-18 15:56   ` Markus Mayer
2018-04-19  4:13   ` Viresh Kumar
2018-04-19  4:13     ` Viresh Kumar
2018-04-30  8:26   ` Rafael J. Wysocki
2018-04-30  8:26     ` Rafael J. Wysocki
2018-04-18 15:56 ` [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: prefer SCMI cpufreq if supported Markus Mayer
2018-04-18 15:56   ` Markus Mayer
2018-04-18 15:56   ` Markus Mayer
2018-04-18 16:37   ` Florian Fainelli
2018-04-18 16:37     ` Florian Fainelli
2018-04-19 22:10     ` Markus Mayer
2018-04-19 22:10       ` Markus Mayer
2018-04-19  4:16   ` Viresh Kumar
2018-04-19  4:16     ` Viresh Kumar
2018-04-19 10:37     ` Sudeep Holla
2018-04-19 10:37       ` Sudeep Holla
2018-04-20  4:42       ` Viresh Kumar
2018-04-20  4:42         ` Viresh Kumar
2018-04-20  9:15         ` Sudeep Holla
2018-04-20  9:15           ` Sudeep Holla
2018-04-20  9:35           ` Viresh Kumar
2018-04-20  9:35             ` Viresh Kumar
2018-04-20 16:50             ` Florian Fainelli
2018-04-20 16:50               ` Florian Fainelli
2018-04-23  4:23               ` Viresh Kumar
2018-04-23  4:23                 ` Viresh Kumar
2018-04-19 10:35   ` Sudeep Holla [this message]
2018-04-19 10:35     ` Sudeep Holla
2018-04-19 16:21     ` Florian Fainelli
2018-04-19 16:21       ` Florian Fainelli

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=0f011724-85fe-d411-b99d-dfd33e206052@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=code@mmayer.net \
    --cc=computersforpeace@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.0xf0@gmail.com \
    --cc=jim2101024@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mmayer@broadcom.com \
    --cc=rjw@rjwysocki.net \
    --cc=viresh.kumar@linaro.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.