From patchwork Wed Aug 10 23:01:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 3385 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AED24241D9 for ; Wed, 10 Aug 2011 23:02:49 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 77DDCA18285 for ; Wed, 10 Aug 2011 23:02:49 +0000 (UTC) Received: by mail-qy0-f180.google.com with SMTP id 31so1104019qyk.11 for ; Wed, 10 Aug 2011 16:02:49 -0700 (PDT) Received: by 10.229.42.10 with SMTP id q10mr4047426qce.45.1313017369141; Wed, 10 Aug 2011 16:02:49 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.190.71 with SMTP id dh7cs96544qcb; Wed, 10 Aug 2011 16:02:48 -0700 (PDT) Received: from mr.google.com ([10.146.88.15]) by 10.146.88.15 with SMTP id l15mr4527564yab.6.1313017368931 (num_hops = 1); Wed, 10 Aug 2011 16:02:48 -0700 (PDT) Received: by 10.146.88.15 with SMTP id l15mr3244738yab.6.1313017368656; Wed, 10 Aug 2011 16:02:48 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.145]) by mx.google.com with ESMTPS id r2si2625703pbp.97.2011.08.10.16.02.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Aug 2011 16:02:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.145 as permitted sender) client-ip=32.97.182.145; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.145 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p7AMXCYs006213; Wed, 10 Aug 2011 18:33:12 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7AN2kP7245946; Wed, 10 Aug 2011 19:02:46 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7AN2jEp021388; Wed, 10 Aug 2011 20:02:45 -0300 Received: from kernel.beaverton.ibm.com ([9.47.67.96]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p7AN2iQv021035; Wed, 10 Aug 2011 20:02:45 -0300 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id 70D321E750E; Wed, 10 Aug 2011 16:02:44 -0700 (PDT) From: John Stultz To: LKML Cc: John Stultz , Willy Tarreau , stable@kernel.org, Thomas Gleixner Subject: [PATCH 4/4] rtc: Fix RTC PIE frequency limit Date: Wed, 10 Aug 2011 16:01:58 -0700 Message-Id: <1313017318-789-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1313017318-789-1-git-send-email-john.stultz@linaro.org> References: <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 Cc: stable@kernel.org Cc: Thomas Gleixner Signed-off-by: John Stultz --- 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