views:

44

answers:

1

In a device driver for some PCI hardware, I have an ioctl call that waits for an incoming interrupt on the PCI bus. Using wait_queue_head_t, I put the task to sleep by calling schedule().

Then, the irq_handler function wakes up this task when the interrupt is raised on the PCI bus. Everything seems to work correctly.

My question is how to differentiate whether the schedule() call is returning because of my irq_handler function wake it up, or because some signal has been send?

Do I have to handle it by myself with flags in the irq_handler function?

+2  A: 

Something along the lines of this, after the schedule call:

if (signal_pending(current)) {
    retval = -EINTR;
caf