Commit 20cd4151 authored by Vikram Narayanan's avatar Vikram Narayanan

lcd/ixgbe/boot: Use waitq for sleeping until exit

Instead of using naive schedule() that hogs the cpu, use a wait queue and wake
up the thread when someone pulls the plug.
Signed-off-by: Vikram Narayanan's avatarVikram Narayanan <vikram186@gmail.com>
parent e6876a5d
......@@ -145,6 +145,9 @@ fail1:
}
#ifdef BOOT_THREAD
static DECLARE_WAIT_QUEUE_HEAD(wq);
static int shutdown = 0;
int boot_lcd_thread(void *data)
{
static unsigned once = 0;
......@@ -156,7 +159,7 @@ int boot_lcd_thread(void *data)
});
}
once = 1;
schedule();
wait_event_interruptible(wq, shutdown != 0);
}
LIBLCD_MSG("Exiting thread");
......@@ -188,6 +191,8 @@ static void boot_exit(void)
/* nothing to do */
if (!IS_ERR(boot_task)) {
LIBLCD_MSG("%s: exiting", __func__);
shutdown = 1;
wake_up_interruptible(&wq);
kthread_stop(boot_task);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment