Skip to contentSkip to conversation

ppc: fix idle with interrupts disabled

PATCH In review Brian Waite 1 participant 3 messages Jan 13, 2005 – Jan 14, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · Linux Kernel Mailing List

ChangeSet 1.2369, 2005/01/11 17:41:19-08:00, [email protected]

[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

#2 lore raw

PATCH 1/1 ppc: fix powersave with interrupts disabled

Quoted 6 lines · Brian Waite
Quoted 4 lines · Linux Kernel Mailing List

ChangeSet 1.2369, 2005/01/11 17:41:19-08:00, [email protected]

[PATCH] ppc: fix idle with interrupts disabled

Quoted 8 lines
Quoted 3 lines

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.

===== arch/ppc/kernel/idle.c 1.22 vs edited =====

arch/ppc/kernel/idle.c Thu Jan 13 17:22:25 2005 renamed from arch/ppc/kernel/idle.c Tue Jan 11 19:42:36 2005 +3 -2
@@ -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);
#3 lore raw

Re: [RESEND][PATCH] ppc: fix powersave with interrupts disabled

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.

arch/ppc/kernel/idle.c Thu Jan 13 17:22:25 2005 renamed from arch/ppc/kernel/idle.c Tue Jan 11 19:42:36 2005 +3 -2
@@ -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);

===== arch/ppc/kernel/idle.c 1.22 vs edited =====

arch/ppc/kernel/idle.c +3 -2
@@ -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);