From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: HP6xx : weird hwclock behavior, bug?
Date: Sat, 09 Feb 2008 09:07:10 +0000 [thread overview]
Message-ID: <20080209090710.GA5916@linux-sh.org> (raw)
In-Reply-To: <20080207002825.96bfbf6b.Kristoffer.ericson@gmail.com>
On Fri, Feb 08, 2008 at 05:29:23PM -0300, Rafael Ignacio Zurita wrote:
> --- Paul Mundt <lethal@linux-sh.org> wrote:
> > It works fine on all of the SH-4 systems, but I don't know if anyone
> > has done any SH-3 testing with rtc-sh.
>
> I have been testing rtc-sh today (on sh3) and it seems
> that "hwclock --systohc" does not freeze the system but it keeps
> looping calling this function:
> static irqreturn_t sh_rtc_alarm(int irq, void *dev_id)
>
> I've added printks and these show me that in sh_rtc_alarm() the
> code into the next "if" never is executed:
>
> /*
> * If AF is set then the alarm has triggered. If we clear AF while
> * the alarm time still matches the RTC time then AF will
> * immediately be set again, and if AIE is enabled then the alarm
> * interrupt will immediately be retrigger. So we clear AIE here
> * and use rtc->rearm_aie so that the carry interrupt will keep
> * trying to clear AF and once it stays cleared it'll re-enable
> * AIE.
> */
> if (tmp & RCR1_AF) {
> events |= RTC_AF | RTC_IRQF;
>
> tmp &= ~(RCR1_AF|RCR1_AIE);
>
> writeb(tmp, rtc->regbase + RCR1);
>
> rtc->rearm_aie = 1;
>
> rtc_update_irq(rtc->rtc_dev, 1, events);
> }
>
> Perhaps it should not execute the code inside such if in this case, but
> the system keeps looping calling to sh_rtc_alarm and it looks like a
> frozen system.
>
> Some idea about how to debug a bit more?
The alarm code was written and tested on SH-4, it is possible that the
SH-3 has a different format or simply doesn't support the alarm at all.
The first thing to do is to look at the RCR1 definition and see how the
alarm bits are set there. If RCR1_AF isn't asserted, then either the IRQ
is spurious, or we're simply checking the wrong condition for the SH-3
case (in which case the ack'ing case won't be right either.
It's fairly trivial to conditionalize the alarm support, but up until now
the SH-3 folks have been pretty silent on the issue (especially with
regards to what works and what doesn't work). You may want to just
comment out the alarm bits for now and ensure that the rest of the code
is functional first, and then see about what's causing the problem on the
alarm side. I expect it's just a matter of bit or register definitions
being different.
next prev parent reply other threads:[~2008-02-09 9:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-06 23:28 HP6xx : weird hwclock behavior, bug? Kristoffer Ericson
2008-02-07 2:16 ` Paul Mundt
2008-02-07 13:24 ` Kristoffer Ericson
2008-02-08 20:29 ` Rafael Ignacio Zurita
2008-02-09 9:07 ` Paul Mundt [this message]
2008-02-13 13:18 ` Rafael Ignacio Zurita
2008-02-17 20:12 ` Kristoffer Ericson
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=20080209090710.GA5916@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-sh@vger.kernel.org \
/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