public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] don't reset alarm interrupt on RTC
@ 2001-10-31 22:08 Tim Hockin
  2001-10-31 22:13 ` Patrick Mochel
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Hockin @ 2001-10-31 22:08 UTC (permalink / raw)
  To: p_gortmaker, Linux Kernel Mailing List, torvalds, alan

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

All,

Attached is a 1-liner to not clear the Alarm-Int-Enable bit automatically
on the RTC device.  This makes wake-on-alarm possible.

Please let me know if there is a problem with it.  This is against 2.4.13
for inclusion in 2.4.14.

Tim
-- 
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com

[-- Attachment #2: drivers_char_rtc.c.diff --]
[-- Type: text/plain, Size: 427 bytes --]

diff -ruN dist-2.4.13+patches/drivers/char/rtc.c linux-2.4/drivers/char/rtc.c
--- dist-2.4.13+patches/drivers/char/rtc.c	Mon Oct  1 16:43:52 2001
+++ linux-2.4/drivers/char/rtc.c	Mon Oct 29 11:07:42 2001
@@ -560,7 +560,7 @@
 	spin_lock_irq(&rtc_lock);
 	tmp = CMOS_READ(RTC_CONTROL);
 	tmp &=  ~RTC_PIE;
-	tmp &=  ~RTC_AIE;
+	//tmp &=  ~RTC_AIE;
 	tmp &=  ~RTC_UIE;
 	CMOS_WRITE(tmp, RTC_CONTROL);
 	CMOS_READ(RTC_INTR_FLAGS);

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

* Re: [PATCH] don't reset alarm interrupt on RTC
  2001-10-31 22:08 [PATCH] don't reset alarm interrupt on RTC Tim Hockin
@ 2001-10-31 22:13 ` Patrick Mochel
  2001-10-31 22:34   ` Tim Hockin
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Mochel @ 2001-10-31 22:13 UTC (permalink / raw)
  To: Tim Hockin; +Cc: p_gortmaker, Linux Kernel Mailing List, torvalds, alan


On Wed, 31 Oct 2001, Tim Hockin wrote:

> All,
>
> Attached is a 1-liner to not clear the Alarm-Int-Enable bit automatically
> on the RTC device.  This makes wake-on-alarm possible.
>
> Please let me know if there is a problem with it.  This is against 2.4.13
> for inclusion in 2.4.14.
>
> Tim
>

diff -ruN dist-2.4.13+patches/drivers/char/rtc.c
linux-2.4/drivers/char/rtc.c
--- dist-2.4.13+patches/drivers/char/rtc.c      Mon Oct  1 16:43:52 2001
+++ linux-2.4/drivers/char/rtc.c        Mon Oct 29 11:07:42 2001
@@ -560,7 +560,7 @@
        spin_lock_irq(&rtc_lock);
        tmp = CMOS_READ(RTC_CONTROL);
        tmp &=  ~RTC_PIE;
-       tmp &=  ~RTC_AIE;
+       //tmp &=  ~RTC_AIE;
        tmp &=  ~RTC_UIE;
        CMOS_WRITE(tmp, RTC_CONTROL);
        CMOS_READ(RTC_INTR_FLAGS);

Why would you want to unconditionally enable this interrupt?

And how do you set the alarm time?

I implmemented Wake-on-alarm for the ACPI suspend case. The way I did it
was to implement a procfs handler that set the alarm time and enabled the
interrupt. I fantasized about porting it to the RTC procfs handler, but I
never got around to it. The ACPI list archives should have more info/clues
about it..

But, I don't think this should be enabled by default.

	-pat


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

* Re: [PATCH] don't reset alarm interrupt on RTC
  2001-10-31 22:13 ` Patrick Mochel
@ 2001-10-31 22:34   ` Tim Hockin
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Hockin @ 2001-10-31 22:34 UTC (permalink / raw)
  To: Patrick Mochel; +Cc: Linux Kernel Mailing List, torvalds, alan, p_gortmaker

Patrick Mochel wrote:

> -       tmp &=  ~RTC_AIE;
> +       //tmp &=  ~RTC_AIE;
>         tmp &=  ~RTC_UIE;
>         CMOS_WRITE(tmp, RTC_CONTROL);
>         CMOS_READ(RTC_INTR_FLAGS);
 
> Why would you want to unconditionally enable this interrupt?

We don't unconditionally set it, we just leave it enabled (the code was
uncoditionally UNsetting it).  There are ioctl()s to set/unset PIE, AIE,
UIE.

> And how do you set the alarm time?

ioctl(fd, RTC_ALM_SET);
 
> But, I don't think this should be enabled by default.

if anything, our patch is not correct ENOUGH.  none of AIE, PIE, or UIE,
should be molested by rtc_release().

-- 
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com

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

end of thread, other threads:[~2001-10-31 22:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-31 22:08 [PATCH] don't reset alarm interrupt on RTC Tim Hockin
2001-10-31 22:13 ` Patrick Mochel
2001-10-31 22:34   ` Tim Hockin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox