From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 100263D5242 for ; Wed, 4 Mar 2026 18:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772650570; cv=none; b=LnXreDTYzEXhAatW5HgRZ+ioyFiZtvf1I+ccQejllxxsWUB09E87GuTY2hDz0yPYDkh06j6GnWqBsuFqX9nZ4ERGNGvmZbr4icsERcQO5ipLfGSzZ0TSkJJVeSN+igit9TiibhV6QPHcljpMhzPxt3ENBIC0ZaYA6KbA7PIVqew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772650570; c=relaxed/simple; bh=Uv2G0LOyhDTgHwb12rNvd64iifQKYLHJSBXNUsqoGcg=; h=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=U+lQ66QA6hro0p++fIawQEGSWf9OEQBOaWzUixDpwJii25CpVylgCChoyPp9gQun/UB6zIBqzEhwmrYn+C1KvjIHNhQ5LOs+puDUcFuzeCpefJbUodpKyf+WJGOYIUZvs+eSsU/WfkM4dGEkXyB07bROuxiBwfdY2gB7iRHqpnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L3fyQp9Q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L3fyQp9Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F6A0C4CEF7; Wed, 4 Mar 2026 18:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772650569; bh=Uv2G0LOyhDTgHwb12rNvd64iifQKYLHJSBXNUsqoGcg=; h=Date:From:To:Cc:Subject:References:From; b=L3fyQp9QHY0T0zbp9sN5wbB7AVKS7pPJ+E22vpwRjEHn1q3zP+xGSlhqaIFcpZD0c 0Osm9uXWJeGCj52ilrGUHytrRC6B32AlI3fOOUGubSKYLzvRYZbiCq3USqRLBod9EK pn1CEvwe05AAd/LWlgVQXZIsuzrpmNedQI7q1K3sGQ8KVAjwLwYIZwWxsmfBYERV1G f189DdYhRWsP9CzpAFfGeE9Hdmw2N3A3DtHIqlzELg11YVPullFxn0HeNxZqPLp5rF kKsEZ62sF53kZDJjurtVL4C8UTPLsPBtvsDSScyVUzHe51vQAkDQCKximHavxpl6hY NTHgu0Zov9ygw== Date: Wed, 04 Mar 2026 19:56:07 +0100 Message-ID: <20260303154548.571362045@kernel.org> User-Agent: quilt/0.68 From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Dmitry Ilvokhin , Neil Horman Subject: [patch 09/14] genirq: Expose irq_find_desc_at_or_after() in core code References: <20260303150539.513068586@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 --- in preparation for a smarter iterator for /proc/interrupts. Signed-off-by: Thomas Gleixner --- kernel/irq/internals.h | 2 ++ kernel/irq/irqdesc.c | 12 +++++------- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -151,6 +151,8 @@ static inline void irq_proc_update_valid static inline void irq_proc_calc_prec(void) { } #endif +struct irq_desc *irq_find_desc_at_or_after(unsigned int offset); + extern bool irq_can_set_affinity_usr(unsigned int irq); extern int irq_do_set_affinity(struct irq_data *data, --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -181,15 +181,11 @@ static int irq_find_free_area(unsigned i return mas.index; } -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 = offset; - struct irq_desc *desc; - - guard(rcu)(); - desc = mt_find(&sparse_irqs, &index, total_nr_irqs); - return desc ? irq_desc_get_irq(desc) : total_nr_irqs; + return mt_find(&sparse_irqs, &index, total_nr_irqs); } static void irq_insert_desc(unsigned int irq, struct irq_desc *desc) @@ -934,7 +930,9 @@ 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 = irq_find_desc_at_or_after(offset); + + return desc ? irq_desc_get_irq(desc) : total_nr_irqs; } struct irq_desc *__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,