lkml.org 
[lkml]   [2008]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Solid freezes with 2.6.25
Hi,

* Gabor Gombas <gombasg@sztaki.hu> [2008-05-07 15:42]:
>
> On Wed, May 07, 2008 at 02:45:20PM +0200, Bernhard Walle wrote:
>
> > You can log it to a file or output it over serial console. Or make the
> > window sticky. ;)
>
> Well, the machine hung and I was on a different virtual desktop. The
> output of the script together with netconsole output is below. Right now
> I don't have another machine that could be used for serial console.

Well, can you try if that really not happens without
CONFIG_HPET_EMULATE_RTC? The question is if that 64 interrupts per second really
cause a machine hang ...

However, the other question is why you get that RTC interrupts at all.
I compared the old RTC implementation (drivers/char/rtc.c) with the new
RTC interface (rtc-cmos.c) and the old implementation disables
interrupts automatically when the device is closed in userspace while
the new doesn't. I think the old one makes more sense, and so I think
the following patch should be applied. Gabor, can you also test that
patch ... it should fix your problem.

For debugging purposes it makes sense to apply the debug patch also (the
printk() in the interrupt handler). It should not conflict.


Bernhard



From: Bernhard Walle <bwalle@suse.de>
Subject: [PATCH] Disable RTC interrupts when closing the device

This patch disables RTC for rtc_cmos interrupts when the /dev/rtcX is closed.
Previously, the userspace program explicitely had to call ioctl(RTC_..._OFF).

This is the same behaviour as the old drivers/char/rtc.c driver. Especially
when using the HPET emulation which uses a timer frequency of 64 Hz by default
it makes sense to disable this interrupts.


Signed-off-by: Bernhard Walle <bwalle@suse.de>

---
drivers/rtc/rtc-cmos.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -302,6 +302,23 @@ static int cmos_irq_set_state(struct dev
return 0;
}

+static void
+cmos_rtc_release(struct device *dev)
+{
+ unsigned char tmp;
+
+ spin_lock_irq(&rtc_lock);
+ if (!hpet_mask_rtc_irq_bit(RTC_PIE | RTC_AIE | RTC_UIE)) {
+ tmp = CMOS_READ(RTC_CONTROL);
+ tmp &= ~RTC_PIE;
+ tmp &= ~RTC_AIE;
+ tmp &= ~RTC_UIE;
+ CMOS_WRITE(tmp, RTC_CONTROL);
+ CMOS_READ(RTC_INTR_FLAGS);
+ }
+ spin_unlock_irq(&rtc_lock);
+}
+
#if defined(CONFIG_RTC_INTF_DEV) || defined(CONFIG_RTC_INTF_DEV_MODULE)

static int
@@ -409,6 +426,7 @@ static int cmos_procfs(struct device *de

static const struct rtc_class_ops cmos_rtc_ops = {
.ioctl = cmos_rtc_ioctl,
+ .release = cmos_rtc_release,
.read_time = cmos_read_time,
.set_time = cmos_set_time,
.read_alarm = cmos_read_alarm,








\
 
 \ /
  Last update: 2008-05-12 14:25    [W:0.117 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site