Re: [PATCH RFC v2 5/9] clocksource/drivers/arm_arch_timer_mmio: Implement arch mem timer deferred probe

From: Andy Shevchenko

Date: Fri Dec 04 2026 - 13:17:33 EST


On Mon, Nov 30, 2026 at 09:54:37AM +0100, Lorenzo Pieralisi wrote:
> Resolving the arch mem timer IRQ on ACPI systems might require
> two-steps if the IRQ is wired to an interrupt controller whose
> driver has not probed yet at the time the IRQ mapping is carried
> out through acpi_register_gsi(), which would result in an
> -EPROBE_DEFER return value that in turn should trigger a
> driver probe deferral.
>
> Instead of trying to map an IRQ when the arch mem timer device is
> created, stash the GSIs number and flag values in the arch_timer_mem_frame
> data structure and use it at driver probe time to map the GSIs.
>
> Add -EPROBE_DEFER handling to the arch mem timer driver so
> that it can cope with GSIs that are routed to interrupt controllers
> whose driver has not yet probed at the time acpi_register_gsi() is
> invoked.

...

> +#ifdef CONFIG_ACPI
> +static int arch_timer_mmio_map_gsi(struct platform_device *pdev, u32 gsi,
> + u32 flags, int *irq)
> +{
> + int trigger, polarity, ret;
> +
> + if (!gsi || *irq)
> + return 0;
> +
> + trigger = (flags & ACPI_GTDT_INTERRUPT_MODE) ? ACPI_EDGE_SENSITIVE
> + : ACPI_LEVEL_SENSITIVE;
> + polarity = (flags & ACPI_GTDT_INTERRUPT_POLARITY) ? ACPI_ACTIVE_LOW
> + : ACPI_ACTIVE_HIGH;
> +
> + ret = acpi_register_gsi(&pdev->dev, gsi, trigger, polarity);
> + if (ret < 0)
> + return ret;
> +
> + *irq = ret;
> +
> + return 0;
> +}

This is almost a dup of map_gt_gsi(). Can you deduplicate?

--
With Best Regards,
Andy Shevchenko