Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 938f97bc authored by John Stultz's avatar John Stultz
Browse files

rtc: Fix RTC PIE frequency limit



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: default avatarJohn Stultz <john.stultz@linaro.org>
parent 34d623d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+3 −0
Original line number Diff line number Diff line
@@ -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>