Project

General

Profile

Feature #3318

Updated by Vadim Mutilin about 12 years ago

The function request_threaded_irq accepts two interrupt handlers 
 # @handler (second parameter) - Regular interrupt handler 
 # @thread_fn (third parameter) - Function called from the irq handler thread (has thread context, hence for example may use might_sleep functions) 

 From comments: 
 If you want to set up a threaded irq handler for your device 
 then you need to supply @handler and @thread_fn. @handler is 
 still called in hard interrupt context and has to check 
 whether the interrupt originates from the device. If yes it 
 needs to disable the interrupt on the device and return 
 IRQ_WAKE_THREAD which will wake up the handler thread and run 
 @thread_fn. This split handler design is necessary to support 
 shared interrupts. 

 <pre> 
 extern int __must_check 
 request_threaded_irq(unsigned int irq, irq_handler_t handler, 
                      irq_handler_t thread_fn, 
                      unsigned long flags, const char *name, void *dev); 
 </pre> 

 Driver environment generator should call  
 * @handler with LDV_IN_INTERRUPT set (as usual) 
 * @thread_fn *without* LDV_IN_INTERRUPT set 

 now it calls call both with LDV_IN_INTERRUPT set 

Back