[PATCH v1 6/8] x86: rtc: Drop PNP device check

Rafael J. Wysocki posted 8 patches 1 month, 1 week ago
[PATCH v1 6/8] x86: rtc: Drop PNP device check
Posted by Rafael J. Wysocki 1 month, 1 week ago
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

Previous changes effectively prevented PNP devices from being created
for the CMOS RTC on x86 with ACPI.

Although in principle a CMOS RTC PNP device may exist on an x86 system
without ACPI (that is, an x86 system where there is no ACPI at all, not
one booted with ACPI disabled), such systems were there in the field ~30
years ago and most likely they would not be able to run a contemporary
Linux kernel.

For the above reasons, drop the PNP device check from add_rtc_cmos().

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 arch/x86/kernel/rtc.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c
index b112178e8185..314b062a15de 100644
--- a/arch/x86/kernel/rtc.c
+++ b/arch/x86/kernel/rtc.c
@@ -6,7 +6,6 @@
 #include <linux/platform_device.h>
 #include <linux/mc146818rtc.h>
 #include <linux/export.h>
-#include <linux/pnp.h>
 
 #include <asm/vsyscall.h>
 #include <asm/x86_init.h>
@@ -134,19 +133,6 @@ static struct platform_device rtc_device = {
 
 static __init int add_rtc_cmos(void)
 {
-#ifdef CONFIG_PNP
-	static const char * const ids[] __initconst =
-	    { "PNP0b00", "PNP0b01", "PNP0b02", };
-	struct pnp_dev *dev;
-	int i;
-
-	pnp_for_each_dev(dev) {
-		for (i = 0; i < ARRAY_SIZE(ids); i++) {
-			if (compare_pnp_id(dev->id, ids[i]) != 0)
-				return 0;
-		}
-	}
-#endif
 	if (cmos_rtc_platform_device_present)
 		return 0;
 
@@ -154,8 +140,7 @@ static __init int add_rtc_cmos(void)
 		return -ENODEV;
 
 	platform_device_register(&rtc_device);
-	dev_info(&rtc_device.dev,
-		 "registered platform RTC device (no PNP device found)\n");
+	dev_info(&rtc_device.dev, "registered fallback platform RTC device\n");
 
 	return 0;
 }
-- 
2.51.0
Re: [PATCH v1 6/8] x86: rtc: Drop PNP device check
Posted by Dave Hansen 1 month, 1 week ago
On 2/23/26 07:31, Rafael J. Wysocki wrote:
> Previous changes effectively prevented PNP devices from being created
> for the CMOS RTC on x86 with ACPI.
> 
> Although in principle a CMOS RTC PNP device may exist on an x86 system
> without ACPI (that is, an x86 system where there is no ACPI at all, not
> one booted with ACPI disabled), such systems were there in the field ~30
> years ago and most likely they would not be able to run a contemporary
> Linux kernel.
> 
> For the above reasons, drop the PNP device check from add_rtc_cmos().

If someone had one of these devices, what would they see after applying
this? Would they just not be able to detect the RTC any longer?

In any case, this does seem obscure enough to not worry about any more:

Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # x86
Re: [PATCH v1 6/8] x86: rtc: Drop PNP device check
Posted by Rafael J. Wysocki 1 month, 1 week ago
On Wed, Feb 25, 2026 at 7:01 PM Dave Hansen <dave.hansen@intel.com> wrote:
>
> On 2/23/26 07:31, Rafael J. Wysocki wrote:
> > Previous changes effectively prevented PNP devices from being created
> > for the CMOS RTC on x86 with ACPI.
> >
> > Although in principle a CMOS RTC PNP device may exist on an x86 system
> > without ACPI (that is, an x86 system where there is no ACPI at all, not
> > one booted with ACPI disabled), such systems were there in the field ~30
> > years ago and most likely they would not be able to run a contemporary
> > Linux kernel.
> >
> > For the above reasons, drop the PNP device check from add_rtc_cmos().
>
> If someone had one of these devices, what would they see after applying
> this? Would they just not be able to detect the RTC any longer?

No, add_rtc_cmos() would just create a fallback platform device for
the CMOS RTC AFAICS and the driver would pick up that one.

> In any case, this does seem obscure enough to not worry about any more:
>
> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # x86

Thanks!