* [PATCH] rtc-omap: Fix initialization of control register
@ 2011-07-11 10:57 Daniel Glöckner
2011-07-27 21:19 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Glöckner @ 2011-07-11 10:57 UTC (permalink / raw)
To: Alessandro Zummo
Cc: George G. Davis, rtc-linux, linux-kernel, Daniel Glöckner
As the comment explains, the intention of the code is to clear the
OMAP_RTC_CTRL_MODE_12_24 bit, but instead it only clears the
OMAP_RTC_CTRL_SPLIT and OMAP_RTC_CTRL_AUTO_COMP bits, which should be
kept. OMAP_RTC_CTRL_DISABLE, OMAP_RTC_CTRL_SET_32_COUNTER,
OMAP_RTC_CTRL_TEST, and OMAP_RTC_CTRL_ROUND_30S are also better off
being cleared.
Signed-off-by: Daniel Glöckner <dg@emlix.com>
---
drivers/rtc/rtc-omap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index bcae8dd..7789002 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -368,7 +368,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
pr_info("%s: already running\n", pdev->name);
/* force to 24 hour mode */
- new_ctrl = reg & ~(OMAP_RTC_CTRL_SPLIT|OMAP_RTC_CTRL_AUTO_COMP);
+ new_ctrl = reg & (OMAP_RTC_CTRL_SPLIT|OMAP_RTC_CTRL_AUTO_COMP);
new_ctrl |= OMAP_RTC_CTRL_STOP;
/* BOARD-SPECIFIC CUSTOMIZATION CAN GO HERE:
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc-omap: Fix initialization of control register
2011-07-11 10:57 [PATCH] rtc-omap: Fix initialization of control register Daniel Glöckner
@ 2011-07-27 21:19 ` Andrew Morton
2011-07-28 9:46 ` Daniel Glöckner
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2011-07-27 21:19 UTC (permalink / raw)
To: Daniel Glöckner
Cc: Alessandro Zummo, George G. Davis, rtc-linux, linux-kernel
On Mon, 11 Jul 2011 12:57:46 +0200
Daniel Gl__ckner <dg@emlix.com> wrote:
> As the comment explains, the intention of the code is to clear the
> OMAP_RTC_CTRL_MODE_12_24 bit, but instead it only clears the
> OMAP_RTC_CTRL_SPLIT and OMAP_RTC_CTRL_AUTO_COMP bits, which should be
> kept. OMAP_RTC_CTRL_DISABLE, OMAP_RTC_CTRL_SET_32_COUNTER,
> OMAP_RTC_CTRL_TEST, and OMAP_RTC_CTRL_ROUND_30S are also better off
> being cleared.
>
> Signed-off-by: Daniel Gl__ckner <dg@emlix.com>
> ---
> drivers/rtc/rtc-omap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index bcae8dd..7789002 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -368,7 +368,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
> pr_info("%s: already running\n", pdev->name);
>
> /* force to 24 hour mode */
> - new_ctrl = reg & ~(OMAP_RTC_CTRL_SPLIT|OMAP_RTC_CTRL_AUTO_COMP);
> + new_ctrl = reg & (OMAP_RTC_CTRL_SPLIT|OMAP_RTC_CTRL_AUTO_COMP);
> new_ctrl |= OMAP_RTC_CTRL_STOP;
>
> /* BOARD-SPECIFIC CUSTOMIZATION CAN GO HERE:
Decisions need to be made about which kernel version(s) this should be
merged into. To make and support those decisions we need to know the
user-visible effects of the bug. But the changelog is silent on this
important thing.
What were the user-visible effects of the bug?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc-omap: Fix initialization of control register
2011-07-27 21:19 ` Andrew Morton
@ 2011-07-28 9:46 ` Daniel Glöckner
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Glöckner @ 2011-07-28 9:46 UTC (permalink / raw)
To: Andrew Morton; +Cc: Alessandro Zummo, George G. Davis, rtc-linux, linux-kernel
On 07/27/2011 11:19 PM, Andrew Morton wrote:
> On Mon, 11 Jul 2011 12:57:46 +0200
> Daniel Gl__ckner <dg@emlix.com> wrote:
>
>> As the comment explains, the intention of the code is to clear the
>> OMAP_RTC_CTRL_MODE_12_24 bit, but instead it only clears the
>> OMAP_RTC_CTRL_SPLIT and OMAP_RTC_CTRL_AUTO_COMP bits, which should be
>> kept. OMAP_RTC_CTRL_DISABLE, OMAP_RTC_CTRL_SET_32_COUNTER,
>> OMAP_RTC_CTRL_TEST, and OMAP_RTC_CTRL_ROUND_30S are also better off
>> being cleared.
> What were the user-visible effects of the bug?
The contents of the control register is undefined after a complete power
loss. On our board the RTC has been observed to sometimes power up with the
OMAP_RTC_CTRL_SET_32_COUNTER bit being set, which stops the clock.
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Bertha-von-Suttner-Straße 9, 37085 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführer: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055
emlix - your embedded linux partner
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-28 9:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 10:57 [PATCH] rtc-omap: Fix initialization of control register Daniel Glöckner
2011-07-27 21:19 ` Andrew Morton
2011-07-28 9:46 ` Daniel Glöckner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox