LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch 2.6.24-git] rtc: avoid legacy drivers with generic framework
@ 2008-02-10 20:08 David Brownell
  2008-02-11  9:54 ` [rtc-linux] " Alessandro Zummo
  2008-03-08 19:19 ` David Brownell
  0 siblings, 2 replies; 3+ messages in thread
From: David Brownell @ 2008-02-10 20:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: rtc-linux, lkml, Ingo Molnar

Kconfig tweaks to help reduce RTC configuration bugs, by avoiding
legacy RTC drivers when the generic RTC framework is enabled:

 - If rtc-cmos is selected, disable the legacy rtc driver;

 - When using generic RTC on x86, enable rtc-cmos by default;

 - In the old "chardev RTC" section of Kconfig, add a comment
   warning people off these (seven) legacy RTC drivers when
   the generic framework is in use.

People can still use the legacy drivers if they want (or need) to.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
This doesn't fix the broken dependencies for the legacy "CMOS" RTC
driver.  Ideally it would be a full list of platforms where it works,
not a partial list of ones where it won't.  Or better yet, it would
depend on a "HAVE_CMOS_RTC" flag defined by various platforms ...
surely there's a Kconfig style guideline lurking there.

 drivers/char/Kconfig |    6 +++++-
 drivers/rtc/Kconfig  |    1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

--- g26.orig/drivers/char/Kconfig	2008-02-10 11:16:04.000000000 -0800
+++ g26/drivers/char/Kconfig	2008-02-10 11:30:21.000000000 -0800
@@ -704,9 +704,14 @@ config NVRAM
 	  To compile this driver as a module, choose M here: the
 	  module will be called nvram.
 
+comment "Avoid any legacy RTC drivers you may see here"
+	depends on RTC_LIB
+
 config RTC
 	tristate "Enhanced Real Time Clock Support"
-	depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390
+	depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV \
+			&& !ARM && !SUPERH && !S390 \
+			&& RTC_DRV_CMOS=n
 	---help---
 	  If you say Y here and create a character special file /dev/rtc with
 	  major number 10 and minor number 135 using mknod ("man mknod"), you
--- g26.orig/drivers/rtc/Kconfig	2008-02-10 11:16:04.000000000 -0800
+++ g26/drivers/rtc/Kconfig	2008-02-10 11:19:00.000000000 -0800
@@ -294,6 +294,7 @@ comment "Platform RTC drivers"
 config RTC_DRV_CMOS
 	tristate "PC-style 'CMOS'"
 	depends on X86 || ALPHA || ARM || M32R || ATARI || PPC || MIPS
+	default y if X86
 	help
 	  Say "yes" here to get direct support for the real time clock
 	  found in every PC or ACPI-based system, and some other boards.

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

* Re: [rtc-linux] [patch 2.6.24-git] rtc: avoid legacy drivers with generic framework
  2008-02-10 20:08 [patch 2.6.24-git] rtc: avoid legacy drivers with generic framework David Brownell
@ 2008-02-11  9:54 ` Alessandro Zummo
  2008-03-08 19:19 ` David Brownell
  1 sibling, 0 replies; 3+ messages in thread
From: Alessandro Zummo @ 2008-02-11  9:54 UTC (permalink / raw)
  Cc: david-b, Andrew Morton, lkml

On Sun, 10 Feb 2008 12:08:19 -0800
David Brownell <david-b@pacbell.net> wrote:

> Kconfig tweaks to help reduce RTC configuration bugs, by avoiding
> legacy RTC drivers when the generic RTC framework is enabled:
> 
>  - If rtc-cmos is selected, disable the legacy rtc driver;
> 
>  - When using generic RTC on x86, enable rtc-cmos by default;
> 
>  - In the old "chardev RTC" section of Kconfig, add a comment
>    warning people off these (seven) legacy RTC drivers when
>    the generic framework is in use.
> 
> People can still use the legacy drivers if they want (or need) to.
> 
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

 Acked-by: Alessandro Zummo <a.zummo@towertech.it>

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


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

* Re: [patch 2.6.24-git] rtc: avoid legacy drivers with generic framework
  2008-02-10 20:08 [patch 2.6.24-git] rtc: avoid legacy drivers with generic framework David Brownell
  2008-02-11  9:54 ` [rtc-linux] " Alessandro Zummo
@ 2008-03-08 19:19 ` David Brownell
  1 sibling, 0 replies; 3+ messages in thread
From: David Brownell @ 2008-03-08 19:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: rtc-linux, lkml, Ingo Molnar, Pavel Machek

On Sunday 10 February 2008, David Brownell wrote:
> Kconfig tweaks to help reduce RTC configuration bugs, by avoiding
> legacy RTC drivers when the generic RTC framework is enabled:
> 
>  - If rtc-cmos is selected, disable the legacy rtc driver;
> 
>  - When using generic RTC on x86, enable rtc-cmos by default;
> 
>  - In the old "chardev RTC" section of Kconfig, add a comment
>    warning people off these (seven) legacy RTC drivers when
>    the generic framework is in use.
> 
> People can still use the legacy drivers if they want (or need) to.
> 
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> 	...

Here's an update to that patch, which is in MMOTM with the name

	rtc-avoid-legacy-drivers-with-generic-framework.patch

=======
This is a harsher fix for the problems of trying to make legacy
RTCs coexist with the generic RTC framework:  Just Don't Do It.

The legacy drivers are not geared towards coexistence; they
never had a reason to try.  So rather than accumulating more
and more special cases, and gently nudging users away from the
old code, make it be an either/or choice.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
 drivers/char/Kconfig |   12 ++++++++----
 drivers/rtc/Kconfig  |    4 ----
 2 files changed, 8 insertions(+), 8 deletions(-)

--- g26.orig/drivers/char/Kconfig	2008-03-07 13:28:53.000000000 -0800
+++ g26/drivers/char/Kconfig	2008-03-07 13:35:07.000000000 -0800
@@ -704,14 +704,16 @@ config NVRAM
 	  To compile this driver as a module, choose M here: the
 	  module will be called nvram.
 
-comment "Avoid any legacy RTC drivers you may see here"
-	depends on RTC_LIB
+#
+# These legacy RTC drivers just cause too many conflicts with the generic
+# RTC framework ... let's not even try to coexist any more.
+#
+if RTC_LIB=n
 
 config RTC
 	tristate "Enhanced Real Time Clock Support"
 	depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV \
-			&& !ARM && !SUPERH && !S390 \
-			&& RTC_DRV_CMOS=n
+			&& !ARM && !SUPERH && !S390
 	---help---
 	  If you say Y here and create a character special file /dev/rtc with
 	  major number 10 and minor number 135 using mknod ("man mknod"), you
@@ -817,6 +819,8 @@ config DS1302
 	  will get access to the real time clock (or hardware clock) built
 	  into your computer.
 
+endif # RTC_LIB
+
 config COBALT_LCD
 	bool "Support for Cobalt LCD"
 	depends on MIPS_COBALT
--- g26.orig/drivers/rtc/Kconfig	2008-03-07 13:28:53.000000000 -0800
+++ g26/drivers/rtc/Kconfig	2008-03-07 13:31:28.000000000 -0800
@@ -20,10 +20,6 @@ menuconfig RTC_CLASS
 
 if RTC_CLASS
 
-if GEN_RTC || RTC
-comment "Conflicting RTC option has been selected, check GEN_RTC and RTC"
-endif
-
 config RTC_HCTOSYS
 	bool "Set system time from RTC on startup and resume"
 	depends on RTC_CLASS = y

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

end of thread, other threads:[~2008-03-08 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-10 20:08 [patch 2.6.24-git] rtc: avoid legacy drivers with generic framework David Brownell
2008-02-11  9:54 ` [rtc-linux] " Alessandro Zummo
2008-03-08 19:19 ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).