shunty
shunty

Reputation: 375

Interrupt handling in linux and Pending interrupt

Basic question about linux interrupt handling

In my driver i disable the interrupt line of a peripheral and do some processing, during this time peripheral is sending interrupt. when i enable the interrupt line i received the pending interrupt which happened during that time.

is this correct understanding?

If yes how can i discard those interrupt which came during the interrupt disable period.

I can implement some work around using some delay, looking for linux API or clean way to do this.

Before enabling the interrupt we can set

    desc = irq_to_desc(client->irq);
    desc->istate &= ~IRQS_PENDING;

and enable the interrupt line it will clear all the pending interrupt, but the code says we should never modify these variable.

Thank you

Upvotes: 1

Views: 2123

Answers (1)

P. Morel
P. Morel

Reputation: 86

May be I did not understood but I think what you must do is:

  • disable interupt on the device directly and not using kernel interrupt handling routines

  • the poll your device, fetching all event. may be you should do this in a threaded interrupt handler

  • when finished re-enable interrupts on the device

Upvotes: 1

Related Questions