mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vijay Balakrishna <vijayb@linux.microsoft.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Tony Luck <tony.luck@intel.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	James Morse <james.morse@arm.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Robert Richter <rric@kernel.org>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tyler Hicks <code@tyhicks.com>, Marc Zyngier <maz@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 1/3] drivers/edac: Add L1 and L2 error detection for A72
Date: Tue, 20 May 2025 16:20:15 -0700	[thread overview]
Message-ID: <e9fb39c6-6678-4369-9184-a7308627714f@linux.microsoft.com> (raw)
In-Reply-To: <20250520200448.GRaCzgYFnfIjKAgAg2@fat_crate.local>

On 5/20/2025 1:04 PM, Borislav Petkov wrote:
> On Tue, May 20, 2025 at 12:54:32PM -0700, Vijay Balakrishna wrote:
>> On 5/20/2025 9:09 AM, Vijay Balakrishna wrote:
>>> On 5/19/2025 1:51 AM, Borislav Petkov wrote:
>>>> I'd venture a guess you need to protect here against CPU hotplug...
>>>>
>>>>> +    for_each_cpu_and(cpu, cpu_online_mask, &compat_mask) {
>>>>> +        smp_call_function_single(cpu, read_errors, &merrsr, true);
>>>>> +        report_errors(edac_ctl, cpu, &merrsr);
>>>>> +    }
>>>>> +}
>>>>> +
>>>
>>> Hi Boris,
>>>
>>> I appreciate you highlighting the CPU hotplug issue. Upon further review
>>> of surrounding code, I realized we must ensure that the data passed to
>>> read_errors() is per-CPU.
>>
>> Actually, per-CPU data not needed as we are passing true -- wait until
>> function has completed on other CPUs.
> 
> What happens if @cpu above gets offlined right before you do
> smp_call_function_single() ?

We can see inconsistent behavior or kernel crash/hang. You are correct, 
we need to protect against CPU hotplug. I will add 
cpus_read_lock()/cpus_read_unlock().

Thanks,
Vijay



  reply	other threads:[~2025-05-20 23:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16  0:06 [v9 PATCH 0/3] " Vijay Balakrishna
2025-05-16  0:06 ` [PATCH 1/3] drivers/edac: " Vijay Balakrishna
2025-05-19  8:51   ` Borislav Petkov
2025-05-20 16:09     ` Vijay Balakrishna
2025-05-20 19:54       ` Vijay Balakrishna
2025-05-20 20:04         ` Borislav Petkov
2025-05-20 23:20           ` Vijay Balakrishna [this message]
2025-05-20  9:35   ` Jonathan Cameron
2025-05-23 18:26     ` Vijay Balakrishna
2025-05-16  0:06 ` [PATCH 2/3] dt-bindings: arm: cpus: Add edac-enabled property Vijay Balakrishna
2025-05-19  9:02   ` Borislav Petkov
2025-05-21  0:07     ` Rob Herring
2025-05-21  5:56       ` Vijay Balakrishna
2025-05-16  0:06 ` [PATCH 3/3] EDAC: Add EDAC driver for Cortex A72 Vijay Balakrishna
2025-05-19  9:04   ` Borislav Petkov

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=e9fb39c6-6678-4369-9184-a7308627714f@linux.microsoft.com \
    --to=vijayb@linux.microsoft.com \
    --cc=bp@alien8.de \
    --cc=code@tyhicks.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.morse@arm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=maz@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=rric@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=tony.luck@intel.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®