linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled
@ 2007-01-06  4:55 David Brownell
  2007-01-06 18:49 ` Paul Mundt
  2007-01-11 11:40 ` Jamie Lenehan
  0 siblings, 2 replies; 3+ messages in thread
From: David Brownell @ 2007-01-06  4:55 UTC (permalink / raw)
  To: Alessandro Zummo, Paul Mundt, lenehan; +Cc: Linux Kernel list, rtc-linux

This fixes the SH rtc driver to
  (a) correctly report 'enabled' status with other alarm status;
  (b) not duplicate that status in its procfs dump

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

---
An audit of the RTC driver treatment of the "enabled" flag turned
up a handful of clear bugs; most drivers handle it the same now
(assuming they support alarms).

This driver has another issue:  sh_rtc_set_alarm() ignores the
"enabled" flag, rather than using it to tell whether the alarm
should be enabled on exit from that routine.  One at a time.  :)

Index: at91/drivers/rtc/rtc-sh.c
===================================================================
--- at91.orig/drivers/rtc/rtc-sh.c	2006-12-18 23:32:22.000000000 -0800
+++ at91/drivers/rtc/rtc-sh.c	2006-12-18 23:34:37.000000000 -0800
@@ -264,8 +264,6 @@ static int sh_rtc_proc(struct device *de
 	unsigned int tmp;
 
 	tmp = readb(rtc->regbase + RCR1);
-	seq_printf(seq, "alarm_IRQ\t: %s\n",
-		   (tmp & RCR1_AIE) ? "yes" : "no");
 	seq_printf(seq, "carry_IRQ\t: %s\n",
 		   (tmp & RCR1_CIE) ? "yes" : "no");
 
@@ -428,6 +426,8 @@ static int sh_rtc_read_alarm(struct devi
 		tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */
 	tm->tm_year     = 0xffff;
 
+	wkalrm->enabled = (readb(rtc->regbase + RCR1) & RCR1_AIE) ? 1 : 0;
+
 	spin_unlock_irq(&rtc->lock);
 
 	return 0;

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

* Re: [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled
  2007-01-06  4:55 [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled David Brownell
@ 2007-01-06 18:49 ` Paul Mundt
  2007-01-11 11:40 ` Jamie Lenehan
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2007-01-06 18:49 UTC (permalink / raw)
  To: David Brownell; +Cc: Alessandro Zummo, lenehan, Linux Kernel list, rtc-linux

On Fri, Jan 05, 2007 at 08:55:05PM -0800, David Brownell wrote:
> This fixes the SH rtc driver to
>   (a) correctly report 'enabled' status with other alarm status;
>   (b) not duplicate that status in its procfs dump
> 
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> 
Looks good, thanks David.

Acked-by: Paul Mundt <lethal@linux-sh.org>

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

* Re: [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled
  2007-01-06  4:55 [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled David Brownell
  2007-01-06 18:49 ` Paul Mundt
@ 2007-01-11 11:40 ` Jamie Lenehan
  1 sibling, 0 replies; 3+ messages in thread
From: Jamie Lenehan @ 2007-01-11 11:40 UTC (permalink / raw)
  To: David Brownell, Alessandro Zummo, Paul Mundt, Linux Kernel list,
	rtc-linux

On Fri, Jan 05, 2007 at 08:55:05PM -0800, David Brownell wrote:
[...]
> An audit of the RTC driver treatment of the "enabled" flag turned
> up a handful of clear bugs; most drivers handle it the same now

Yeah, I missed the existing of the enabled flag when I added alarm
support to the driver. Your patch is fine.

> This driver has another issue:  sh_rtc_set_alarm() ignores the
> "enabled" flag, rather than using it to tell whether the alarm
> should be enabled on exit from that routine.  One at a time.  :)

I'll can take care of this.

-- 
 Jamie Lenehan <lenehan@twibble.org>

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

end of thread, other threads:[~2007-01-11 11:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-06  4:55 [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled David Brownell
2007-01-06 18:49 ` Paul Mundt
2007-01-11 11:40 ` Jamie Lenehan

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).