Re: [PATCH] staging: comedi: ni_mio_common: always lock in ni_ai_poll()

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

 



On 2012-09-24 22:14, H Hartley Sweeten wrote:
On Monday, September 24, 2012 8:28 AM, Ian Abbott wrote:
`ni_ai_poll()` currently acquires (and later releases) the comedi
device's spin-lock iff `in_interrupt()` returns 0.  However, it is only
called during processing of a `COMEDI_POLL` ioctl so `in_interrupt()`
will always return 0 in this case.  Remove this test and acquire/release
the spin-lock unconditionally.  This eliminates a sparse warning about
different lock contexts for basic block.

Ian,

How can you guarantee that the user space COMEDI_POLL ioctl wil
never happen when this driver is handling its interrupt?

Some other task may be handling the interrupt, but not the current task because no callers of `ni_ai_poll()` run in an interrupt context, so `in_interrupt()` will return 0.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux