mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dhruva Gole <d-gole@ti.com>
To: Jacky Bai <ping.bai@nxp.com>
Cc: <lpieralisi@kernel.org>, <sudeep.holla@arm.com>,
	<rafael@kernel.org>, <daniel.lezcano@linaro.org>,
	<james.morse@arm.com>, <linux-pm@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <imx@lists.linux.dev>,
	<khilman@baylibre.com>
Subject: Re: [PATCH] cpuidle: psci: Init cpuidle only for present CPUs
Date: Wed, 20 Nov 2024 15:00:44 +0530	[thread overview]
Message-ID: <20241120093044.5yeyel4263fc27k7@lcpd911> (raw)
In-Reply-To: <20241120070608.1314850-1-ping.bai@nxp.com>

Hi,

On Nov 20, 2024 at 15:06:08 +0800, Jacky Bai wrote:
> With 'nosmp' or 'maxcpus=0' boot command line paremeters,

s/paremeters/parameters

checkpatch should've caught this for you.

> the 'cpu_present_mask' may not be the same as 'cpu_possible_mask'
> 
> In current psci cpuidle driver init, for_each_possible_cpu()
> is used to init the cpudile for each possible CPU. but in

s/cpudile/cpuidle

> drivers/base/cpu.c ->cpu_dev_register_generic(),
> for_each_present_cpu() is used to register cpu device for
> present CPUs.
> 
> When boot system with 'nosmp' or 'maxcpus=0', the cpuidle driver
> init failed due to no valid CPU device sysfs node for non-boot CPUs.
> 
> [ 0.182993] Failed to register cpuidle device for cpu1

Please can we get a "Fixes:" Tag?

> 
> Use for_each_present_cpu() to register cpuidle only for present
> CPUs.
> 
> Signed-off-by: Jacky Bai <ping.bai@nxp.com>
> ---
>  drivers/cpuidle/cpuidle-psci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
> index 2562dc001fc1..00117e9b33e8 100644
> --- a/drivers/cpuidle/cpuidle-psci.c
> +++ b/drivers/cpuidle/cpuidle-psci.c
> @@ -410,7 +410,7 @@ static int psci_cpuidle_probe(struct platform_device *pdev)
>  	struct cpuidle_driver *drv;
>  	struct cpuidle_device *dev;
>  
> -	for_each_possible_cpu(cpu) {
> +	for_each_present_cpu(cpu) {

With above concerns addressed,

Reviewed-by: Dhruva Gole <d-gole@ti.com>

>  		ret = psci_idle_init_cpu(&pdev->dev, cpu);
>  		if (ret)
>  			goto out_fail;
> -- 
> 2.34.1
> 
> 

-- 
Best regards,
Dhruva Gole
Texas Instruments Incorporated

  reply	other threads:[~2024-11-20  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  7:06 Jacky Bai
2024-11-20  9:30 ` Dhruva Gole [this message]
2024-11-20  9:41   ` Jacky Bai

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=20241120093044.5yeyel4263fc27k7@lcpd911 \
    --to=d-gole@ti.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=imx@lists.linux.dev \
    --cc=james.morse@arm.com \
    --cc=khilman@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=ping.bai@nxp.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®