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: <1217140707-21263-3-git-send-email-cooloney@kernel.org>
Date:	Sun, 27 Jul 2008 14:38:21 +0800
From:	Bryan Wu <cooloney@...nel.org>
To:	a.zummo@...ertech.it, rtc-linux@...glegroups.com
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	Sonic Zhang <sonic.zhang@...log.com>,
	Bryan Wu <bryan.wu@...log.com>, Bryan Wu <cooloney@...nel.org>
Subject: [PATCH 2/8] [Blackfin] RTC driver: Fix bug Only RTC interrupt can wake up deeper sleep core.

From: Sonic Zhang <sonic.zhang@...log.com>

Signed-off-by: Sonic Zhang <sonic.zhang@...log.com>
Signed-off-by: Bryan Wu <bryan.wu@...log.com>
Signed-off-by: Bryan Wu <cooloney@...nel.org>
---
 drivers/rtc/rtc-bfin.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 48ada59..a568d29 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -430,6 +430,30 @@ static int __devexit bfin_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+#ifdef PM_WAKEUP_SIC_IWR
+	struct bfin_rtc *rtc = dev_get_drvdata(&pdev->dev);
+#endif
+	bfin_rtc_reset(&pdev->dev);
+#ifdef PM_WAKEUP_SIC_IWR
+	bfin_write_RTC_SWCNT(10);
+	bfin_rtc_int_set(rtc, RTC_ISTAT_STOPWATCH);
+#endif
+	return 0;
+}
+
+static int bfin_rtc_resume(struct platform_device *pdev)
+{
+#ifdef PM_WAKEUP_SIC_IWR
+	struct bfin_rtc *rtc = dev_get_drvdata(&pdev->dev);
+	bfin_rtc_int_clear(rtc, RTC_ISTAT_STOPWATCH);
+#endif
+	return 0;
+}
+#endif
+
 static struct platform_driver bfin_rtc_driver = {
 	.driver		= {
 		.name	= "rtc-bfin",
@@ -437,6 +461,10 @@ static struct platform_driver bfin_rtc_driver = {
 	},
 	.probe		= bfin_rtc_probe,
 	.remove		= __devexit_p(bfin_rtc_remove),
+#ifdef CONFIG_PM
+	.suspend	= bfin_rtc_suspend,
+	.resume		= bfin_rtc_resume,
+#endif
 };
 
 static int __init bfin_rtc_init(void)
-- 
1.5.6

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