Skip to contentSkip to conversation

acpi-swsusp19

PATCH In review Lucas Correia Villa Real 2 participants 2 messages May 1, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi-swsusp19

Hi,

I have found some problems when compiling a patched kernel (2.4.20) with both ACPI and software suspend disabled (version acpi-acpi20021212-swsusp19):

kernel/kernel.o: In function `schedule':
kernel/kernel.o(.text+0x25d): undefined reference to TASK_SUSPENDED' kernel/kernel.o(.text+0x2da): undefined reference to TASK_SUSPENDED' make[1]: *** [kallsyms] Error 1

The patch below can fix this error.
Lucas

kernel/sched.c +6 -0
@@ -29,6 +29,9 @@
 #include <linux/completion.h>
 #include <linux/prefetch.h>
 #include <linux/compiler.h>
+#ifdef CONFIG_SOFTWARE_SUSPEND
+#include <linux/suspend.h>
+#endif
 
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
@@ -115,15 +118,24 @@
 #ifdef CONFIG_SMP
 
 #define idle_task(cpu) (init_tasks[cpu_number_map(cpu)])
+#ifdef CONFIG_SOFTWARE_SUSPEND
+#define can_schedule(p,cpu) \
+	((!TASK_SUSPENDED(p)) && ((p)->cpus_runnable & (p)->cpus_allowed & (1UL << 

cpu)))
+#else
#define can_schedule(p,cpu) \
- ((p)->cpus_runnable & (p)->cpus_allowed & (1 << cpu))
+ ((p)->cpus_runnable & (p)->cpus_allowed & (1 << cpu))
+#endif /* CONFIG_SOFTWARE_SUSPEND */

#else

#define idle_task(cpu) (&init_task)
+#ifdef CONFIG_SOFTWARE_SUSPEND
+#define can_schedule(p,cpu) (!TASK_SUSPENDED(p))
+#else
#define can_schedule(p,cpu) (1)
+#endif /* CONFIG_SOFTWARE_SUSPEND */

-#endif
+#endif /* CONFIG_SMP */

void scheduling_functions_start_here(void) { }

@@ -634,6 +646,11 @@
task_set_cpu(next, this_cpu);
spin_unlock_irq(&runqueue_lock);

+#ifdef CONFIG_SOFTWARE_SUSPEND
+ if (unlikely(TASK_SUSPENDED(next)))
+ printk("Scheduling suspended task %s!\n", next->comm);
+#endif
+
if (unlikely(prev == next)) {
/* We won't go through the normal tail, so do this by hand */ prev->policy &= ~SCHED_YIELD;

#1 lore raw

Hi.

Thanks for the patch. You should probably try the latest development patch (27), which already addresses that issue. Thanks anyway for your work, and please feel free to submit other patches. The swsusp list can be found via www.sourceforge.net/projects/swsusp.

Regards,

Nigel