Re: [PATCH] CPUidle: always return with interrupts enabled



On Wed, 30 Sep 2009 23:21:33 +0200
"Rafael J. Wysocki" <rjw@xxxxxxx> wrote:

On Wednesday 30 September 2009, Kevin Hilman wrote:
In the case where cpuidle_idle_call() returns before changing state
due to a need_resched(), it was returning with IRQs disabled.

This patch ensures IRQs are (re)enabled before returning.

Venki, any comments on this?

Rigor mortis is setting in on this one.

Venki's most recent linux-acpi email was on July 31.

Reported-by: Hemanth V <hemanthv@xxxxxx>
Signed-off-by: Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx>
---
drivers/cpuidle/cpuidle.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index ad41f19..12fdd39 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -76,8 +76,11 @@ static void cpuidle_idle_call(void)
#endif
/* ask the governor for the next state */
next_state = cpuidle_curr_governor->select(dev);
- if (need_resched())
+ if (need_resched()) {
+ local_irq_enable();
return;
+ }
+
target_state = &dev->states[next_state];

/* enter the state and update stats */

The patch seems correct to me. The code is hopelessly poorly
documented as per usual, but other paths in that function, including
the call to target_state->enter() (which devolves to default_idle) also
enable interrupts.

Kevin, the changelog is not good. It tells us what was wrong with the
code but does not describe the user-visible effects of the bug.

I'm unable to find any bug report from Hemanth so I'm all in the dark.

Your cc to linux-omap makes me suspect that <whatever the problem was>
was exhibited on a non-x86 platform, under some circumstances. Perhaps
that explains (for unknown reasons) why <whatever the problem was> was
not observed on x86. But I'm totally in the dark and grasping for
clues and have no way of determining (for example) whether we should
backport the fix to earlier kernels.


Please send along the additional information?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Linux 2.6.21-rc5
    ... Please try out the patch in the bug report without your patch and see if the issue reproduces. ... Unable to handle kernel NULL pointer dereference at 0000000000000088 RIP: ... That is an 'impossible' scenario for tx descriptors here - the tx ring descriptors are always set up with a valid skb, and their completion is serialized via np->lock. ...
    (Linux-Kernel)
  • Wine-fbsd64 updated to 1.3.32 (32bit Wine for 64bit FreeBSD)
    ... These packages include the patch from bug report 27653 ... There is a known UDP related problem with wine (see ... The patch for nVidia users is now included in the package and is run on ...
    (freebsd-questions)
  • Re: Document ID 6220478 "10-Fix Delivered"
    ... >patch will not be put on the public sunsolve area (or on the contract ... >area) until I install the IDR and confirm that the patch indeed fixes the ... The bug report is marked as "integrated in snv_11" which basically is ... to opinions held by my employer, Sun Microsystems. ...
    (comp.unix.solaris)
  • Re: Python bug report on SF, what now?
    ... > I've submitted a bug report on Sourceforge ... As it has a patch associated, ... submitter is willing to do all the work. ... If it is a bug report, and it is not for code that I have ...
    (comp.lang.python)
  • Re: [Bug #10670] BUG: linux-2.6.26-rc1 oops at thinkpad_acpi:led_set_status
    ... Patch available, waiting for Len Brown to merge it. ... the bug report. ... "One disk to rule them all, ...
    (Linux-Kernel)