[PATCH 76/81] drivers/rtc/rtc-pl031.c: restore ST variant functionality
Herton Ronaldo Krzesinski
herton.krzesinski at canonical.com
Tue Feb 19 18:49:39 UTC 2013
3.5.7.6 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linus.walleij at linaro.org>
commit 3399cfb5df9594495b876d1843a7165f77366b2b upstream.
Commit e7e034e18a0a ("drivers/rtc/rtc-pl031.c: fix the missing operation
on enable") accidentally broke the ST variants of PL031.
The bit that is being poked as "clockwatch" enable bit for the ST
variants does the work of bit 0 on this variant. Bit 0 is used for a
clock divider on the ST variants, and setting it to 1 will affect
timekeeping in a very bad way.
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
Acked-by: Haojian Zhuang <haojian.zhuang at gmail.com>
Cc: Mian Yousaf KAUKAB <mian.yousaf.kaukab at stericsson.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar at stericsson.com>
Cc: Alessandro Zummo <a.zummo at towertech.it>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
[ herton: adjust context ]
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
---
drivers/rtc/rtc-pl031.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index c42054b..b232996 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -336,7 +336,9 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
/* Enable the clockwatch on ST Variants */
if (ldata->hw_designer == AMBA_VENDOR_ST)
data |= RTC_CR_CWEN;
- writel(data | RTC_CR_EN, ldata->base + RTC_CR);
+ else
+ data |= RTC_CR_EN;
+ writel(data, ldata->base + RTC_CR);
/*
* On ST PL031 variants, the RTC reset value does not provide correct
--
1.7.9.5
More information about the kernel-team
mailing list