All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96
@ 2013-06-14 18:55 James Bottomley
  2013-06-14 19:11 ` David Daney
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: James Bottomley @ 2013-06-14 18:55 UTC (permalink / raw)
  To: Parisc List; +Cc: Thomas Gleixner, linux-kernel, Andrew Morton

>From 48bbf44a96676ce6f520a408378730c976e9a11e Mon Sep 17 00:00:00 2001
From: James Bottomley <JBottomley@Parallels.com>
Date: Wed, 8 May 2013 14:05:34 -0700
Subject: [PATCH] [PARISC] fix WARNING: at kernel/cpu/idle.c:96

On PA-RISC (and presumably any other arch that doesn't implement its own
arch_cpu_idle), we get this spurious boot warning.  The problem is that the
way the idle task is selected initially using the weak arch_cpu_idle() in
idle.c causes us to enter this place once with interrupts enabled.  Fix this
by disabling interrupts in the weak arch_cpu_idle() code.

Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

---

Thomas, I'm getting a bit impatient: this is a clear bug in the cpu idle
code and we keep getting reports of this as a boot crash on parisc.  If
you don't push it through your tree, I'll take it through the parisc
one.


diff --git a/kernel/cpu/idle.c b/kernel/cpu/idle.c
index d5585f5..0a4d11e 100644
--- a/kernel/cpu/idle.c
+++ b/kernel/cpu/idle.c
@@ -58,6 +58,7 @@ void __weak arch_cpu_idle_dead(void) { }
 void __weak arch_cpu_idle(void)
 {
 	cpu_idle_force_poll = 1;
+	local_irq_enable();
 }
 
 /*



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96
  2013-06-14 18:55 [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96 James Bottomley
@ 2013-06-14 19:11 ` David Daney
  2013-06-14 19:13   ` James Bottomley
  2013-06-14 20:39 ` Thomas Gleixner
  2013-06-19  7:03 ` [tip:core/urgent] idle: Enable interrupts in the weak arch_cpu_idle() implementation tip-bot for James Bottomley
  2 siblings, 1 reply; 7+ messages in thread
From: David Daney @ 2013-06-14 19:11 UTC (permalink / raw)
  To: James Bottomley; +Cc: Parisc List, Thomas Gleixner, linux-kernel, Andrew Morton

On 06/14/2013 11:55 AM, James Bottomley wrote:
>>From 48bbf44a96676ce6f520a408378730c976e9a11e Mon Sep 17 00:00:00 2001
> From: James Bottomley <JBottomley@Parallels.com>
> Date: Wed, 8 May 2013 14:05:34 -0700
> Subject: [PATCH] [PARISC] fix WARNING: at kernel/cpu/idle.c:96
>
> On PA-RISC (and presumably any other arch that doesn't implement its own
> arch_cpu_idle), we get this spurious boot warning.  The problem is that the
> way the idle task is selected initially using the weak arch_cpu_idle() in
> idle.c causes us to enter this place once with interrupts enabled.  Fix this
> by disabling interrupts in the weak arch_cpu_idle() code.

Is this changelog correct?  It looks to me like you are enabling 
interrupts down there.

David Daney


>
> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
>
> ---
>
> Thomas, I'm getting a bit impatient: this is a clear bug in the cpu idle
> code and we keep getting reports of this as a boot crash on parisc.  If
> you don't push it through your tree, I'll take it through the parisc
> one.
>
>
> diff --git a/kernel/cpu/idle.c b/kernel/cpu/idle.c
> index d5585f5..0a4d11e 100644
> --- a/kernel/cpu/idle.c
> +++ b/kernel/cpu/idle.c
> @@ -58,6 +58,7 @@ void __weak arch_cpu_idle_dead(void) { }
>   void __weak arch_cpu_idle(void)
>   {
>   	cpu_idle_force_poll = 1;
> +	local_irq_enable();

Here     ^^^^^^^^^^^^^^^^


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96
  2013-06-14 19:11 ` David Daney
@ 2013-06-14 19:13   ` James Bottomley
  0 siblings, 0 replies; 7+ messages in thread
From: James Bottomley @ 2013-06-14 19:13 UTC (permalink / raw)
  To: David Daney; +Cc: Parisc List, Thomas Gleixner, linux-kernel, Andrew Morton

On Fri, 2013-06-14 at 12:11 -0700, David Daney wrote:
> On 06/14/2013 11:55 AM, James Bottomley wrote:
> >>From 48bbf44a96676ce6f520a408378730c976e9a11e Mon Sep 17 00:00:00 2001
> > From: James Bottomley <JBottomley@Parallels.com>
> > Date: Wed, 8 May 2013 14:05:34 -0700
> > Subject: [PATCH] [PARISC] fix WARNING: at kernel/cpu/idle.c:96
> >
> > On PA-RISC (and presumably any other arch that doesn't implement its own
> > arch_cpu_idle), we get this spurious boot warning.  The problem is that the
> > way the idle task is selected initially using the weak arch_cpu_idle() in
> > idle.c causes us to enter this place once with interrupts enabled.  Fix this
> > by disabling interrupts in the weak arch_cpu_idle() code.
> 
> Is this changelog correct?  It looks to me like you are enabling 
> interrupts down there.

Yes, obvious typo, sorry.  The WARN_ON check is for disabled interrupts
the fix is to enable them.

James



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96
  2013-06-14 18:55 [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96 James Bottomley
  2013-06-14 19:11 ` David Daney
@ 2013-06-14 20:39 ` Thomas Gleixner
  2013-06-14 20:49   ` Thomas Gleixner
  2013-06-14 21:50   ` James Bottomley
  2013-06-19  7:03 ` [tip:core/urgent] idle: Enable interrupts in the weak arch_cpu_idle() implementation tip-bot for James Bottomley
  2 siblings, 2 replies; 7+ messages in thread
From: Thomas Gleixner @ 2013-06-14 20:39 UTC (permalink / raw)
  To: James Bottomley; +Cc: Parisc List, linux-kernel, Andrew Morton

On Fri, 14 Jun 2013, James Bottomley wrote:

> >From 48bbf44a96676ce6f520a408378730c976e9a11e Mon Sep 17 00:00:00 2001
> From: James Bottomley <JBottomley@Parallels.com>
> Date: Wed, 8 May 2013 14:05:34 -0700
> Subject: [PATCH] [PARISC] fix WARNING: at kernel/cpu/idle.c:96
> 
> On PA-RISC (and presumably any other arch that doesn't implement its own
> arch_cpu_idle), we get this spurious boot warning.  The problem is that the
> way the idle task is selected initially using the weak arch_cpu_idle() in
> idle.c causes us to enter this place once with interrupts enabled.  Fix this
> by disabling interrupts in the weak arch_cpu_idle() code.
> 
> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
> Cc: stable@vger.kernel.org

What's the stable tag for? This code got merged in 3,10, so stable is
totally irrelevant.

> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
> 
> ---
> 
> Thomas, I'm getting a bit impatient: this is a clear bug in the cpu idle
> code and we keep getting reports of this as a boot crash on parisc.  If
> you don't push it through your tree, I'll take it through the parisc
> one.

Hold your breath. I was not even CC'ed on the original patch and I
admit that I ignored the patch which starts with [PARISC].

If the subject line would have started with [idle], [core/idle] I
definitely would have paid attention.

Aside of that the rest of the subject line is just annoyingly
sloppy. We do not fix a WARNING. That's not what this patch is
about. The patch fixes a problem which got introduced with the idle
rework, period.

I'll pick it up and fix the changelog.

Thanks,

	tglx

> 
> diff --git a/kernel/cpu/idle.c b/kernel/cpu/idle.c
> index d5585f5..0a4d11e 100644
> --- a/kernel/cpu/idle.c
> +++ b/kernel/cpu/idle.c
> @@ -58,6 +58,7 @@ void __weak arch_cpu_idle_dead(void) { }
>  void __weak arch_cpu_idle(void)
>  {
>  	cpu_idle_force_poll = 1;
> +	local_irq_enable();
>  }
>  
>  /*
> 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96
  2013-06-14 20:39 ` Thomas Gleixner
@ 2013-06-14 20:49   ` Thomas Gleixner
  2013-06-14 21:50   ` James Bottomley
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2013-06-14 20:49 UTC (permalink / raw)
  To: James Bottomley; +Cc: Parisc List, linux-kernel, Andrew Morton

On Fri, 14 Jun 2013, Thomas Gleixner wrote:
> On Fri, 14 Jun 2013, James Bottomley wrote:
> 
> > >From 48bbf44a96676ce6f520a408378730c976e9a11e Mon Sep 17 00:00:00 2001
> > From: James Bottomley <JBottomley@Parallels.com>
> > Date: Wed, 8 May 2013 14:05:34 -0700
> > Subject: [PATCH] [PARISC] fix WARNING: at kernel/cpu/idle.c:96
> > 
> > On PA-RISC (and presumably any other arch that doesn't implement its own
> > arch_cpu_idle), we get this spurious boot warning.  The problem is that the
> > way the idle task is selected initially using the weak arch_cpu_idle() in
> > idle.c causes us to enter this place once with interrupts enabled.  Fix this
> > by disabling interrupts in the weak arch_cpu_idle() code.
> > 
> > Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
> > Cc: stable@vger.kernel.org
> 
> What's the stable tag for? This code got merged in 3,10, so stable is
> totally irrelevant.
> 
> > Signed-off-by: James Bottomley <JBottomley@Parallels.com>
> > 
> > ---
> > 
> > Thomas, I'm getting a bit impatient: this is a clear bug in the cpu idle
> > code and we keep getting reports of this as a boot crash on parisc.  If
> > you don't push it through your tree, I'll take it through the parisc
> > one.
> 
> Hold your breath. I was not even CC'ed on the original patch and I
> admit that I ignored the patch which starts with [PARISC].
> 
> If the subject line would have started with [idle], [core/idle] I
> definitely would have paid attention.
> 
> Aside of that the rest of the subject line is just annoyingly
> sloppy. We do not fix a WARNING. That's not what this patch is
> about. The patch fixes a problem which got introduced with the idle
> rework, period.
> 
> I'll pick it up and fix the changelog.

And it needs fixing. It says:

"... way the idle task is selected initially using the weak
 arch_cpu_idle() in idle.c causes us to enter this place once with
 interrupts enabled.  Fix this by disabling interrupts in the weak
 arch_cpu_idle() code."

And the patch does:

 void __weak arch_cpu_idle(void)
 {
        cpu_idle_force_poll = 1;
+       local_irq_enable();
 }

Instead of bullying around you might consider to read
Documentation/SubmittingPatches.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96
  2013-06-14 20:39 ` Thomas Gleixner
  2013-06-14 20:49   ` Thomas Gleixner
@ 2013-06-14 21:50   ` James Bottomley
  1 sibling, 0 replies; 7+ messages in thread
From: James Bottomley @ 2013-06-14 21:50 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Parisc List, linux-kernel, Andrew Morton

On Fri, 2013-06-14 at 22:39 +0200, Thomas Gleixner wrote:
> On Fri, 14 Jun 2013, James Bottomley wrote:
> 
> > >From 48bbf44a96676ce6f520a408378730c976e9a11e Mon Sep 17 00:00:00 2001
> > From: James Bottomley <JBottomley@Parallels.com>
> > Date: Wed, 8 May 2013 14:05:34 -0700
> > Subject: [PATCH] [PARISC] fix WARNING: at kernel/cpu/idle.c:96
> > 
> > On PA-RISC (and presumably any other arch that doesn't implement its own
> > arch_cpu_idle), we get this spurious boot warning.  The problem is that the
> > way the idle task is selected initially using the weak arch_cpu_idle() in
> > idle.c causes us to enter this place once with interrupts enabled.  Fix this
> > by disabling interrupts in the weak arch_cpu_idle() code.
> > 
> > Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
> > Cc: stable@vger.kernel.org
> 
> What's the stable tag for? This code got merged in 3,10, so stable is
> totally irrelevant.

Hm, OK, it's been so long I'm misremembering which kernel versions need
it.

> > Signed-off-by: James Bottomley <JBottomley@Parallels.com>
> > 
> > ---
> > 
> > Thomas, I'm getting a bit impatient: this is a clear bug in the cpu idle
> > code and we keep getting reports of this as a boot crash on parisc.  If
> > you don't push it through your tree, I'll take it through the parisc
> > one.
> 
> Hold your breath. I was not even CC'ed on the original patch and I
> admit that I ignored the patch which starts with [PARISC].

Oh, you were ... I made sure of that. It's thread with subject

Re: [PATCH] parisc: avoid WARNING: at kernel/cpu/idle.c:96

You were cc'd from the one dated Wed, 08 May 2013 14:05:34 -0700

> If the subject line would have started with [idle], [core/idle] I
> definitely would have paid attention.
> 
> Aside of that the rest of the subject line is just annoyingly
> sloppy. We do not fix a WARNING. That's not what this patch is
> about. The patch fixes a problem which got introduced with the idle
> rework, period.
> 
> I'll pick it up and fix the changelog.

Sure, whatever you think is best ... Given Linus' current mood I think
leading with a description of the actual user visible problem being
fixed is a good way to make sure he doesn't get annoyed, but it's your
call.

James

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:core/urgent] idle: Enable interrupts in the weak arch_cpu_idle() implementation
  2013-06-14 18:55 [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96 James Bottomley
  2013-06-14 19:11 ` David Daney
  2013-06-14 20:39 ` Thomas Gleixner
@ 2013-06-19  7:03 ` tip-bot for James Bottomley
  2 siblings, 0 replies; 7+ messages in thread
From: tip-bot for James Bottomley @ 2013-06-19  7:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, srivatsa.bhat, tglx, JBottomley

Commit-ID:  29ce3785b22da47c49f4ef6e14b9014fa5dee261
Gitweb:     http://git.kernel.org/tip/29ce3785b22da47c49f4ef6e14b9014fa5dee261
Author:     James Bottomley <JBottomley@Parallels.com>
AuthorDate: Wed, 8 May 2013 14:05:34 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 14 Jun 2013 23:01:05 +0200

idle: Enable interrupts in the weak arch_cpu_idle() implementation

PARISC bootup triggers the warning at kernel/cpu/idle.c:96. That's
caused by the weak arch_cpu_idle() implementation, which is provided
to avoid that architectures implement idle_poll over and over.

The switchover to polling mode happens in the first call of the weak
arch_cpu_idle() implementation, but that code fails to reenable
interrupts and therefor triggers the warning.

Fix this by enabling interrupts in the weak arch_cpu_idle() code.

[ tglx: Made the changelog match the patch ]

Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1371236142.2726.43.camel@dabdike
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/cpu/idle.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cpu/idle.c b/kernel/cpu/idle.c
index bf2ee1a..e695c0a 100644
--- a/kernel/cpu/idle.c
+++ b/kernel/cpu/idle.c
@@ -59,6 +59,7 @@ void __weak arch_cpu_idle_dead(void) { }
 void __weak arch_cpu_idle(void)
 {
 	cpu_idle_force_poll = 1;
+	local_irq_enable();
 }
 
 /*

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-19  7:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-14 18:55 [PATCH RESEND] fix WARNING: at kernel/cpu/idle.c:96 James Bottomley
2013-06-14 19:11 ` David Daney
2013-06-14 19:13   ` James Bottomley
2013-06-14 20:39 ` Thomas Gleixner
2013-06-14 20:49   ` Thomas Gleixner
2013-06-14 21:50   ` James Bottomley
2013-06-19  7:03 ` [tip:core/urgent] idle: Enable interrupts in the weak arch_cpu_idle() implementation tip-bot for James Bottomley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.