From 94235414a0568f260b60b89ec584ff4829d5e8c9 Mon Sep 17 00:00:00 2001 From: Lukas Beckmann Date: Sat, 22 Aug 2026 18:05:00 +0200 Subject: genirq: Discard cpumask of irqaffinity= boot parameter if parsing fails irq_affinity_setup() ignores the return value of cpulist_parse(). This can result in using a "half parsed" cpulist. E.g. on a system with 8 cores, the parameter "irqaffinity=0,1,6-10,4" would result in using only CPU 0 and 1, since the parsing fails at 6-10. Other boot parameters which take a cpulist (e.g. isolcpus=, workqueue.unbound_cpus=) already handle this by falling back to a default. Check the return value of cpulist_parse() and let init_irq_default_affinity() set the default in early_irq_init() later, if parsing fails. Signed-off-by: Lukas Beckmann Signed-off-by: Thomas Gleixner Reviewed-by: Radu Rendec Link: https://patch.msgid.link/20260822160502.4665-1-lbckmnn@mailbox.org --- kernel/irq/irqdesc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 3a818f07a101..7cbcc3fb9e6d 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -28,7 +28,15 @@ static struct lock_class_key irq_desc_lock_class; static int __init irq_affinity_setup(char *str) { alloc_bootmem_cpumask_var(&irq_default_affinity); - cpulist_parse(str, irq_default_affinity); + if (cpulist_parse(str, irq_default_affinity) < 0) { + /* + * Clear the mask so that init_irq_default_affinity() + * defaults it later. + */ + cpumask_clear(irq_default_affinity); + pr_warn("irqaffinity: incorrect CPU range, using default\n"); + return 1; + } /* * Set at least the boot cpu. We don't want to end up with * bugreports caused by random commandline masks -- cgit v1.2.3 From 67f399a9ac7f3001cafc0cb1b645e3e5760779d2 Mon Sep 17 00:00:00 2001 From: Enlin Mu Date: Tue, 25 Aug 2026 09:15:09 +0800 Subject: softirq: Remove redundant h->action from preempt_count mismatch error When a preempt_count mismatch is detected in handle_softirqs(), the error message currently prints the softirq action handler (h->action). However, as Thomas Gleixner pointed out, the action handler for a given softirq vector is always a known, fixed function (e.g., run_timer_softirq for TIMER_SOFTIRQ). Printing it provides zero diagnostic value. The real issue typically lies in the functions invoked *within* that handler, not the handler entry point itself. Therefore, as suggested by Sebastian Andrzej Siewior, remove h->action from the print statement entirely to clean up the error message. Suggested-by: Thomas Gleixner Suggested-by: Sebastian Andrzej Siewior Signed-off-by: Enlin Mu Signed-off-by: Enlin Mu Signed-off-by: Thomas Gleixner Reviewed-by: Sebastian Andrzej Siewior Link: https://patch.msgid.link/20260825011509.8505-1-enlin.mu@linux.dev --- kernel/softirq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/softirq.c b/kernel/softirq.c index 7980a4a232f9..800d81c57302 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -645,8 +645,8 @@ restart: h->action(); trace_softirq_exit(vec_nr); if (unlikely(prev_count != preempt_count())) { - pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n", - vec_nr, softirq_to_name[vec_nr], h->action, + pr_err("huh, entered softirq %u %s with preempt_count %08x, exited with %08x?\n", + vec_nr, softirq_to_name[vec_nr], prev_count, preempt_count()); preempt_count_set(prev_count); } -- cgit v1.2.3