From nobody Sun Apr 5 20:03:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B2222EAB61; Mon, 23 Feb 2026 15:33:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771860830; cv=none; b=EztXPDwNrzHpp2iR2yRr0e+rReeRta+VeEHfI7T0VXLiVnIhvFcvWdZfZ1H+Cf7J+LpgEvvmh2zyk+gmQjDuuZtgOabaU2T5UqnMmwRQTrF1gnk+GQbQJ0lF82cRxqedwpnoFATresleKD/ds6V4mgbTBM0YMi52oay1km9AU0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771860830; c=relaxed/simple; bh=KUh/wdz4o/ak+NTW79FlOzH8EePib+aTr/uBTxCk+IA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XdoaM0ZfsCOxXoEyqofAC61/xwKvZcbpobc9kEDo8xtvzQ3Vz/aDhKruMOHKJjLRCkdJvfY4gK+jstAdanOazz+tLSRwIQWQ0qRZJaCeXD2tO+3/jVebGNXPylu4DDSSW6J9Z12g76qUB7VTA2RrvjU0W+bPdeCOk4TGT716RPA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pf8Md06/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pf8Md06/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3831C116D0; Mon, 23 Feb 2026 15:33:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771860830; bh=KUh/wdz4o/ak+NTW79FlOzH8EePib+aTr/uBTxCk+IA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pf8Md06/Q/l8qVSOoeCOVhy1dRTHrIG1aJ11y2r6uj6BEOdRy/mguEjrB/FvCaNUq wf0e3+iPhd0DW0eHFscsQPNgRk5yJFf6utdOzXbwDhL4zEsBJY42MUjpLFG0EZq7WG TnPC8rwTaYDiB6lmM7yeqcbEPyUDSVNe5+tzGW0FDQP45gM/+S1elPD8DneDZuDwAM 3pFiJZMbaBv07nWoPHfvG1FljKX/I6O/TLvO2f8IypJFdiMeoZ8fsBeqVQXiK6Qj1I ENLdnma+td7XkLxqHBav67DLDIt9PRyF3S0+ws7mVJfLT5Lve666GL5wnppLAUVgMU ewlhjSuVEaxtw== From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , x86 Maintainers , linux-rtc@vger.kernel.org, Alexandre Belloni Subject: [PATCH v1 7/8] rtc: cmos: Drop PNP device support Date: Mon, 23 Feb 2026 16:32:29 +0100 Message-ID: <2355012.iZASKD2KPV@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <5983325.DvuYhMxLoT@rafael.j.wysocki> References: <5983325.DvuYhMxLoT@rafael.j.wysocki> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Rafael J. Wysocki" 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 support from the rtc-cmos driver. Signed-off-by: Rafael J. Wysocki Acked-by: Alexandre Belloni --- drivers/rtc/rtc-cmos.c | 113 +++-------------------------------------- 1 file changed, 8 insertions(+), 105 deletions(-) diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 7457f42fd6f0..9ac5bab846c1 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -1370,85 +1370,6 @@ static int __maybe_unused cmos_resume(struct device = *dev) =20 static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume); =20 -/*----------------------------------------------------------------*/ - -/* On non-x86 systems, a "CMOS" RTC lives most naturally on platform_bus. - * ACPI systems always list these as PNPACPI devices, and pre-ACPI PCs - * probably list them in similar PNPBIOS tables; so PNP is more common. - * - * We don't use legacy "poke at the hardware" probing. Ancient PCs that - * predate even PNPBIOS should set up platform_bus devices. - */ - -#ifdef CONFIG_PNP - -#include - -static int cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id = *id) -{ - int irq; - - if (pnp_port_start(pnp, 0) =3D=3D 0x70 && !pnp_irq_valid(pnp, 0)) { - irq =3D 0; -#ifdef CONFIG_X86 - /* Some machines contain a PNP entry for the RTC, but - * don't define the IRQ. It should always be safe to - * hardcode it on systems with a legacy PIC. - */ - if (nr_legacy_irqs()) - irq =3D RTC_IRQ; -#endif - } else { - irq =3D pnp_irq(pnp, 0); - } - - return cmos_do_probe(&pnp->dev, pnp_get_resource(pnp, IORESOURCE_IO, 0), = irq); -} - -static void cmos_pnp_remove(struct pnp_dev *pnp) -{ - cmos_do_remove(&pnp->dev); -} - -static void cmos_pnp_shutdown(struct pnp_dev *pnp) -{ - struct device *dev =3D &pnp->dev; - struct cmos_rtc *cmos =3D dev_get_drvdata(dev); - - if (system_state =3D=3D SYSTEM_POWER_OFF) { - int retval =3D cmos_poweroff(dev); - - if (cmos_aie_poweroff(dev) < 0 && !retval) - return; - } - - cmos_do_shutdown(cmos->irq); -} - -static const struct pnp_device_id rtc_ids[] =3D { - { .id =3D "PNP0b00", }, - { .id =3D "PNP0b01", }, - { .id =3D "PNP0b02", }, - { }, -}; -MODULE_DEVICE_TABLE(pnp, rtc_ids); - -static struct pnp_driver cmos_pnp_driver =3D { - .name =3D driver_name, - .id_table =3D rtc_ids, - .probe =3D cmos_pnp_probe, - .remove =3D cmos_pnp_remove, - .shutdown =3D cmos_pnp_shutdown, - - /* flag ensures resume() gets called, and stops syslog spam */ - .flags =3D PNP_DRIVER_RES_DO_NOT_CHANGE, - .driver =3D { - .pm =3D &cmos_pm_ops, - }, -}; - -#endif /* CONFIG_PNP */ - #ifdef CONFIG_OF static const struct of_device_id of_cmos_match[] =3D { { @@ -1543,45 +1464,27 @@ static struct platform_driver cmos_platform_driver = =3D { } }; =20 -#ifdef CONFIG_PNP -static bool pnp_driver_registered; -#endif static bool platform_driver_registered; =20 static int __init cmos_init(void) { - int retval =3D 0; + int retval; =20 -#ifdef CONFIG_PNP - retval =3D pnp_register_driver(&cmos_pnp_driver); - if (retval =3D=3D 0) - pnp_driver_registered =3D true; -#endif + if (cmos_rtc.dev) + return 0; =20 - if (!cmos_rtc.dev) { - retval =3D platform_driver_probe(&cmos_platform_driver, - cmos_platform_probe); - if (retval =3D=3D 0) - platform_driver_registered =3D true; - } + retval =3D platform_driver_probe(&cmos_platform_driver, cmos_platform_pro= be); + if (retval) + return retval; =20 - if (retval =3D=3D 0) - return 0; + platform_driver_registered =3D true; =20 -#ifdef CONFIG_PNP - if (pnp_driver_registered) - pnp_unregister_driver(&cmos_pnp_driver); -#endif - return retval; + return 0; } module_init(cmos_init); =20 static void __exit cmos_exit(void) { -#ifdef CONFIG_PNP - if (pnp_driver_registered) - pnp_unregister_driver(&cmos_pnp_driver); -#endif if (platform_driver_registered) platform_driver_unregister(&cmos_platform_driver); } --=20 2.51.0