Scheduling inside bottom-half

Linux Lists (lists@cyclades.com)
Thu, 30 Sep 1999 12:50:40 -0700 (PDT)


Hello,

I'm trying to solve a driver problem where an interrupt happens, but the
kernel doesn't have space in its buffers to copy data from the device. As
this interrupt was serviced, it will never occur again, and the data will
remain in the device forever.

The solution I found is to detect the condition and then signal an event
to the bottom-half. Once this event occurs, the bottom-half will then
"sleep" (using current->timeout / schedule) for one jiffy and then
generate the interrupt again.

It's something like this:

intr_handler()
{
(...)
if (no_space_in_kbuf) {
sched_event(KBUF_FULL);
}
(...)
}

do_softint() /* bottom-half */
{
(...)
if (event == KBUF_FULL) {
current->state = TASK_INTERRUPTIBLE;
current->timeout = jiffies + 1;
schedule();
generate_intr();
}
(...)
}

The code works (i.e., it does what it's supposed to do), BUT:

Aiee: scheduling in interrupt 108440cc
idle task may not sleep
Aiee: scheduling in interrupt 108440cc
idle task may not sleep
Aiee: scheduling in interrupt 108440cc
idle task may not sleep

Does anyone have any idea on how I can solve this??

Thanks in advance.

Regards,
Ivan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/