Thread (15 messages) 15 messages, 4 authors, 2025-05-23

Re: [PATCH 1/3] drivers/edac: Add L1 and L2 error detection for A72

From: Vijay Balakrishna <vijayb@linux.microsoft.com>
Date: 2025-05-20 23:20:11
Also in: linux-edac, lkml

On 5/20/2025 1:04 PM, Borislav Petkov wrote:
On Tue, May 20, 2025 at 12:54:32PM -0700, Vijay Balakrishna wrote:
quoted
On 5/20/2025 9:09 AM, Vijay Balakrishna wrote:
quoted
On 5/19/2025 1:51 AM, Borislav Petkov wrote:
quoted
I'd venture a guess you need to protect here against CPU hotplug...
quoted
+    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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help