Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Hanjun Guo <guohanjun@huawei.com>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>, Leo Yan <leo.yan@arm.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	driver-core@lists.linux.dev
Subject: Re: [PATCH RFC v2 0/9] ACPI: ARM64: Implement IRQ mapping probe deferral for static table devices
Date: Fri, 4 Dec 2026 20:19:56 +0200	[thread overview]
Message-ID: <axMETGgCJy3ivXda@ashevche-desk.local> (raw)
In-Reply-To: <20261130-acpi-static-table-irq-probe-defer-v2-0-7e854fe7aecd@kernel.org>

On Mon, Nov 30, 2026 at 09:54:32AM +0100, Lorenzo Pieralisi wrote:
> 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.

It doesn't look awful in my opinion. But claiming them ACPI static nodes seems
too premature. These are for IRQ so far, perhaps name them accordingly?

-- 
With Best Regards,
Andy Shevchenko




  parent reply	other threads:[~2026-12-04 18:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-12-04 18:10   ` Andy Shevchenko
2026-12-04 18:21     ` Rafael J. Wysocki (Intel)
2026-12-04 18:37       ` Andy Shevchenko
2026-12-04 18:35   ` Rafael J. Wysocki (Intel)
2026-12-04 19:41   ` Robin Murphy
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-12-04 18:17   ` Andy Shevchenko
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-12-04 18:34   ` Robin Murphy
2026-11-30  8:54 ` [PATCH RFC v2 8/9] iommu/arm-smmu-v3: Add " Lorenzo Pieralisi
2026-12-04 18:59   ` Robin Murphy
2026-11-30  8:54 ` [PATCH RFC v2 9/9] perf/arm-smmuv3: " Lorenzo Pieralisi
2026-12-04 18:31   ` Robin Murphy
2026-12-04 18:19 ` Andy Shevchenko [this message]
2026-12-04 18:33   ` [PATCH RFC v2 0/9] ACPI: ARM64: Implement IRQ mapping probe deferral for static table devices Rafael J. Wysocki (Intel)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axMETGgCJy3ivXda@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=brgl@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=dakr@kernel.org \
    --cc=daniel.lezcano@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=guohanjun@huawei.com \
    --cc=leo.yan@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sudeep.holla@kernel.org \
    --cc=tglx@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox