mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernhard Walle <bwalle@suse.de>
To: Gabor Gombas <gombasg@sztaki.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Solid freezes with 2.6.25
Date: Mon, 12 May 2008 14:21:46 +0200	[thread overview]
Message-ID: <20080512142146.2a32793c@kopernikus.site> (raw)
In-Reply-To: <20080507134223.GB4278@boogie.lpds.sztaki.hu>

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,








  reply	other threads:[~2008-05-12 12:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 14:29 Gabor Gombas
2008-04-28 14:54 ` Oliver Pinter
2008-04-28 14:59   ` Gabor Gombas
2008-04-28 16:25 ` Andrew Morton
2008-04-29  9:50   ` Bernhard Walle
2008-04-29  9:53     ` Gabor Gombas
2008-04-29 15:54   ` Bernhard Walle
2008-04-30 13:38     ` Gabor Gombas
2008-04-30 14:51       ` Bernhard Walle
2008-05-07 11:43         ` Gabor Gombas
2008-05-07 12:45           ` Bernhard Walle
2008-05-07 13:42             ` Gabor Gombas
2008-05-12 12:21               ` Bernhard Walle [this message]
2008-05-13 14:39                 ` Gabor Gombas
2008-06-15 17:11                   ` Gabor Gombas
2008-07-25  8:52                     ` Gabor Gombas
2008-07-25  9:04                       ` Bernhard Walle
2008-08-25 12:27                         ` Gabor Gombas
2008-04-29  7:24 ` Gabor Gombas
2008-04-29  7:37   ` Andrew Morton
2008-04-29  9:43     ` Gabor Gombas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080512142146.2a32793c@kopernikus.site \
    --to=bwalle@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=gombasg@sztaki.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®