Re: [PATCH for-next 01/11] IB/hfi1: Destroy link_wq workqueue after free_irq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 18, 2017 at 07:56:16PM -0800, Dennis Dalessandro wrote:
 
> When kernel is built with CONFIG_DEBUG_SHIRQ config flag, an extra call
> to IRQ handler is made from _free_irq() function. The driver should be
> prepared for this fake call.

It is not a 'fake call' it is call designed to test what happens
during an IRQ handler racing with free.

> Adding a mechanism which detects whether handler is invoked after
> disabling interrupts. hfi_intr_mask field is added to hfi1_devdata
> structure which is replica of interrupt mask register of hfi device.
> The field is updated while writing a value to register.

And this is not the typical solution.

Explain why adding a non-atomic variable to a concurrancy doesn't just
create races and a mess??

free_irq() is a synchronous fence, It returns once all the running IRQ
handlers have exited and guarantees they will not be called again.

You are supposed to call it before destroying anything that the IRQ
handler could be using.

re-ordering desstruction order is the typical solution.

Jason

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux