public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] ppc: fix idle with interrupts disabled
       [not found] <200501120407.j0C477s1019067@hera.kernel.org>
@ 2005-01-13 20:58 ` Brian Waite
  2005-01-13 22:26   ` [PATCH] ppc: fix powersave " Brian Waite
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Waite @ 2005-01-13 20:58 UTC (permalink / raw)
  To: Linux Kernel Mailing List

On Wed, 12 Jan 2005 01:41:19 +0000, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> ChangeSet 1.2369, 2005/01/11 17:41:19-08:00, tglx@linutronix.de
> 
>         [PATCH] ppc: fix idle with interrupts disabled
> 
>         The idle-thread-preemption-fix.patch in mm1/2 leads to a stalled box on PPC
>         machines which do not provide a powersave function and therefor poll the
>         idle loop with interrupts disabled.  The patch reenables interrupts.
There is still a stall with PPC  boxes that have powersave enabled. I
use a 74xx based board and unless I disable powersave
(ppc_md.power_save=NULL), I get a stall at:
NET: Registered protocol family 2

Reverting default_idle to prepatch form I still see the hang. I think
it is somewhere else in the patchset. Still looking....

Thanks
Brian

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

* [PATCH] ppc: fix powersave with interrupts disabled
  2005-01-13 20:58 ` [PATCH] ppc: fix idle with interrupts disabled Brian Waite
@ 2005-01-13 22:26   ` Brian Waite
  2005-01-14  2:36     ` [RESEND][PATCH] " Brian Waite
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Waite @ 2005-01-13 22:26 UTC (permalink / raw)
  To: Linux Kernel Mailing List

On Thu, 13 Jan 2005 15:58:34 -0500, Brian Waite <linwoes@gmail.com> wrote:
> On Wed, 12 Jan 2005 01:41:19 +0000, Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org> wrote:
> > ChangeSet 1.2369, 2005/01/11 17:41:19-08:00, tglx@linutronix.de
> >
> >         [PATCH] ppc: fix idle with interrupts disabled
> >
> >         The idle-thread-preemption-fix.patch in mm1/2 leads to a stalled box on PPC
> >         machines which do not provide a powersave function and therefor poll the
> >         idle loop with interrupts disabled.  The patch reenables interrupts.
> There is still a stall with PPC  boxes that have powersave enabled. I
> use a 74xx based board and unless I disable powersave
> (ppc_md.power_save=NULL), I get a stall at:
> NET: Registered protocol family 2
> 
It looks like the problem has to do with entering the powersave
routine with irqs disabled. Here is a patch that will only enter
powersave if irqs are enabled:

Entering powersave on PPC while irqs are disabled causes a hang. Only
enter powersave if irqs are disabled.

Signed-off-by: Brian Waite <waite@skycomputers.com>
===== arch/ppc/kernel/idle.c 1.22 vs edited =====
--- 1.22/arch/ppc/kernel/idle.c Tue Jan 11 19:42:36 2005
+++ edited/arch/ppc/kernel/idle.c       Thu Jan 13 17:22:25 2005
@@ -39,8 +39,9 @@
        powersave = ppc_md.power_save;

        if (!need_resched()) {
-               if (powersave != NULL)
-                       powersave();
+               if ((powersave != NULL) && !irqs_disabled())
+                           powersave();
+
                else {
 #ifdef CONFIG_SMP
                        set_thread_flag(TIF_POLLING_NRFLAG);

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

* Re: [RESEND][PATCH] ppc: fix powersave with interrupts disabled
  2005-01-13 22:26   ` [PATCH] ppc: fix powersave " Brian Waite
@ 2005-01-14  2:36     ` Brian Waite
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Waite @ 2005-01-14  2:36 UTC (permalink / raw)
  To: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

I apologize ahead of time for my mailer corrupting the patch. Here is
the patch again attached so as to get whitespace corruption. Also, I
removed a set of excessive parens.

Signed-off-by: Brian Waite <waite@skycomputers.com>

--- 1.22/arch/ppc/kernel/idle.c Tue Jan 11 19:42:36 2005
+++ edited/arch/ppc/kernel/idle.c       Thu Jan 13 17:22:25 2005
@@ -39,8 +39,9 @@
        powersave = ppc_md.power_save;

        if (!need_resched()) {
-               if (powersave != NULL)
-                       powersave();
+               if (powersave != NULL && !irqs_disabled())
+                           powersave();
+
                else {
 #ifdef CONFIG_SMP
                        set_thread_flag(TIF_POLLING_NRFLAG);

[-- Attachment #2: powersave_idle.c.patch --]
[-- Type: application/octet-stream, Size: 433 bytes --]

===== arch/ppc/kernel/idle.c 1.22 vs edited =====
--- 1.22/arch/ppc/kernel/idle.c	Tue Jan 11 19:42:36 2005
+++ edited/arch/ppc/kernel/idle.c	Thu Jan 13 17:22:25 2005
@@ -39,8 +39,9 @@
 	powersave = ppc_md.power_save;
 
 	if (!need_resched()) {
-		if (powersave != NULL)
-			powersave();
+		if (powersave != NULL && !irqs_disabled())
+			    powersave();
+			    
 		else {
 #ifdef CONFIG_SMP
 			set_thread_flag(TIF_POLLING_NRFLAG);

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

end of thread, other threads:[~2005-01-14  2:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200501120407.j0C477s1019067@hera.kernel.org>
2005-01-13 20:58 ` [PATCH] ppc: fix idle with interrupts disabled Brian Waite
2005-01-13 22:26   ` [PATCH] ppc: fix powersave " Brian Waite
2005-01-14  2:36     ` [RESEND][PATCH] " Brian Waite

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox