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]
Message-Id: <1317064434-1829-4-git-send-email-john.stultz@linaro.org>
Date:	Mon, 26 Sep 2011 12:13:51 -0700
From:	John Stultz <john.stultz@...aro.org>
To:	lkml <linux-kernel@...r.kernel.org>
Cc:	John Stultz <john.stultz@...aro.org>,
	"Rafael J. Wysocki" <rjw@...k.pl>, arve@...roid.com,
	markgross@...gnar.org, Alan Stern <stern@...land.harvard.edu>,
	amit.kucheria@...aro.org, farrowg@...ibm.com,
	"Dmitry Fink (Palm GBU)" <Dmitry.Fink@...m.com>,
	linux-pm@...ts.linux-foundation.org, khilman@...com,
	Magnus Damm <damm@...nsource.se>, mjg@...hat.com,
	peterz@...radead.org
Subject: [PATCH 3/6] [RFC] rtc: rtc-cmos: Add pm_stay_awake/pm_relax calls around IRQ

Flag the rtc-cmos IRQ event as a wakeup event using pm_stay_awake
and pm_relax()

CC: Rafael J. Wysocki <rjw@...k.pl>
CC: arve@...roid.com
CC: markgross@...gnar.org
CC: Alan Stern <stern@...land.harvard.edu>
CC: amit.kucheria@...aro.org
CC: farrowg@...ibm.com
CC: Dmitry Fink (Palm GBU) <Dmitry.Fink@...m.com>
CC: linux-pm@...ts.linux-foundation.org
CC: khilman@...com
CC: Magnus Damm <damm@...nsource.se>
CC: mjg@...hat.com 
CC: peterz@...radead.org 
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
 drivers/rtc/rtc-cmos.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 05beb6c..1cc4688 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -538,11 +538,15 @@ static struct bin_attribute nvram = {
 
 static struct cmos_rtc	cmos_rtc;
 
+static struct wakeup_source *rtc_cmos_wakelock;
+
 static irqreturn_t cmos_interrupt(int irq, void *p)
 {
 	u8		irqstat;
 	u8		rtc_control;
 
+	__pm_stay_awake(rtc_cmos_wakelock);
+
 	spin_lock(&rtc_lock);
 
 	/* When the HPET interrupt handler calls us, the interrupt
@@ -573,9 +577,12 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
 
 	if (is_intr(irqstat)) {
 		rtc_update_irq(p, 1, irqstat);
+		__pm_relax(rtc_cmos_wakelock);
 		return IRQ_HANDLED;
-	} else
-		return IRQ_NONE;
+	}
+
+	__pm_relax(rtc_cmos_wakelock);
+	return IRQ_NONE;
 }
 
 #ifdef	CONFIG_PNP
@@ -1153,6 +1160,8 @@ static int __init cmos_init(void)
 {
 	int retval = 0;
 
+	rtc_cmos_wakelock = wakeup_source_register("rtc_cmos");
+
 #ifdef	CONFIG_PNP
 	retval = pnp_register_driver(&cmos_pnp_driver);
 	if (retval == 0)
-- 
1.7.3.2.146.gca209

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