fix swsusp for gatekeeper thread
PATCH 1/1 fix swsusp for gatekeeper thread
Hi,
this is a convenience patch for people like me running Xenomai on their workstation or notebook. It fixes a crash that occurs on suspend to disk/ram via swsusp because the gatekeeper is woken up by the suspension code but has nothing to migrate then.
With this patch applied, you can now suspend your machine as long as no skin is loaded, i.e. the nucleus is passive. When skins are loaded, the system hangs on resume, maybe due to wrong hardware re-initialisation.
Jan
include/asm-generic/wrappers.h | 3 +++ ksrc/nucleus/shadow.c | 2 ++ 2 files changed, 5 insertions(+)
asm-generic/wrappers.h (Arbeitskopie) renamed from asm-generic/wrappers.h (Revision 1281) +3 -0
@@ -161,6 +161,9 @@ struct task_struct; void show_stack(struct task_struct *task, unsigned long *sp); +/* Process suspension */ +#define PF_NOFREEZE 0 + #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) */ /* VM */
nucleus/shadow.c (Arbeitskopie) renamed from nucleus/shadow.c (Revision 1281) +2 -0
@@ -53,6 +53,7 @@ #include <nucleus/ppd.h> #include <nucleus/trace.h> #include <asm/xenomai/features.h> +#include <asm/xenomai/wrappers.h> int nkthrptd;
@@ -2023,6 +2024,7 @@ int xnshadow_mount(void) gk->server = kthread_create(&gatekeeper_thread, gk, "gatekeeper/%d", cpu); + gk->server->flags |= PF_NOFREEZE; wake_up_process(gk->server); down(&gk->sync); }
Philippe Gerum
AppliedQuoted 6 lines · Jan Kiszka
Hi,
this is a convenience patch for people like me running Xenomai on their workstation or notebook. It fixes a crash that occurs on suspend to disk/ram via swsusp because the gatekeeper is woken up by the suspension code but has nothing to migrate then.
With this patch applied, you can now suspend your machine as long as no skin is loaded, i.e. the nucleus is passive. When skins are loaded, the system hangs on resume, maybe due to wrong hardware re-initialisation.
Merged, thanks.
Signature · 1 line
Philippe.