All of lore.kernel.org
 help / color / mirror / Atom feed
* - x86-provide-rtc_cmos-platform-device.patch removed from -mm tree
@ 2008-05-21 23:34 akpm
  2008-05-23  5:02 ` [patch] provide rtc_cmos platform device, take 2 Stas Sergeev
  2008-05-27 11:23 ` [patch][resend] " Stas Sergeev
  0 siblings, 2 replies; 11+ messages in thread
From: akpm @ 2008-05-21 23:34 UTC (permalink / raw)
  To: stsp, ambx1, bjorn.helgaas, david-b, mingo, stable, tglx,
	mm-commits


The patch titled
     x86: provide rtc_cmos platform device
has been removed from the -mm tree.  Its filename was
     x86-provide-rtc_cmos-platform-device.patch

This patch was dropped because an updated version will be merged

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: x86: provide rtc_cmos platform device
From: Stas Sergeev <stsp@aknet.ru>

Recently (around 2.6.25) I've noticed that RTC no longer works for me.  It
turned out this is because I use pnpacpi=off kernel option to work around
the parport_pc bugs.  I always did so, but RTC used to work fine in the
past, and now it have regressed.

The attached patch fixes the problem by creating the platform device for
the RTC when PNP is disabled.  This may also help running the PNP-enabled
kernel on an older PCs.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
Cc: David Brownell <david-b@pacbell.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/kernel/rtc.c  |   31 +++++++++++++++++++++++++++++++
 drivers/rtc/rtc-cmos.c |   26 +++++++++-----------------
 include/asm-x86/rtc.h  |    4 ++++
 3 files changed, 44 insertions(+), 17 deletions(-)

diff -puN arch/x86/kernel/rtc.c~x86-provide-rtc_cmos-platform-device arch/x86/kernel/rtc.c
--- a/arch/x86/kernel/rtc.c~x86-provide-rtc_cmos-platform-device
+++ a/arch/x86/kernel/rtc.c
@@ -4,9 +4,12 @@
 #include <linux/acpi.h>
 #include <linux/bcd.h>
 #include <linux/mc146818rtc.h>
+#include <linux/platform_device.h>
+#include <linux/pnp.h>
 
 #include <asm/time.h>
 #include <asm/vsyscall.h>
+#include <asm/rtc.h>
 
 #ifdef CONFIG_X86_32
 /*
@@ -197,3 +200,31 @@ unsigned long long native_read_tsc(void)
 }
 EXPORT_SYMBOL(native_read_tsc);
 
+
+static struct resource rtc_resources[] = {
+	[0] = {
+		.start	= RTC_PORT_START,
+		.end	= RTC_PORT_END,
+		.flags	= IORESOURCE_IO,
+	},
+	[1] = {
+		.start	= RTC_IRQ,
+		.end	= RTC_IRQ,
+		.flags	= IORESOURCE_IRQ,
+	}
+};
+
+static struct platform_device rtc_device = {
+	.name		= "rtc_cmos",
+	.id		= -1,
+	.resource	= rtc_resources,
+	.num_resources	= ARRAY_SIZE(rtc_resources),
+};
+
+static __init int add_rtc_cmos(void)
+{
+	if (!pnp_platform_devices)
+		platform_device_register(&rtc_device);
+	return 0;
+}
+device_initcall(add_rtc_cmos);
diff -puN drivers/rtc/rtc-cmos.c~x86-provide-rtc_cmos-platform-device drivers/rtc/rtc-cmos.c
--- a/drivers/rtc/rtc-cmos.c~x86-provide-rtc_cmos-platform-device
+++ a/drivers/rtc/rtc-cmos.c
@@ -905,19 +905,7 @@ static struct pnp_driver cmos_pnp_driver
 	.resume		= cmos_pnp_resume,
 };
 
-static int __init cmos_init(void)
-{
-	return pnp_register_driver(&cmos_pnp_driver);
-}
-module_init(cmos_init);
-
-static void __exit cmos_exit(void)
-{
-	pnp_unregister_driver(&cmos_pnp_driver);
-}
-module_exit(cmos_exit);
-
-#else	/* no PNP */
+#endif	/* CONFIG_PNP */
 
 /*----------------------------------------------------------------*/
 
@@ -958,20 +946,24 @@ static struct platform_driver cmos_platf
 
 static int __init cmos_init(void)
 {
-	return platform_driver_probe(&cmos_platform_driver,
+	if (pnp_platform_devices)
+		return pnp_register_driver(&cmos_pnp_driver);
+	else
+		return platform_driver_probe(&cmos_platform_driver,
 			cmos_platform_probe);
 }
 module_init(cmos_init);
 
 static void __exit cmos_exit(void)
 {
-	platform_driver_unregister(&cmos_platform_driver);
+	if (pnp_platform_devices)
+		pnp_unregister_driver(&cmos_pnp_driver);
+	else
+		platform_driver_unregister(&cmos_platform_driver);
 }
 module_exit(cmos_exit);
 
 
-#endif	/* !PNP */

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-06-02  9:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 23:34 - x86-provide-rtc_cmos-platform-device.patch removed from -mm tree akpm
2008-05-23  5:02 ` [patch] provide rtc_cmos platform device, take 2 Stas Sergeev
2008-05-27 11:23 ` [patch][resend] " Stas Sergeev
2008-05-28 23:36   ` Andrew Morton
2008-05-29  4:52     ` Stas Sergeev
2008-05-29 14:54     ` Bjorn Helgaas
2008-05-30  4:12       ` Stas Sergeev
2008-05-30 15:52         ` Bjorn Helgaas
2008-06-02  9:46       ` Ingo Molnar
2008-06-02  9:53     ` Russell King
2008-05-29  6:27   ` David Brownell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.