mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Lukas Beckmann" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Lukas Beckmann <lbckmnn@mailbox.org>,
	Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
	x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/core] genirq: Discard cpumask of irqaffinity= boot parameter if parsing fails
Date: Fri, 04 Sep 2026 06:48:17 -0000	[thread overview]
Message-ID: <178850449763.3717435.10403062352068056152.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260822160502.4665-1-lbckmnn@mailbox.org>

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     94235414a0568f260b60b89ec584ff4829d5e8c9
Gitweb:        https://git.kernel.org/tip/94235414a0568f260b60b89ec584ff4829d5e8c9
Author:        Lukas Beckmann <lbckmnn@mailbox.org>
AuthorDate:    Sat, 22 Aug 2026 18:05:00 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Fri, 04 Sep 2026 08:44:17 +02:00

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 <lbckmnn@mailbox.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Radu Rendec <radu@rendec.net>
Link: https://patch.msgid.link/20260822160502.4665-1-lbckmnn@mailbox.org
---
 kernel/irq/irqdesc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 3a818f0..7cbcc3f 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

      parent reply	other threads:[~2026-09-04  6:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-22 16:05 [PATCH] " Lukas Beckmann
2026-08-23 19:50 ` Radu Rendec
2026-09-04  6:48 ` tip-bot2 for Lukas Beckmann [this message]

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=178850449763.3717435.10403062352068056152.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=lbckmnn@mailbox.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=radu@rendec.net \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®