Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: "Maulik Shah (mkshah)" <maulik.shah@oss.qualcomm.com>
To: Christian Loehle <christian.loehle@arm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] cpuidle: Deny idle entry when CPU already have IPI interrupt pending
Date: Mon, 16 Mar 2026 14:51:43 +0530	[thread overview]
Message-ID: <9fc2ccf9-095b-478c-867f-2a6ace1ef1ce@oss.qualcomm.com> (raw)
In-Reply-To: <39ffe4f6-5716-400d-963b-06675a727225@arm.com>



On 3/16/2026 2:25 PM, Christian Loehle wrote:
> On 3/16/26 07:37, Maulik Shah wrote:
..
..
>>
>> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
>> index c7876e9e024f9076663063ad21cfc69343fdbbe7..c88c0cbf910d6c2c09697e6a3ac78c081868c2ad 100644
>> --- a/drivers/cpuidle/cpuidle.c
>> +++ b/drivers/cpuidle/cpuidle.c
>> @@ -224,6 +224,9 @@ noinstr int cpuidle_enter_state(struct cpuidle_device *dev,
>>  	bool broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP);
>>  	ktime_t time_start, time_end;
>>  
>> +	if (cpus_peek_for_pending_ipi(drv->cpumask))
>> +		return -EBUSY;
>> +
>>  	instrumentation_begin();
..
..
>> Best regards,
> 
> So we already do a per-CPU IPI need_resched() check in the idle path.
> Your patch uses drv->cpumask, which will contain all CPUs, preventing idle entry if
> any CPU has an IPI pending?

The IPI interrupt became pending after the need_resched() check,
when the CPUidle governor is selecting a mode, but before the idle entry.

On qualcomm lemans-evk case, drv->cpumask using cpuidle-psci is having only single
CPU but seems other idle drivers may contain all CPUs.

Since intent here was to check the pending IPI on same CPU, this check be replaced
with another need_resched() or using cpus_peek_for_pending_ipi() taking a single
(current) CPU's mask in the argument. I can update this in v2 based on recommendation.

Thanks,
Maulik

  reply	other threads:[~2026-03-16  9:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16  7:37 [PATCH] cpuidle: Deny idle entry when CPU already have IPI interrupt pending Maulik Shah
2026-03-16  8:55 ` Christian Loehle
2026-03-16  9:21   ` Maulik Shah (mkshah) [this message]
2026-03-16  9:32   ` Daniel Lezcano
2026-03-16  9:50     ` Christian Loehle
2026-03-16 10:51       ` Daniel Lezcano
2026-03-20 18:29 ` Rafael J. Wysocki
2026-03-23 12:13   ` Maulik Shah (mkshah)
2026-03-24 16:07     ` Rafael J. Wysocki
2026-03-25  5:37       ` Maulik Shah (mkshah)
2026-03-24 15:46 ` Ulf Hansson
2026-03-25 15:34   ` Maulik Shah (mkshah)
2026-04-03  8:45 ` kernel test robot

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=9fc2ccf9-095b-478c-867f-2a6ace1ef1ce@oss.qualcomm.com \
    --to=maulik.shah@oss.qualcomm.com \
    --cc=christian.loehle@arm.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=ulf.hansson@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox