public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* How to wait for threaded irq handler to finish, as in work queue flush/cancel?
       [not found] <1326519475.54455.YahooMailNeo@web112702.mail.gq1.yahoo.com>
@ 2012-01-14  5:40 ` Feng Ye
  2012-01-14  7:53   ` Cong Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Feng Ye @ 2012-01-14  5:40 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

Hello there,


I have a question regarding how to cancel threaded irq handler in a driver's suspend function.
If it's NOT threaded irq, normally you have a work queue, and in the suspend function, you call either cancel_work_sync() or flush_work(), these function will WAIT for the work queue to finish if it's in the middle of something.
However if you use threaded irq, then you don't need a work queue, then in the suspend function, I don't know if there's a simple function that can be used to cancel and wait the thread to finish?


Thanks,
Feng

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to wait for threaded irq handler to finish, as in work queue flush/cancel?
  2012-01-14  5:40 ` How to wait for threaded irq handler to finish, as in work queue flush/cancel? Feng Ye
@ 2012-01-14  7:53   ` Cong Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Cong Wang @ 2012-01-14  7:53 UTC (permalink / raw)
  To: Feng Ye; +Cc: linux-kernel@vger.kernel.org

On 01/14/2012 01:40 PM, Feng Ye wrote:
> Hello there,
>
>
> I have a question regarding how to cancel threaded irq handler in a driver's suspend function.
> If it's NOT threaded irq, normally you have a work queue, and in the suspend function, you call either cancel_work_sync() or flush_work(), these function will WAIT for the work queue to finish if it's in the middle of something.
> However if you use threaded irq, then you don't need a work queue, then in the suspend function, I don't know if there's a simple function that can be used to cancel and wait the thread to finish?
>
>

Hi,

Isn't free_irq() what you want?

/**
  *      free_irq - free an interrupt allocated with request_irq
  *      @irq: Interrupt line to free
  *      @dev_id: Device identity to free
  *
  *      Remove an interrupt handler. The handler is removed and if the
  *      interrupt line is no longer in use by any driver it is disabled.
  *      On a shared IRQ the caller must ensure the interrupt is disabled
  *      on the card it drives before calling this function. The function
  *      does not return until any executing interrupts for this IRQ
  *      have completed.
  *
  *      This function must not be called from interrupt context.
  */


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-14  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1326519475.54455.YahooMailNeo@web112702.mail.gq1.yahoo.com>
2012-01-14  5:40 ` How to wait for threaded irq handler to finish, as in work queue flush/cancel? Feng Ye
2012-01-14  7:53   ` Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox