From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0AA2D31F99B for ; Wed, 10 Jun 2026 08:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781080388; cv=none; b=EBqLubrGbWxR1MjG6EQZhU+cZl+Byd7CWHHzWHiBbLhVU5/ahXuxScFAwNzV8uMDViDPp8ok7g66u72wVZqXSZ0XCG7hQYnJe5pEl+AliuDkDr0ifxa81lrBEo0lB7zHwQrtMCthFMZWUm3qQZDD7BdMZASjW0JUh2XkaoFrkeg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781080388; c=relaxed/simple; bh=gzKs/SyooGVbc/ivVj1ya2VQYYITxVdsgl7c9SHc3jE=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=qNYWQiKUDswGqHa9Gs8xHnk4Map4TFUAHUy+QqQ1Pb+xFYh2HTJNvtmGZCQN5WBvjzDkhEw/Wd76BzxrYVGIz3UJeFwqkEPq72Xb+7gYbSDbWGR6T1gS3Tk/gTSsrknKdHKW3GQsEdo7F+YmWlHaxX5Kk1TpTeIRMA2gc2mKLVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aKK6hLWU; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aKK6hLWU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A04411F00893; Wed, 10 Jun 2026 08:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781080386; bh=/WFKSTT/GehqSOKdrOHdZTUHvhGEkbGp6SRnwrVGHEc=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=aKK6hLWUDhkgLAQScCb5yHkPHGENC3nN5/PSDZd85kzs6gRgGVIUCjxi0OkecdSnd AYl3YGEsNxTMBWwwdn/zjZzVG0zahddHgWFDHC+yO28Viw96fcuL33dQKE0836ZhG8 d0CjLlCL+qlxN1mni7fRDTZlm8kM91uqzId+zx9iOfnNGZ5N3ooqMyS4gvzdp1Eak7 p19QMfdKmeoB5rCHF37+wUvNpTMEcNvR7grB7mJ9RPSoUCjsFhPhghSfyswzNMrbMh yAwhEsJW77ZNmecL27lJrNPV84K8JC12ZGX7l1V9p6WYMIyPQ0gAI0XQy84o0F6hVB WhMJ/hJUDnXDg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wXEMy-0000000BFzj-1x2t; Wed, 10 Jun 2026 08:33:04 +0000 Date: Wed, 10 Jun 2026 09:33:04 +0100 Message-ID: <86a4t2u75r.wl-maz@kernel.org> From: Marc Zyngier To: Bhargav Joshi Cc: Thomas Gleixner , Tony Lindgren , Jason Cooper , linux-kernel@vger.kernel.org, goledhruva@gmail.com, m-chawdhry@ti.com, daniel.baluta@gmail.com, simona.toaca@nxp.com Subject: Re: [PATCH RFC] irqchip: crossbar: Fix data race in allocate_gic_irq In-Reply-To: References: <20260610-irq-spinlock-fix-v1-1-6f227ea9fa34@gmail.com> <86bjdiubvo.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: j.bhargav.u@gmail.com, tglx@kernel.org, tony@atomide.com, jason@lakedaemon.net, linux-kernel@vger.kernel.org, goledhruva@gmail.com, m-chawdhry@ti.com, daniel.baluta@gmail.com, simona.toaca@nxp.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 10 Jun 2026 08:20:59 +0100, Bhargav Joshi wrote: >=20 > On Wed, Jun 10, 2026 at 12:21=E2=80=AFPM Marc Zyngier wr= ote: > > > > On Tue, 09 Jun 2026 22:00:09 +0100, > > Bhargav Joshi wrote: > > > > > > In allocate_gic_irq(), if irq_domain_alloc_irqs_parent() fails, the > > > error path resets cb->irq_map[i] to IRQ_FREE. It modifies cb->irq_map= [] > > > without holding cb->lock. modifying without lock could cause data rac= e. > > > > > > Fix this by acquiring raw_spin_lock around cb->irq_map[] modification. > > > > > > Fixes: 783d31863fb8 ("irqchip: crossbar: Convert dra7 crossbar to sta= cked domains") > > > > > > Signed-off-by: Bhargav Joshi > > > --- > > > This bug was flagged by the Sashiko AI bot during the review process = for > > > the DT schema conversion of ti,irq-crossbar binding. > > > https://lore.kernel.org/linux-devicetree/20260605210647.CCC881F00893@= smtp.kernel.org/ > > > --- > > > drivers/irqchip/irq-crossbar.c | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-cro= ssbar.c > > > index cd1134101ace..9b809e711009 100644 > > > --- a/drivers/irqchip/irq-crossbar.c > > > +++ b/drivers/irqchip/irq-crossbar.c > > > @@ -100,8 +100,11 @@ static int allocate_gic_irq(struct irq_domain *d= omain, unsigned virq, > > > fwspec.param[2] =3D IRQ_TYPE_LEVEL_HIGH; > > > > > > err =3D irq_domain_alloc_irqs_parent(domain, virq, 1, &fwspec); > > > - if (err) > > > + if (err) { > > > + raw_spin_lock(&cb->lock); > > > cb->irq_map[i] =3D IRQ_FREE; > > > + raw_spin_lock(&cb->lock); > > > > Really? > > > Apologies for the typo, Should I send a v2 with the proper > raw_spin_unlock(), or do you feel this specific error path doesn't > warrant the fix? I don't know what to answer to that question. Surely *you* have done the necessary analysis before sending a patch, right? M. --=20 Without deviation from the norm, progress is not possible.