sam460ex, rtc-m41t80 incorrect behaviour with kernel >=linux-2.6.38
acrux
Tested-by Nico MacrionitisQuoted 18 lines · On Mon, 12 Dec 2011 14:47:53 -0800 John Stultz <[email protected]> wrote:
Quoted 8 lines · On Sun, 2011-12-04 at 03:29 +0100, [email protected] wrote:
Acube Sam460ex is a 460ex SoC (PowerPC) based board with m41t81 like RTC. The wrong beahviour it seems to be caused this commit:
Thu, 3 Feb 2011 21:02:35 +0000 (13:02 -0800)
commit16380c153a69c3784d2afaddfe0a22f353046cf6
RTC: Convert rtc drivers to use thealarm_irq_enablemethod
http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;
h=16380c153a69c3784d2afaddfe0a22f353046cf6Yea. This was reported earlier, but it seems none of the proposed solutions have been implemented.
The cause is that the m41t80 driver's alarm functionality is somehow broken. The alarm mode is actually now used for UIE, so where before 2.6.38, UIE mode returned
-EINVAL, it will now succeed, setting the alarm to fire a second away.
Quoted 9 lines
However, since the alarm code is broken, no alarm arrives and you get the timeout you see.
Could you test the following patch to see if it resolves the issue for you? If it does, I'll queue it for inclusion.
thanks
-john
hallo John,
CC to [email protected]
thanks for your time, this escamotage works fine. I tested your patch against linux-2.6.38.8 and linux-3.1.5.
cheers,
Nico
Quoted 47 lines
[PATCH] rtc: m41t80: Workaround broken alarm functionality
The m41t80 driver doesn't seem to have a functional alarm.
This causes failures when the generic core sees alarm functions, but then cannot use them properly for things like UIE mode.
Disabling the alarm functions allows proper error reporting, and possible fallback to emulated modes. Once someone fixes the alarm functions, this can be restored.
Signed-off-by John Stultz <[email protected]>--- drivers/rtc/rtc-m41t80.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)drivers/rtc/rtc-m41t80.c +9
-0@@ -357,10 +357,19 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) static struct rtc_class_ops m41t80_rtc_ops = { .read_time = m41t80_rtc_read_time, .set_time = m41t80_rtc_set_time, +/* +* XXX - m41t80 alarm functionality is reported broken. +* until it is fixed, don't register alarm functions. +* .read_alarm = m41t80_rtc_read_alarm, .set_alarm = m41t80_rtc_set_alarm, +*/ .proc = m41t80_rtc_proc, +/* +* See above comment on broken alarm +* .alarm_irq_enable = m41t80_rtc_alarm_irq_enable, +*/ }; #if defined(CONFIG_RTC_INTF_SYSFS) || defined#(CONFIG_RTC_INTF_SYSFS_MODULE)
Signature · 1 line
1.7.3.2.146.gca209
Signature · 2 lines
GNU/Linux on Power Architecture CRUX PPC - http://cruxppc.org/