Domanda

The kernel documentation says about free_irq the following :

This function must not be called from interrupt context.

Does it include software interrupts? How can I free an IRQ in a software IRQ function?

Thanks for your help,

È stato utile?

Soluzione

Yes, that rule includes softirq context. The fact that you think you need to call free_irq() from softirq context is an indication that your design is a bit out of the ordinary -- in normal cases, free_irq() is used when a device being shut down, which is almost always from process context.

However if you really need to do it, the thing to do would be to defer it to process context via schedule_work() or some similar workqueue function. Of course you can't wait in your softirq for that deferred work to complete, so you'll have to defer any other work that comes after freeing the IRQ also.

It might be possible to give a better answer if you gave a bit more information about why you're trying to call free_irq() from interrupt context.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top