From nobody Mon Sep 28 18:33:57 2026 Received: from twmbx01.aspeedtech.com (mail.aspeedtech.com [211.20.114.72]) (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 A9224823DD for ; Wed, 19 Aug 2026 01:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787101781; cv=none; b=JJpNzS4g/H6Sda1mACGF6E+UOYM0a98yaN3fi3y/srMRscuKxWXHAgaYkfnxj0RjR/BHDy/CB6uMNvHdIfU8H3jcJxxBwTEVODPJUaMo5zM2r05RhlRCmNjJTrnYDHosfsg+9rmJWS9rCnR/pNNnY2hfusYvqbGvcUCoL87CiWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787101781; c=relaxed/simple; bh=ZRBbxvpAQxQ9WSWrReHJgmHc7WwhW/QkN01mfSF5T+A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:To:CC; b=I2GAj65kiOZGPh53lCDXITDgUpanYDa9aiEVa9Fazpx87coaoXyNoaEtrH63kNCYPHNWKG6RB7zgyaxOjVmTHwlLId2TVTD2VCTLDRFCN19ISubk5ZdZBQOkGxZrbUeJVHar4jsHD0/cwAHJq5AZXfBVbXJ4jkh1fMyWCsf/I4Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Wed, 19 Aug 2026 09:09:29 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Wed, 19 Aug 2026 09:09:29 +0800 From: Ryan Chen Date: Wed, 19 Aug 2026 09:09:19 +0800 Subject: [PATCH] irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback 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" Content-Transfer-Encoding: quoted-printable Message-ID: <20260819-fix-ast2700-intc-atomic-alloc-v1-1-d92a02e2a239@aspeedtech.com> X-B4-Tracking: v=1; b=H4sIAD4ChWoC/x2M0QrCMAwAf2Xk2UAaxa3+ivgQatwCWyttEWHs3 w0+Hfdwt0PTatrgNuxQ9WPNSnYJpwHSInlWtKc7MPGVphDxZV+U1nkkQss9ofSymWNdS8J45ss kHCUkAn+8q3rw/98fx/EDtmZR2m8AAAA= X-Change-ID: 20260819-fix-ast2700-intc-atomic-alloc-93248a29a1c0 To: Thomas Gleixner , Joel Stanley , "Andrew Jeffery" , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , "Alexandre Ghiti" CC: Radu Rendec , , , , , Ryan Chen X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787101769; l=3189; i=ryan_chen@aspeedtech.com; s=20251126; h=from:subject:message-id; bh=ZRBbxvpAQxQ9WSWrReHJgmHc7WwhW/QkN01mfSF5T+A=; b=y1Ml1E/xkjDXkFmU+iV4p/nM5dpGUJaEb88IKzFFXQ5J4lWuwqKhEp/CQFMZOJ9+32v9B/0yF 5nN0wH0Wn49BXicFlAqMoXXI50tdDMwxm2iC2qh6n8B5Wh9l0n/EUvQ X-Developer-Key: i=ryan_chen@aspeedtech.com; a=ed25519; pk=Xe73xY6tcnkuRjjbVAB/oU30KdB3FvG4nuJuILj7ZVc= The IRQ core calls the irq_domain .activate callback from __setup_irq() with desc->lock held and interrupts disabled. Both aspeed_intc1_irq_domain_activate() and the aspeed_intc0_resolve_route() it invokes test a compatible string with fwnode_device_is_compatible(), which wraps fwnode_property_match_string() and allocates with GFP_KERNEL. Besides sleeping in atomic context, that makes the irq_desc lock depend on fs_reclaim, which lockdep reports as an inversion because irq_desc_lock_class is also taken in hardirq context: WARNING: possible irq lock inversion dependency detected swapper/0/0 just changed the state of lock: (&irq_desc_lock_class){-...}-{2:2}, at: handle_level_irq+0x28/0x168 but this lock took another, HARDIRQ-unsafe lock in the past: (fs_reclaim){+.+.}-{0:0} ... fs_reclaim_acquire __kmalloc_noprof fwnode_property_match_string aspeed_intc0_resolve_route aspeed_intc1_irq_domain_activate Both call sites are only ever handed OF nodes, so use of_device_is_compatible() instead: it walks the property in place and does not allocate. Fixes: 07825e41519a ("irqchip/ast2700-intc: Add AST2700-A2 support") Reported-by: Andrew Jeffery Signed-off-by: Ryan Chen Tested-by: Andrew Jeffery --- Tested on an AST2700 EVB with CONFIG_PROVE_LOCKING=3Dy: the irq lock inversion splat quoted in the patch is gone, and the ast2700-intc0 KUnit suite still passes 9/9. --- drivers/irqchip/irq-ast2700-intc0.c | 2 +- drivers/irqchip/irq-ast2700-intc1.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-ast2700-intc0.c b/drivers/irqchip/irq-ast2= 700-intc0.c index 14b8b88f1179..c85b98a19bd4 100644 --- a/drivers/irqchip/irq-ast2700-intc0.c +++ b/drivers/irqchip/irq-ast2700-intc0.c @@ -312,7 +312,7 @@ int aspeed_intc0_resolve_route(const struct irq_domain = *c0domain, size_t nc1outs return -ENOENT; =20 if (!IS_ENABLED(CONFIG_ASPEED_AST2700_INTC_TEST) && - !fwnode_device_is_compatible(c0domain->fwnode, "aspeed,ast2700-intc0"= )) + !of_device_is_compatible(to_of_node(c0domain->fwnode), "aspeed,ast270= 0-intc0")) return -ENODEV; =20 intc0 =3D c0domain->host_data; diff --git a/drivers/irqchip/irq-ast2700-intc1.c b/drivers/irqchip/irq-ast2= 700-intc1.c index 59e8f0d5ddcd..df6acbafce2d 100644 --- a/drivers/irqchip/irq-ast2700-intc1.c +++ b/drivers/irqchip/irq-ast2700-intc1.c @@ -157,7 +157,8 @@ static int aspeed_intc1_irq_domain_activate(struct irq_= domain *domain, intc1->ranges.nranges, intc1->ranges.ranges, &resolved); if (rc < 0) { - if (!fwnode_device_is_compatible(intc1->upstream->fwnode, "riscv,aplic")= ) { + if (!of_device_is_compatible(to_of_node(intc1->upstream->fwnode), + "riscv,aplic")) { dev_warn(intc1->dev, "Failed to resolve interrupt route for hwirq %lu in domain %s\n", data->hwirq, domain->name); --- base-commit: 4477a78374a57c3809b172ad30cceabda48c47c6 change-id: 20260819-fix-ast2700-intc-atomic-alloc-93248a29a1c0 Best regards, --=20 Ryan Chen