mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Colin Cross <ccross@android.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Neil Zhang <zhangwm@marvell.com>, Joseph Lo <josephl@nvidia.com>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH 1/3] cpuidle: coupled: disable interrupts after entering safe state
Date: Thu, 29 Aug 2013 22:09:01 +0200	[thread overview]
Message-ID: <3891367.RzYTp6nikM@vostro.rjw.lan> (raw)
In-Reply-To: <CAMbhsRSTv9ivMY1=-4YPxPV0tCTcJnHwWOEvr_F5exg9A2Z1Mw@mail.gmail.com>

On Thursday, August 29, 2013 12:12:17 AM Colin Cross wrote:
> On Wed, Aug 28, 2013 at 11:50 PM, Prashant Gaikwad <pgaikwad@nvidia.com> wrote:
> > On Saturday 24 August 2013 01:15 AM, Colin Cross wrote:
> >>
> >> Calling cpuidle_enter_state is expected to return with interrupts
> >> enabled, but interrupts must be disabled before starting the
> >> ready loop synchronization stage.  Call local_irq_disable after
> >> each call to cpuidle_enter_state for the safe state.
> >>
> >> CC: stable@vger.kernel.org
> >> Signed-off-by: Colin Cross <ccross@android.com>
> >> ---
> >>   drivers/cpuidle/coupled.c | 2 ++
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
> >> index 2a297f8..db92bcb 100644
> >> --- a/drivers/cpuidle/coupled.c
> >> +++ b/drivers/cpuidle/coupled.c
> >> @@ -460,6 +460,7 @@ int cpuidle_enter_state_coupled(struct cpuidle_device
> >> *dev,
> >>                 }
> >>                 entered_state = cpuidle_enter_state(dev, drv,
> >>                         dev->safe_state_index);
> >> +               local_irq_disable();
> >
> >
> > Colin,
> >
> > There is still some window where irq remains enabled after exiting safe
> > state. It may introduce some corner case.
> > Instead of this can we pass a parameter to cpuidle_enter_state indicating
> > that irq has to be enabled or not after exit from idle state, which would be
> > false when entering safe state from coupled idle.
> 
> It's fine for irqs to be enabled when exiting the safe state, in fact
> on further inspection this patch isn't strictly necessary at all - we
> always enable interrupts inside cpuidle_coupled_clear_pokes soon after
> cpuidle_enter_state returns, and then disable them again.  It's
> probably better to disable interrupts right after cpuidle_enter_state,
> it makes sure interrupts are consistently disabled when calling
> cpuidle_coupled_set_waiting, cpuidle_coupled_cpus_waiting and
> cpuidle_coupled_clear_pokes, although that doesn't matter in the
> current implementation.
> 
> Rafael, feel free to drop the stable annotation from this patch.

I will, thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      reply	other threads:[~2013-08-29 19:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 19:45 Colin Cross
2013-08-23 19:45 ` [PATCH 2/3] cpuidle: coupled: abort idle if pokes are pending Colin Cross
2013-08-26  9:10   ` Joseph Lo
2013-08-23 19:45 ` [PATCH 3/3] cpuidle: coupled: fix race condition between pokes and safe state Colin Cross
2013-08-27  8:57   ` Neil Zhang
2013-08-23 23:09 ` [PATCH 1/3] cpuidle: coupled: disable interrupts after entering " Stephen Warren
2013-08-24  0:22   ` Colin Cross
2013-08-26 15:55     ` Stephen Warren
2013-08-28 21:28 ` Rafael J. Wysocki
2013-08-28 22:00   ` Colin Cross
2013-08-29  0:50     ` Rafael J. Wysocki
2013-08-29  6:50 ` Prashant Gaikwad
2013-08-29  7:12   ` Colin Cross
2013-08-29 20:09     ` Rafael J. Wysocki [this message]

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=3891367.RzYTp6nikM@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=ccross@android.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=josephl@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pgaikwad@nvidia.com \
    --cc=stable@vger.kernel.org \
    --cc=zhangwm@marvell.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

all inboxes | Powered by JetHome®