Re: [PATCH v1 4/8] ACPI: x86/rtc-cmos: Use platform device for driver binding
From: Rafael J. Wysocki
Date: Tue Mar 03 2026 - 13:48:29 EST
On Tue, Mar 3, 2026 at 6:52 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> On Tue, Mar 03, 2026 at 01:51:37PM +0100, Rafael J. Wysocki wrote:
> > On Tuesday, March 3, 2026 7:07:52 AM CET Nathan Chancellor wrote:
> > > After this change in -next as commit 2a78e4210444 ("ACPI: x86/rtc-cmos:
> > > Use platform device for driver binding"), I am seeing
> > >
> > > rtc_cmos PNP0B00:00: error -ENXIO: IRQ index 0 not found
> > >
> > > on a few of my test machines. Is this expected?
> >
> > Not really, thanks for reporting!
> >
> > Please send me a dmesg boot log from one of the affected systems.
>
> Attached.
>
> > The patch below should make the message go away.
>
> Can confirm, thanks! If it is helpful:
>
> Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Thank you!
Can you please also send me a dmesg boot log from the same system with
this patch applied?
> > ---
> > From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> > Subject: [PATCH v1] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
> >
> > The rtc-cmos driver can live without an IRQ and returning an error
> > code from platform_get_irq() is not a problem for it in general, so
> > make it call platform_get_irq_optional() in cmos_platform_probe()
> > instead of platform_get_irq() to avoid a confusing error message
> > printed by the latter if an IRQ cannot be found for IRQ index 0,
> > which is possible on x86 platforms.
> >
> > Additionally, on x86, if the IRQ is not defined and the system has
> > a legacy PIC, hardcode it to RTC_IRQ, which should be safe then.
> >
> > Fixes: 2a78e4210444 ("ACPI: x86/rtc-cmos: Use platform device for driver binding")
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> > ---
> > drivers/rtc/rtc-cmos.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > --- a/drivers/rtc/rtc-cmos.c
> > +++ b/drivers/rtc/rtc-cmos.c
> > @@ -1423,9 +1423,18 @@ static int __init cmos_platform_probe(st
> > resource = platform_get_resource(pdev, IORESOURCE_IO, 0);
> > else
> > resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - irq = platform_get_irq(pdev, 0);
> > - if (irq < 0)
> > + irq = platform_get_irq_optional(pdev, 0);
> > + if (irq < 0) {
> > irq = -1;
> > +#ifdef CONFIG_X86
> > + /*
> > + * On some x86 systems, the IRQ is not defined, but it should
> > + * always be safe to hardcode it on systems with a legacy PIC.
> > + */
> > + if (nr_legacy_irqs())
> > + irq = RTC_IRQ;
> > +#endif
> > + }
> >
> > return cmos_do_probe(&pdev->dev, resource, irq);
> > }
> >
> >
> >