mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: YinFengwei <fengwei_yin@linux.alibaba.com>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	James Morse <james.morse@arm.com>,
	Jinjie Ruan <ruanjinjie@huawei.com>,
	Vladimir Murzin <vladimir.murzin@arm.com>,
	Ada Couprie Diaz <ada.coupriediaz@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Liao Chang <liaochang1@huawei.com>,
	Ashok Raj <ashok.raj@oss.qualcomm.com>,
	Doug Anderson <dianders@chromium.org>,
	Pengjie Zhang <zhangpengjie2@huawei.com>,
	Cong Wang <cwang@multikernel.io>,
	kernel-team@meta.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] firmware: arm_sdei: Do not signal event 0 to a masked PE
Date: Wed, 25 Nov 2026 17:50:10 +0800	[thread overview]
Message-ID: <awavUsKX4XLRMbUq@U-V2QX163P-2032.local> (raw)
In-Reply-To: <20261124194707.1030653-2-kas@kernel.org>

Hi Kirill,

On Tue, Nov 24, 2026 at 07:47:04PM +0000, Kiryl Shutsemau (Meta) wrote:
> The SDEI NMI backtrace signals event 0 to every other CPU, idle ones
<snip>
> +static void sdei_block_signal(void)
> +{
> +	struct sdei_pe *pe = this_cpu_ptr(&sdei_pe);
> +	unsigned long flags;
> +
> +	/*
> +	 * A panic from an SDEI event or a pseudo-NMI may have left the lock
> +	 * held by this CPU. The CPUs that could signal it are stopped by now.
> +	 */
> +	if (panic_on_this_cpu()) {
> +		WRITE_ONCE(pe->unmasked, false);
If the panic didn't take the lock, should lock be taken
just like "else" path?

> +	} else {
> +		raw_spin_lock_irqsave(&pe->lock, flags);
> +		WRITE_ONCE(pe->unmasked, false);
> +		raw_spin_unlock_irqrestore(&pe->lock, flags);
> +	}
> +
> +	sdei_wait_in_flight(pe);
> +}
> +
>  static int sdei_pm_notifier(struct notifier_block *nb, unsigned long action,
>  			    void *data)
>  {
> +	struct sdei_pe *pe = this_cpu_ptr(&sdei_pe);
>  	int rv;
>  
>  	WARN_ON_ONCE(preemptible());
>  
>  	switch (action) {
>  	case CPU_PM_ENTER:
> +		/*
> +		 * Leave alone a PE that is masked already: before
> +		 * sdei_cpuhp_up(), or after sdei_cpuhp_down(), as cpuidle runs
> +		 * until CPU_OFF. CPU_PM_EXIT must not unmask it.
> +		 */
> +		if (!pe->unmasked)
I am wondering whether READ_ONCE() should be used here?


Regards
Yin, Fengwei


  reply	other threads:[~2026-11-25  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 19:47 [PATCH 0/2] firmware: arm_sdei: Fix NMI backtrace lockups on idle CPUs Kiryl Shutsemau (Meta)
2026-11-24 19:47 ` [PATCH 1/2] firmware: arm_sdei: Do not signal event 0 to a masked PE Kiryl Shutsemau (Meta)
2026-11-25  9:50   ` YinFengwei [this message]
2026-11-24 19:47 ` [PATCH 2/2] firmware: arm_sdei_nmi: Send the backtrace IPI to CPUs with SDEI masked Kiryl Shutsemau (Meta)
2026-11-25  9:51   ` YinFengwei
2026-11-25  2:21 ` [PATCH 0/2] firmware: arm_sdei: Fix NMI backtrace lockups on idle CPUs Jinjie Ruan

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=awavUsKX4XLRMbUq@U-V2QX163P-2032.local \
    --to=fengwei_yin@linux.alibaba.com \
    --cc=ada.coupriediaz@arm.com \
    --cc=ashok.raj@oss.qualcomm.com \
    --cc=catalin.marinas@arm.com \
    --cc=cwang@multikernel.io \
    --cc=dianders@chromium.org \
    --cc=james.morse@arm.com \
    --cc=kas@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=liaochang1@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=stable@vger.kernel.org \
    --cc=vladimir.murzin@arm.com \
    --cc=will@kernel.org \
    --cc=zhangpengjie2@huawei.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®