From nobody Mon Jun 8 20:53:43 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 166B73FF1B0; Tue, 26 May 2026 14:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779805346; cv=none; b=F0g+PmvcSnUu6fEDsYuUsG/4fkYIf1gc4vy4WbhJYljFPO/IVbC8uSvyjz1kspLCu/Dlw33uKYL/bOlsBo8TCW6ChSTbD9P3w/l9JI8EhHCkdzgn4QiFJ1ZZl8e8JNOuhV3pVzHN3RSQHHJM08ZE1ls4oXsK09H2cWEQnlhRPgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779805346; c=relaxed/simple; bh=FrH0XffC+CQXVU5XdiusxzjLeTuKGmgXK0yd3ZxQOwA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=Xqo7D23d8ZZsDArgLWD8drE25iJg5OxoT/dxQLox0KdrjcKvY8KL19kPyZ0azXkA8wK/kzYISqmb7xStTp1BzDv6ojKlWLTDNXOlQ/Mpl1w1HmunOPcBLiVAZm+ocx1LTVrw/63o3GPmeNBCr+iZgG/S9IYPojAm57AMNUoBRDA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sn52mQv/; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=570jxO1r; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sn52mQv/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="570jxO1r" Date: Tue, 26 May 2026 14:22:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779805342; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uyhqkE8P7ekiNGZquRFBCYE+aBwZXEzr17L5y0bk5oU=; b=sn52mQv/2IW2VPalVWXgAVPezGGosV/JKxTk2AOHNXrFwMZF680mB+VS+xUWRjNbq66/2L YNkS3idMn6+MV5foN7fAqfu86uqQ9AEnEBBOpGgPLrNyeeP/tXiGzOYqXvw3gB7Bamfztw yNf/j9yX1T/KEJaVmVUKm0tSivJBT19Py9M+780Z5VH17WFBxOrYuCEbb0w3HIweTQPHEM io3gABzdP5d+udrzEDKUrr0GWpeqyf0w1G3wvrBB7k5AfJjaEldGFbc43gvOwsBPD+AxfP X4OhHekPSIfaaIzxg29IMWUw5Joi5r5qbSqGUKkeBi/HwMjJfStB9aNnH67/ug== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779805342; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uyhqkE8P7ekiNGZquRFBCYE+aBwZXEzr17L5y0bk5oU=; b=570jxO1rjIjvmQKqsL43Ohqt+v0g0c+c/gSouUGNPw+uMONyoo4Ef8tDv24rQJFtNJVhaE ZxsfXun0W7HcadAw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] genirq: Expose irq_find_desc_at_or_after() in core code Cc: Thomas Gleixner , Michael Kelley , Dmitry Ilvokhin , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20260517194932.005787611@kernel.org> References: <20260517194932.005787611@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177980534108.1039918.5644069121868312835.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/core branch of tip: Commit-ID: 7603e0575d8a92318bd4695917fce7ec2c5825a1 Gitweb: https://git.kernel.org/tip/7603e0575d8a92318bd4695917fce7ec2= c5825a1 Author: Thomas Gleixner AuthorDate: Sun, 17 May 2026 22:02:39 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 26 May 2026 16:21:15 +02:00 genirq: Expose irq_find_desc_at_or_after() in core code ... in preparation for a smarter iterator for /proc/interrupts. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Reviewed-by: Dmitry Ilvokhin Link: https://patch.msgid.link/20260517194932.005787611@kernel.org --- kernel/irq/internals.h | 2 ++ kernel/irq/irqdesc.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index bacbf40..37eec03 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -155,6 +155,8 @@ void irq_proc_calc_prec(void); static inline void irq_proc_calc_prec(void) { } #endif =20 +struct irq_desc *irq_find_desc_at_or_after(unsigned int offset); + extern bool irq_can_set_affinity_usr(unsigned int irq); =20 extern int irq_do_set_affinity(struct irq_data *data, diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 23f2176..80ef4e2 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -181,15 +181,12 @@ static int irq_find_free_area(unsigned int from, unsi= gned int cnt) return mas.index; } =20 -static unsigned int irq_find_at_or_after(unsigned int offset) +struct irq_desc *irq_find_desc_at_or_after(unsigned int offset) { unsigned long index =3D offset; - struct irq_desc *desc; - - guard(rcu)(); - desc =3D mt_find(&sparse_irqs, &index, total_nr_irqs); =20 - return desc ? irq_desc_get_irq(desc) : total_nr_irqs; + lockdep_assert_in_rcu_read_lock(); + return mt_find(&sparse_irqs, &index, total_nr_irqs); } =20 static void irq_insert_desc(unsigned int irq, struct irq_desc *desc) @@ -934,7 +931,11 @@ EXPORT_SYMBOL_GPL(__irq_alloc_descs); */ unsigned int irq_get_next_irq(unsigned int offset) { - return irq_find_at_or_after(offset); + struct irq_desc *desc; + + guard(rcu)(); + desc =3D irq_find_desc_at_or_after(offset); + return desc ? irq_desc_get_irq(desc) : total_nr_irqs; } =20 struct irq_desc *__irq_get_desc_lock(unsigned int irq, unsigned long *flag= s, bool bus,