Hi Thomas and Dick,
I appreciate all the responses. They are very good information to me.
Actually, it wasn't me working on the driver but it's been there long
time. I thought I just need to add the signal and signal handling
part, not expecting it would lead me to the driver space.
Here is what I have in the driver. Maybe racing condition could happen
in scenario that the ioctl realease the lock but befor going to sleep,
the ISR is invoked and call waking up on the queue, hence the ioctl
will not be waken up since the wak up cal already executed. But I
believe in our system, this could be tolerant since the hardware would
keep raising interrupt if the abnormal condition still exists (Due to
the ioctl being blocked so user app nevers get a chance to service the
device). But is this the reason why my signal handler not get executed
at all? Theoretically, according to the Richard Stevens book, I think
the process should be waken up and received the signal even if it gets
blocked in the IOCTL call, am i right?
static int ats89_ioctl(struct inode *inode, struct file *file, u_int
cmd, u_long arg)
{
switch(cmd){
case GET_IRQ_CMD: {
u32 regMask32;
spin_lock_irq(dev->lock);
while ((dev->irqMask & dev->irqEvent) == 0) {
// Sleep until board interrupt happens
spin_unlock_irq(dev->lock);
interruptible_sleep_on(&(dev->boardIRQWaitQueue));
if (uncond_wakeup) {
/* don't go back to loop */
break;
}
spin_lock_irq(dev->lock);
}