From: Stephen Boyd <sboyd@codeaurora.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Stehle Vincent-B46079 <B46079@freescale.com>,
"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
John Stultz <john.stultz@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: next-20130627 breaks i.MX6 sabre sd UART console
Date: Mon, 01 Jul 2013 12:50:05 -0700 [thread overview]
Message-ID: <51D1DD6D.8050805@codeaurora.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1307011531210.4013@ionos.tec.linutronix.de>
On 07/01/13 10:49, Thomas Gleixner wrote:
> On Mon, 1 Jul 2013, Stehle Vincent-B46079 wrote:
>
>> From: Thomas Gleixner [mailto:tglx@linutronix.de]
>>> (..) Can you please apply the patch below and provide the output?
>> Sure; thanks for the patch. The kernel seems to be in a loop, as it prints many messages and never stops. I copy only the first ones:
>>
>> ...
>> Switched to clocksource mxc_timer1
>> next 800000000098967f nevt 7fffffffffffffff per 989680 nxtp 1c03a180 now 1c553a59
> Yuck. nevt (dev->next_event) is KTIME_MAX. No surprise, that we end up
> in an endless loop.
>
> Now the question is how we did end up with that and how is that
> related to the dummy timer.
>
> From your debug output we see that the dummy timer is installed before
> the local timer. The dummytimer is disfunctional, so it requires
> broadcast in the first place.
>
> Now when we install the local timer the broadcast is not disabled,
> because the local timer is affected by C3STOP. Now the CPU is not in a
> power state which makes the broadcasting necessary, but the broadcast
> code has no way to distinguish whether the broadcast bit is set due to
> power state or due to a dummy timer.
>
> That's clearly wrong as we end up with two periodic events for that
> cpu (broadcast and local timer) as long as nothing calls into the
> broadcast control code. That's fixable with some surgery.
Yes, that sounds like the problem. Before this change the dummy would
never have been installed first and so the broadcast timer wouldn't be
running during boot.
>
> Though that does not explain why dev->next_event is set to KTIME_MAX
> after we installed the mxc_timer1 as the system clocksource. And we
> really need to know why that happens.
>
> Here is some more debugging which should shine some light on that.
Each local_timer clockevent should have their next_event set for
KTIME_MAX when they're registered because they get "shutdown" initially.
twd timers support both periodic and oneshot, so we won't emulate
periodic mode with oneshot mode. Looking at tick_setup_periodic() it
looks like the next_event member is ignored and we just set the mode to
periodic. KTIME_MAX should still be there. That should be fine though as
long as we don't switch the tick device into oneshot mode.
It seems that someone is switching the tick device into oneshot mode
without changing the event handler away from tick_handle_periodic(). Is
that supposed to happen? Most clockevents_set_mode(ONESHOT) calls are
prefaced with a handler change or they're operating on the broadcast
device. I suspect that tick_check_oneshot_broadcast() is the bad one.
That one changes the mode and then tick_handle_periodic() probably runs
past that if check and starts trying to emulate periodic mode when
next_event is still KTIME_MAX.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2013-07-01 19:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 18:49 next-20130627 breaks i.MX6 sabre sd UART console Stehle Vincent-B46079
2013-06-28 12:09 ` Thomas Gleixner
2013-06-28 15:57 ` Stephen Boyd
2013-06-28 16:58 ` Stehle Vincent-B46079
2013-06-28 17:06 ` Stephen Boyd
2013-06-29 2:07 ` Stephen Boyd
2013-07-01 10:04 ` Mark Rutland
2013-07-01 10:29 ` Stehle Vincent-B46079
2013-07-01 13:04 ` Thomas Gleixner
2013-07-01 13:22 ` Stehle Vincent-B46079
2013-07-01 17:49 ` Thomas Gleixner
2013-07-01 19:45 ` Stehle Vincent-B46079
2013-07-01 19:50 ` Stephen Boyd [this message]
2013-07-01 20:14 ` Thomas Gleixner
2013-07-01 20:54 ` Stephen Boyd
2013-07-01 21:24 ` Thomas Gleixner
2013-07-01 22:14 ` Stephen Boyd
2013-07-01 22:22 ` Thomas Gleixner
2013-07-02 7:18 ` Stehle Vincent-B46079
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=51D1DD6D.8050805@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=B46079@freescale.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=tglx@linutronix.de \
/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).