From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796028904; b=xIUXRww5EXDAgVQf+9RNkwkBX0PE1X58EXbLOa6ETnYbJEfwJmvEIE/Vr4hWbx8aIAcx w0xfkiC5nqGB8q5HneB6FTbx+nnz6zLnyo5hrgZAz+JYyxa4J18AhGpOKqa7dxDOluneI whMYxUSYz/V5VVGIbkXhnMwZ/39//sO55fXOLfFAhHzkG3NxALQ7+Zyj3bTdsyGK4KcpR OxYviglktCspbZWNvZAk/MoyH/Fcm1TLVfn9E4HNOKG3BnTOLfsXpEPDlmPoXCcnqBQtx mp5+dYzX2XQ5+LRiSvhZ8WCHsKKeQ4lTFxihJxAlzix7cGfrsmd4EihY6BSBx0qQL2w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796028904; h=Received:DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer; bh=nKya9eG13AvQ64W9MKUQQGXlivDAJZafRjvrDBiIzVs=; b=JlXhZK8mvqWmevfMgWYpkT2X2ZGg5unySYlebc8/it+vkIQzS3nfFBuDtSS0ZSNZe0bL hGM13uyXpTduReq3O8mNMt20cKR1Yy7Td29LbIKGiS+FLT/HsWM74MzvpLoVk+h1gb0wD nCK1FshLoMqMlB8SoYYlq1CcC26twUyC1JWUaHxiskN6t1qRhvhU+UBrowm7RHns76gS4 rXDgZxZjuK6U+Javz19vReOiLn2M5GYyBDh2I2sRzKl62QSaAWjHohe6rXdotQRUNe7c9 G8ryXom7+Rmd9CTpVt77+sQV9DKUGY6kAWl+8dtuUQkUQAnhIAVpBf5OHOvaFII5CFw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D8N34XTH; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A30F606A33A; Mon, 30 Nov 2026 08:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D8N34XTH Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C1E31F0092F; Mon, 30 Nov 2026 08:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796028903; bh=nKya9eG13AvQ64W9MKUQQGXlivDAJZafRjvrDBiIzVs=; h=From:Subject:Date:To:Cc; b=D8N34XTHC96GTYktyi+UcTuw9/cCkBPwK8ewNt/CLBh2MR6XmU4gvmo9XqyRyeH5r rsh0qYmYiWeMvHbwp3POaBBaFgRBCBn41/7qoxmk4P/B78gofhn6YkbKfFSyt64WYV BCwwI+yh3byXmF3MTUzev1DEAmI3ZPvubNAdMvCFULRyoNlL1mId/7Xu3ExocZn6Y3 gDlhqtmbjuqXFC47z6pLreYdVhM4XAJOtl4Xy74AoIjDOMByo7ziSSbg2vFvvnugZ6 N2aUOqTLB+43bA/Bj5tpeGyJEJclnGwxZXuzsAUE1BeE8Z4fUAT8CrluFfqcHZc7gJ yXp6Yn2molRCw== From: Lorenzo Pieralisi Subject: [PATCH RFC v2 0/9] ACPI: ARM64: Implement IRQ mapping probe deferral for static table devices Date: Mon, 30 Nov 2026 09:54:32 +0100 Message-Id: <20261130-acpi-static-table-irq-probe-defer-v2-0-7e854fe7aecd@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/42OSw6CQBBEr2J6bZthFBBXJiYewK1hMZ8GRglgz 0g0hLsL6AFcVuWlXg3giR15OKwGYOqdd20zBblegalUUxI6O2WQQiYikztUpnPogwrOYFC6ngB +YMetJrRUEGOS6SxNtE3l1sK00zEV7rU4rnA5nyD/lv6pb2TCvD5jlfOh5ffypI8W+CeN/5D2E QqUJpGRjK0Q+/h4J26o3rRcQj6O4wfmw8Ko6gAAAA== X-Change-ID: 20260924-acpi-static-table-irq-probe-defer-69b976bd723d To: "Rafael J. Wysocki" , Mark Rutland , Marc Zyngier , Daniel Lezcano , Thomas Gleixner , Greg Kroah-Hartman , Danilo Krummrich , Hanjun Guo , Sudeep Holla , Robin Murphy , Catalin Marinas , Will Deacon , Bartosz Golaszewski , Andy Shevchenko , Leo Yan Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, driver-core@lists.linux.dev, Lorenzo Pieralisi X-Mailer: b4 0.15.2 On ACPI ARM64 some platform devices (ie SMMUs, MPAM, MMIO MEM timer) are created when the respective static ACPI table (GTDT, IORT, MPAM) entries are parsed and the platform device resources, inclusive of their IRQ number are stashed in the platform device resources to be used by device drivers at probe time to retrieve the resource values. For IRQs, this works well as long as interrupt controller drivers managing IRQs for those devices are probed before the code creating the IRQ mapping out of static table GSI numbers is run, in that the interrupt controller drivers create the IRQ domain that allow the actual IRQ mappings. So far, that's always been the case on ACPI ARM64 systems given that IRQs were routed to the GICv<5 interrupt controllers (wired and MSI) and those controllers drivers probe earlier than any code creating GSI mappings out of static ACPI table entries. With the advent of GICv5 - wired IRQs (former GICv3 SPIs) can be routed to a GICv5 IWB; the IWB is modelled as a device and its IRQ domain is created when the IWB driver probes - that might be later than the device drivers for platform devices created out of static ACPI tables probe, resulting in failures to map the IRQs because the IRQ domain is not registered yet so the IRQ mapping cannot be resolved. This RFC series aims at solving this issue and should be used as a starting point to build a solution and hopefully get some feedback. PATCH 4 is a fixlet, I included with the series since I noticed while updating the arch MEM MMIO timer driver. Herein below, some technical details behind the patchset decisions and questions to be addressed. ================ Misc design info ================ The main idea behind the patchset relies in augmenting the ACPI static fwnode with a structure backing to stash GSI number, trigger and polarity (and possibly its "name") so that the device drivers can retrieve their values in a uniform manner when the device drivers probe, the same way it is done on OF. I converted IORT table platform devices to provide an example of what it looks like and check whether that's the right direction of travel. A question I have about this approach is that resources for a given device are stored in separate data, struct resource for MMIO address space and ACPI static fwnode for GSI data. I decided to handle the arch MMIO timer conversion differently as a point solution. Converting the arch MMIO timer to ACPI static fwnodes would require creating an ACPI static fwnode per-frame and would complicate things for not much. Instead, I just stash the GSI number and properties in static data per frame (that exists already, struct arch_timer_mem_frame) at GTDT parse time that can be used by the driver later to map the GSI when the MMIO timer driver probes. acpi_register_gsi() was augmented to return -EPROBE_DEFER to handle a missing IRQ domain and therefore enabling probe deferral. The fwnode API was augmented as well so that device drivers can actually retrieve IRQ numbers using standard platform device APIs: platform_get_irq*() when the fwnode itself is an ACPI static fwnode value. I tested this on a GICv5 FVP model by re-routing MMIO timer and SMMUv3 IRQs to an IWB and checking that IRQ mappings and probe deferral work. Feedback more than welcome. Signed-off-by: Lorenzo Pieralisi --- Changes in v2: - Removed software nodes usage and converted the set to use ACPI static fwnode instead - Fixed minor !CONFIG_ACPI compilation issue - Removed SBSA watchdog conversion following Sashiko's report https://lore.kernel.org/all/20260925075726.B0A6B1F000FF@smtp.kernel.org/ - Link to v1: https://patch.msgid.link/20260925-acpi-static-table-irq-probe-defer-v1-0-2c62125d0085@kernel.org --- Lorenzo Pieralisi (9): ACPI: irq: Return -EPROBE_DEFER on missing IRQ domain ACPI: Introduce IRQ methods for static fwnodes driver core: platform: Add static ACPI nodes IRQ retrieval/mapping code clocksource/drivers/arm_arch_timer_mmio: Dispose IRQ mappings on probe failure clocksource/drivers/arm_arch_timer_mmio: Implement arch mem timer deferred probe ACPI/IORT: Convert IORT devices to use the ACPI static fwnode IRQs iommu/arm-smmu: Add arm-smmu IRQ mapping -EPROBE_DEFER handling iommu/arm-smmu-v3: Add IRQ mapping -EPROBE_DEFER handling perf/arm-smmuv3: Add IRQ mapping -EPROBE_DEFER handling drivers/acpi/arm64/gtdt.c | 42 +----- drivers/acpi/arm64/iort.c | 206 +++++++++++----------------- drivers/acpi/irq.c | 6 + drivers/acpi/property.c | 41 +++++- drivers/base/platform.c | 6 + drivers/clocksource/arm_arch_timer_mmio.c | 135 +++++++++++++++++- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 ++++-- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 + drivers/perf/arm_smmuv3_pmu.c | 3 + include/clocksource/arm_arch_timer.h | 4 + include/linux/acpi.h | 68 +++++++-- 11 files changed, 363 insertions(+), 193 deletions(-) --- base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 change-id: 20260924-acpi-static-table-irq-probe-defer-69b976bd723d Best regards, -- Lorenzo Pieralisi