From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, johnstul@us.ibm.com
Subject: Re: [PATCH] clockevents: Leave broadcast device shtudown only if the current device is always running.
Date: Mon, 16 Apr 2012 15:03:36 -0700 [thread overview]
Message-ID: <1334613816.28674.108.camel@sbsiddha-desk.sc.intel.com> (raw)
In-Reply-To: <4F8AC59D.6070909@ti.com>
On Sun, 2012-04-15 at 18:27 +0530, Santosh Shilimkar wrote:
> On Tuesday 10 April 2012 04:11 AM, Suresh Siddha wrote:
> > @@ -575,10 +575,12 @@ void tick_broadcast_switch_to_oneshot(void)
> > unsigned long flags;
> >
> > raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
> > +
> > + tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
> > +
> > if (cpumask_empty(tick_get_broadcast_mask()))
> > goto end;
> >
> > - tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
> > bc = tick_broadcast_device.evtdev;
> > if (bc)
> > tick_broadcast_setup_oneshot(bc);
> >
> >
> Last time when I tried your patch, some how he ethernet IRQ masked
> the issue.
>
> The problem is still as before. If you make a minimal kernel
> configuration and possibly have only local timer, broadcast timer
> and say console device as CPU wakeup sources, you should hang in
> the boot process itself(Assuming CPUIDLE driver is built-in)
>
> The main issue is, you are not letting the one time setup
> needed for the broadcast device. Even with above change,
> the 'tick_broadcast_device.evtdev' is still in SHUTDOWN
> mode and the event handler is pointing to clockevents_handle_noop()
On x86, idle driver (like drivers/idle/intel_idle.c:
__setup_broadcast_timer()) calls clockevents_notify() with
CLOCK_EVT_NOTIFY_BROADCAST_ON, during which we do
tick_broadcast_setup_oneshot(). See tick_do_broadcast_on_off() which
does this. That should setup the evtdev handler, mode etc.
And during the next CLOCK_EVT_NOTIFY_BROADCAST_ENTER we program the next
broadcast event.
> So the very first 'CLOCK_EVT_NOTIFY_BROADCAST_ENTER' call won't
> program the broadcast device with next event and CPU won't wakeup
> from low power. if you are lucky and have some other wakeup source,
> system will move further and eventually the handler and
> mode of the broad-cast device get set correctly.
I am confused. Can you elaborate on how on the next spurious wakeup
event, broad-cast device handler, mode is set?
It sounds like the CLOCK_EVT_NOTIFY_BROADCAST_ON/OFF notifications are
missing from your idle driver. But I am confused how it will work on the
next spurious wakeup etc with out the calls to
tick_do_broadcast_on_off()? Perhaps the next spurious wakeup correcting
everything is just theory and you didn't see it in practice?
Anyways, can you add CLOCK_EVT_NOTIFY_BROADCAST_ON/OFF notifications in
your idle driver to see if it addresses the problem. That is the correct
thing to do here.
thanks,
suresh
next prev parent reply other threads:[~2012-04-16 22:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 6:03 Santosh Shilimkar
2012-04-09 22:41 ` Suresh Siddha
2012-04-10 6:56 ` Shilimkar, Santosh
2012-04-10 9:49 ` [tip:timers/urgent] clockevents: tTack broadcast device mode change in tick_broadcast_switch_to_oneshot() tip-bot for Suresh Siddha
2012-04-12 1:27 ` Alex Shi
2012-04-12 4:35 ` Suresh Siddha
2012-04-12 5:10 ` Alex Shi
[not found] ` <CA++bM2th5XW1gxrHbcHwDK=qBBaNc3ut0ydbNNStfNa-Xa-9tA@mail.gmail.com>
2012-04-11 6:34 ` [PATCH] clockevents: Leave broadcast device shtudown only if the current device is always running Feng Tang
2012-04-11 10:10 ` Thomas Gleixner
2012-04-11 16:04 ` Feng Tang
2012-04-11 21:01 ` Suresh Siddha
2012-04-15 12:57 ` Santosh Shilimkar
2012-04-16 22:03 ` Suresh Siddha [this message]
2012-04-17 8:14 ` Santosh Shilimkar
2012-04-17 19:11 ` Suresh Siddha
2012-04-18 5:41 ` Shilimkar, Santosh
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=1334613816.28674.108.camel@sbsiddha-desk.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=santosh.shilimkar@ti.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
all inboxes | Powered by JetHome®