mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/9] ACPI: ARM64: Implement IRQ mapping probe deferral for static table devices
@ 2026-11-30  8:54 Lorenzo Pieralisi
  2026-11-30  8:54 ` [PATCH RFC v2 1/9] ACPI: irq: Return -EPROBE_DEFER on missing IRQ domain Lorenzo Pieralisi
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Lorenzo Pieralisi @ 2026-11-30  8:54 UTC (permalink / raw)
  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, linux-kernel, linux-arm-kernel, driver-core,
	Lorenzo Pieralisi

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 <lpieralisi@kernel.org>
---
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 <lpieralisi@kernel.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-30  8:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30  8:54 [PATCH RFC v2 0/9] ACPI: ARM64: Implement IRQ mapping probe deferral for static table devices Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 1/9] ACPI: irq: Return -EPROBE_DEFER on missing IRQ domain Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 2/9] ACPI: Introduce IRQ methods for static fwnodes Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 3/9] driver core: platform: Add static ACPI nodes IRQ retrieval/mapping code Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 4/9] clocksource/drivers/arm_arch_timer_mmio: Dispose IRQ mappings on probe failure Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 5/9] clocksource/drivers/arm_arch_timer_mmio: Implement arch mem timer deferred probe Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 6/9] ACPI/IORT: Convert IORT devices to use the ACPI static fwnode IRQs Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 7/9] iommu/arm-smmu: Add arm-smmu IRQ mapping -EPROBE_DEFER handling Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 8/9] iommu/arm-smmu-v3: Add " Lorenzo Pieralisi
2026-11-30  8:54 ` [PATCH RFC v2 9/9] perf/arm-smmuv3: " Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®