Projects/EchotekHardware/EchotekWindriverIRQProblem

Echotek Win Driver IRQ Shutdown Problem

2006-01-05 FDL

2006-01-11 FDL

Description

This problem impacts the use of the Echotek GC314 in DMA mode under Linux in conjunction with the Echotek supplied Win Driver. The DMA interrupts are not handled correctly and this results in the linux kernel eventually shutting off the IRQ handler after a deterministic number of interrupts that is set in the kernel. No message is set to the user level process so this cannot be caught and handled in anyway.

Solution

It turns out that the code which returns a IRQ_HANDLED value to the kernel is actually included in the Echotek supplied WinDriver "redist" and can be patched. The problem appears to occur because the WinDriver uses a LINUX_26 #define which isn't getting evaluated properly for some reason. This is just another lesson that #ifdef is a terrible thing to use in software as it tends to introduce bugs. The file which needs to be modified is the linux_wrappers.c file and the hacked code is simply as follows :


/*#if defined(LINUX_26)
irqreturn_t
#else
void
#endif*/
irqreturn_t
wrapper_handler(int irq, void *ctx, struct pt_regs *pt)
{
   struct int_wrapper *context = (struct int_wrapper *)ctx;
   int rc = 0;
   if (context && context->handler)
       rc = context->handler(context->ctx);
   /*#if defined(LINUX_26)
   return rc;
   #endif*/

   return IRQ_HANDLED;
} 

last edited 2006-01-11 21:37:35 by FrankLind