You don't actually want a kernel thread. You want a workqueue. You can queue a worker function from your interrupt top-half, and the kernel will run it in process context as soon as it has time. If you can avoid sleeping, you can use the shared queue via the functions schedule_work()
and schedule_delayed_work()
.
To avoid sleeping, queue one work function to turn on the LED. At the end of that function, queue a delayed work function to turn it off.
If you instead want to do a simple TURN_ON(); sleep(); TURN_OFF()
, you'll need to create your own workqueue at module init, and submit to that using queue_work()
and queue_delayed_work()