From: John Stultz <john.stultz@linaro.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: John Stultz <john.stultz@linaro.org>, Willy Tarreau <w@1wt.eu>,
stable@kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 4/4] rtc: Fix RTC PIE frequency limit
Date: Wed, 10 Aug 2011 16:01:58 -0700 [thread overview]
Message-ID: <1313017318-789-5-git-send-email-john.stultz@linaro.org> (raw)
In-Reply-To: <1313017318-789-1-git-send-email-john.stultz@linaro.org>
Thomas earlier submitted a fix to limit the RTC PIE freq, but
picked 5000Hz out of the air. Willy noticed that we should
instead use the 8192Hz max from the rtc man documentation.
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
drivers/rtc/interface.c | 2 +-
include/linux/rtc.h | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 3195dbd..eb4c883 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -708,7 +708,7 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq)
int err = 0;
unsigned long flags;
- if (freq <= 0 || freq > 5000)
+ if (freq <= 0 || freq > RTC_MAX_FREQ)
return -EINVAL;
retry:
spin_lock_irqsave(&rtc->irq_task_lock, flags);
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index b27ebea..93f4d03 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -97,6 +97,9 @@ struct rtc_pll_info {
#define RTC_AF 0x20 /* Alarm interrupt */
#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
+
+#define RTC_MAX_FREQ 8192
+
#ifdef __KERNEL__
#include <linux/types.h>
--
1.7.3.2.146.gca209
prev parent reply other threads:[~2011-08-10 23:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-10 23:01 [PATCH 0/4] RTC fixes for 3.1 John Stultz
2011-08-10 23:01 ` [PATCH 1/4] rtc: ep93xx: Fix 'rtc' may be used uninitialized warning John Stultz
2011-08-10 23:01 ` [PATCH 2/4] rtc: rtc-twl: Switch to using threaded irq John Stultz
2011-08-10 23:01 ` [PATCH 3/4] rtc: rtc-twl: Remove lockdep related local_irq_enable() John Stultz
2011-08-10 23:01 ` John Stultz [this message]
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=1313017318-789-5-git-send-email-john.stultz@linaro.org \
--to=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=tglx@linutronix.de \
--cc=w@1wt.eu \
/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®