From: acrux <acrux_it@libero.it>
To: John Stultz <john.stultz@linaro.org>
Cc: linuxppc-dev@lists.ozlabs.org, Alexander Bigga <ab@mycable.de>,
rtc-linux@googlegroups.com
Subject: Re: sam460ex, rtc-m41t80 incorrect behaviour with kernel >=linux-2.6.38
Date: Tue, 13 Dec 2011 21:13:44 +0100 [thread overview]
Message-ID: <20111213211344.e1a8157d.acrux_it@libero.it> (raw)
In-Reply-To: <1323730073.4078.97.camel@work-vm>
On Mon, 12 Dec 2011 14:47:53 -0800
John Stultz <john.stultz@linaro.org> wrote:
> On Sun, 2011-12-04 at 03:29 +0100, acrux_it@libero.it 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)
> > commit 16380c153a69c3784d2afaddfe0a22f353046cf6
> > RTC: Convert rtc drivers to use the alarm_irq_enable method
> > http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;
> > h=16380c153a69c3784d2afaddfe0a22f353046cf6
>
> Yea. 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.
>
> 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 linuxppc-dev@lists.ozlabs.org
thanks for your time, this escamotage works fine.
I tested your patch against linux-2.6.38.8 and linux-3.1.5.
Tested-by: Nico Macrionitis <acrux@cruxppc.org>
cheers,
Nico
>
> [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 <john.stultz@linaro.org>
> ---
> drivers/rtc/rtc-m41t80.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
> index eda128f..64aedd8 100644
> --- a/drivers/rtc/rtc-m41t80.c
> +++ b/drivers/rtc/rtc-m41t80.c
> @@ -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)
> --
> 1.7.3.2.146.gca209
>
>
>
--
GNU/Linux on Power Architecture
CRUX PPC - http://cruxppc.org/
parent reply other threads:[~2011-12-13 20:13 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1323730073.4078.97.camel@work-vm>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111213211344.e1a8157d.acrux_it@libero.it \
--to=acrux_it@libero.it \
--cc=ab@mycable.de \
--cc=john.stultz@linaro.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rtc-linux@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).