lkml.org 
[lkml]   [1999]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectScheduling inside bottom-half

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/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.054 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site