* [PATCH v2] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
@ 2026-03-04 12:55 Rafael J. Wysocki
2026-04-03 16:09 ` Alexandre Belloni
2026-09-17 8:26 ` Philippe Schenker
0 siblings, 2 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2026-03-04 12:55 UTC (permalink / raw)
To: Linux ACPI; +Cc: LKML, Nathan Chancellor, Alexandre Belloni, linux-rtc
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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 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 (and
which is what the dropped PNP code did).
Fixes: d15f1c2e413e ("ACPI: PNP: Drop CMOS RTC PNP device support")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/linux-acpi/20260303060752.GA2749263@ax162/
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
v1 -> v2: Added tags, edited changelog
This is linux-next material.
---
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);
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
2026-03-04 12:55 [PATCH v2] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe() Rafael J. Wysocki
@ 2026-04-03 16:09 ` Alexandre Belloni
2026-09-17 8:26 ` Philippe Schenker
1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2026-04-03 16:09 UTC (permalink / raw)
To: Linux ACPI, Rafael J. Wysocki; +Cc: LKML, Nathan Chancellor, linux-rtc
On Wed, 04 Mar 2026 13:55:43 +0100, Rafael J. Wysocki wrote:
> 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 index 0, which
> is possible on x86 platforms.
>
> [...]
Applied, thanks!
[1/1] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
https://git.kernel.org/abelloni/c/92bad323175e
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
2026-03-04 12:55 [PATCH v2] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe() Rafael J. Wysocki
2026-04-03 16:09 ` Alexandre Belloni
@ 2026-09-17 8:26 ` Philippe Schenker
2026-09-17 8:49 ` Greg Kroah-Hartman
1 sibling, 1 reply; 4+ messages in thread
From: Philippe Schenker @ 2026-09-17 8:26 UTC (permalink / raw)
To: rafael, stable
Cc: Greg Kroah-Hartman, Sasha Levin, alexandre.belloni, linux-acpi,
linux-kernel, linux-rtc, nathan, regressions
[-- Attachment #1: Type: text/plain, Size: 1826 bytes --]
Hi,
this patch did not carry a Cc: stable tag, but the platform device
binding changes it fixes have meanwhile been backported to 6.18.y
(6.18.51), including:
ACPI: x86/rtc-cmos: Use platform device for driver binding
This fix was not backported with it, so 6.18.51 is now affected by
exactly the problem Nathan reported in
https://lore.kernel.org/linux-acpi/20260303060752.GA2749263@ax162/
On my HP ProBook 445 G8 (AMD) the boot log changed as follows:
6.18.49 (good):
rtc_cmos 00:00: alarms up to one month, y3k, 114 bytes nvram
6.18.51 (bad):
rtc_cmos PNP0B00:00: error -ENXIO: IRQ index 0 not found
rtc_cmos PNP0B00:00: no alarms, y3k, 114 bytes nvram
On stable this is more than a confusing message. Without an IRQ the
RTC has no alarm support, so CLOCK_BOOTTIME_ALARM is not available
and systemd (261) refuses suspend-then-hibernate:
systemd-logind: CLOCK_BOOTTIME_ALARM is not supported, can't
perform suspend-then-hibernate.
Call to SuspendThenHibernate failed: Sleep verb
'suspend-then-hibernate' is not configured or configuration is
not supported by kernel
Plain suspend and hibernate still work. RTC wake alarms are also
broken:
# rtcwake -m no -s 120
rtcwake: set rtc wake alarm failed: Invalid argument
The fix is in mainline since v7.0 as:
e9f850ba66cd ("rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()")
Stable team, could you please queue it for 6.18.y? Any other stable
series that received the rtc-cmos platform device binding backport
would need it as well.
#regzbot introduced: v6.18.49..v6.18.51
#regzbot title: rtc-cmos: no RTC alarms on x86 in 6.18.y after platform device binding backport
#regzbot fix: rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
Thanks,
Philippe
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 717 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
2026-09-17 8:26 ` Philippe Schenker
@ 2026-09-17 8:49 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-09-17 8:49 UTC (permalink / raw)
To: Philippe Schenker
Cc: rafael, stable, Sasha Levin, alexandre.belloni, linux-acpi,
linux-kernel, linux-rtc, nathan, regressions
On Thu, Sep 17, 2026 at 08:26:10AM +0000, Philippe Schenker wrote:
> Hi,
>
> this patch did not carry a Cc: stable tag, but the platform device
> binding changes it fixes have meanwhile been backported to 6.18.y
> (6.18.51), including:
>
> ACPI: x86/rtc-cmos: Use platform device for driver binding
>
> This fix was not backported with it, so 6.18.51 is now affected by
> exactly the problem Nathan reported in
>
> https://lore.kernel.org/linux-acpi/20260303060752.GA2749263@ax162/
>
> On my HP ProBook 445 G8 (AMD) the boot log changed as follows:
>
> 6.18.49 (good):
> rtc_cmos 00:00: alarms up to one month, y3k, 114 bytes nvram
>
> 6.18.51 (bad):
> rtc_cmos PNP0B00:00: error -ENXIO: IRQ index 0 not found
> rtc_cmos PNP0B00:00: no alarms, y3k, 114 bytes nvram
>
> On stable this is more than a confusing message. Without an IRQ the
> RTC has no alarm support, so CLOCK_BOOTTIME_ALARM is not available
> and systemd (261) refuses suspend-then-hibernate:
>
> systemd-logind: CLOCK_BOOTTIME_ALARM is not supported, can't
> perform suspend-then-hibernate.
> Call to SuspendThenHibernate failed: Sleep verb
> 'suspend-then-hibernate' is not configured or configuration is
> not supported by kernel
>
> Plain suspend and hibernate still work. RTC wake alarms are also
> broken:
>
> # rtcwake -m no -s 120
> rtcwake: set rtc wake alarm failed: Invalid argument
>
> The fix is in mainline since v7.0 as:
>
> e9f850ba66cd ("rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()")
>
> Stable team, could you please queue it for 6.18.y? Any other stable
> series that received the rtc-cmos platform device binding backport
> would need it as well.
It's already queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-17 8:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-04 12:55 [PATCH v2] rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe() Rafael J. Wysocki
2026-04-03 16:09 ` Alexandre Belloni
2026-09-17 8:26 ` Philippe Schenker
2026-09-17 8:49 ` Greg Kroah-Hartman
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®