[PATCH] RTC: Fix to correct improper implementation of clock update irq (RTC_UIE) and enable UIE Emulation Signed-off-by: ramesh.chandrasekaran <ramesh.chandrasekaran at stericsson.com>
ramesh.chandrasekaran at stericsson.com
Tue Apr 24 12:02:04 UTC 2012
Thanks for your review comments. :)
The clock update irq's are always going to wake up the system every second (even if it is enabled from the hardware side - the rtc is going to generate irq, at every clock update usually 1 second). This clock update irq will be disabled always, and only used/enabled when needed & done through ioctl dynamically by user space (example: hwclock command), so I think, as soon as the application using this is closed, it will send an ioctl to disable it anyway.
May be, if we try to use real RTC here, we could avoid the software overhead of reading the clock several times at the beginning, until it synchronizes with the internal timer. So, I don't think there will be a big performance difference with or without this Emulation layer enabled (especially for a feature which we are going to use only at some times).
Please correct me, if my understanding is wrong here.
Anyway, using the real RTC to generate clock update irq is always a better option, to improve the accuracy of interrupt & reduce overhead. That will always be a better fix, than emulation. May be the above fix can be used temporarily until we find a way, to implement the real rtc for this purpose.
Mattias, please update us once you have found a way to use RTC for this.
I agree with your first comment, that there needs to be a change done in the rtc Kconfig, which selects the EMUL config, instead of adding this in the defconfig (patch is sent again to the mailing list on this).
From: Linus Walleij [mailto:linus.walleij at linaro.org]
Sent: Tuesday, April 24, 2012 2:47 PM
To: Ramesh CHANDRASEKARAN
Cc: kernel at igloocommunity.org; Linus Walleij; Philippe LANGLAIS; Mats BERGSTROM; John FREDRIKSSON; Benn PORSCKE; Mattias WALLIN; Vincent Guittot
Subject: Re: [PATCH] RTC: Fix to correct improper implementation of clock update irq (RTC_UIE) and enable UIE Emulation Signed-off-by: ramesh.chandrasekaran <ramesh.chandrasekaran at stericsson.com>
On Tue, Apr 24, 2012 at 11:11 AM, Linus Walleij
<linus.walleij at linaro.org> wrote:
> On Mon, Apr 23, 2012 at 7:55 AM, Ramesh Chandrasekaran
> <ramesh.chandrasekaran at stericsson.com> wrote:
>> From: ramesh.chandrasekaran <ramesh.chandrasekaran at stericsson.com>
>> arch/arm/configs/u8500_defconfig | 1 +
>> drivers/rtc/rtc-ab8500.c | 15 +++++++++++++--
>> 2 files changed, 14 insertions(+), 2 deletions(-)
>> diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
>> index 2511cad..99a21e6 100644
>> --- a/arch/arm/configs/u8500_defconfig
>> +++ b/arch/arm/configs/u8500_defconfig
>> @@ -240,6 +240,7 @@ CONFIG_LEDS_TRIGGER_TIMER=y
> This is not good since it allows the user tp configure the system
> Instead the Kconfig entry for the AB8500 RTC should
> select RTC_INTF_DEV_UIE_EMUL
...org maybe I'm just talking crap :-)
It seems like RTC_INTF_DEV_UIE_EMUL is going to wake up
the system every second and that sort of sucks from a power
point of view.
So adding it to the defconfig is to be considered some
"ugly-fix" for the moment?
Mattias Wallin is working on enabling the "real" RTC in
the always-on power domain, which will hopefully solve
this issue once and for all by providing a more reliable
More information about the kernel