Re: scheduling policy of bottom halfs, task_queues and timers?

tytso@mit.edu
Thu, 15 Apr 1999 17:01:40 -0400 (EDT)


Date: Tue, 13 Apr 1999 21:05:45 +0100
From: Roger Gammans <rgammans@computer-surgery.co.uk>

There is another irq to signal the end of the wait time, but obviously
with isr's or bh's being schedulable a wait_for_irq() is out of the
question. I presume other drivers have solved this problem.. it seems
rather nasty though to do it a chain of ISRs.

You don't need to schedule a wait_for_irq(). When you process the first
interrupt, set whatever state you need and then return from the
interrupt. When the second interrupt happens, your interrupt handler
will be called again, and you can retrieve the state from the first
interrupt so that you can pick up where you left off.

The trick is that you have to change how you think about the thread of
control. If you know you're going to get a second interrupt at the end
of the wait period, you can simply return from the first interrupt.
Your device driver will regain control of the CPU at the end of the wait
period, when the second interrupt happens.

- Ted

-
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/