From: Frank Mori Hess Date: Wed, 8 Dec 2004 01:59:35 +0000 (+0000) Subject: fix for pcmcia fifo-half-full interrupt problems from X-Git-Tag: r0_7_70~84 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1a6d7d3f31f279ca37b9a8ebe1916ae4cbc1dcea;p=comedi.git fix for pcmcia fifo-half-full interrupt problems from "Blacker, Phil M" --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 4757b430..d37def3b 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -621,7 +621,16 @@ static void handle_a_interrupt(comedi_device *dev,unsigned short status, } #ifndef PCIDMA if(status&AI_FIFO_Half_Full_St){ - ni_handle_fifo_half_full(dev); + int i; + static const int timeout = 10; + /* pcmcia cards (at least 6036) seem to stop producing interrupts if we + *fail to get the fifo less than half full, so loop to be sure.*/ + for(i = 0; i < timeout; ++i) + { + ni_handle_fifo_half_full(dev); + if((win_in(AI_Status_1_Register) & AI_FIFO_Half_Full_St) == 0) + break; + } } #endif // !PCIDMA @@ -644,7 +653,7 @@ static void handle_a_interrupt(comedi_device *dev,unsigned short status, #ifdef DEBUG_INTERRUPT status=win_in(AI_Status_1_Register); if(status&Interrupt_A_St){ - printk("handle_a_interrupt: BUG, didn't clear interrupt. disabling.\n"); + printk("handle_a_interrupt: BUG, didn't clear interrupt. disabling. status=0x%x\n", status); win_out(0,Interrupt_Control_Register); } #endif