lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 12 May 2008 14:21:46 +0200
From:	Bernhard Walle <bwalle@...e.de>
To:	Gabor Gombas <gombasg@...aki.hu>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: Solid freezes with 2.6.25

Hi,

* Gabor Gombas <gombasg@...aki.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@...e.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@...e.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,







--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ