Re: [PATCH v2] staging: iio: adis16240: Remove mutex_lock() and mutex_unlock() function call.

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

 



On 17/03/17 09:03, Lars-Peter Clausen wrote:
> On 03/15/2017 11:11 PM, Jonathan Cameron wrote:
>> On 14/03/17 16:23, Varsha Rao wrote:
>>> Remove mutex_lock() and mutex_unlock() function calls, as the
>>> adis16240_spi_read_signed() function can be run parallel and safely
>>> multiple times. Also remove the mutex.h header file and comment, which
>>> are no longer required.
>>>
>>> As indio_dev is declared and initialized in adis16240_spi_read_signed(),
>>> again declaration to same type and initialization to same value is not
>>> required, remove it from adis16240_read_12bit_signed().
>>>
>>> Simplify the return logic, by merging assignment and return into a single
>>> line.
>>>
>>> Signed-off-by: Varsha Rao <rvarsha016@xxxxxxxxx>
>> It's a bit obscure, but isn't there the potential to get the check_status
>> call spitting out text for the wrong read, or potentially miss a status
>> value entirely?
>>
>> (kind of more for Lars really, but feel free to comment Varsha!)
>>
>> The various faults look like this wouldn't be an issue, but I'm not
>> totally sure about the SPI failure and whether a following good read
>> at exactly the wrong time might result in the error not being reported...
> 
> I don't think it matters. The error reporting is asynchronous anyway and the
> bits are read-to-clear. So even if two access see the error flag set in the
> data only one of them will be able to read the bits in the diag_stat
> register (unless the error is persistent, in which case the error flag in
> the data would also be persistent).
Fair enough.

Applied to the togreg branch of iio.git - will push out as testing later
for the autobuilders to play with it.


Thanks,

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

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" 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]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux