Re: [PATCH] iio: make blocking read wait for data

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

 



2014-06-06 16:38 GMT+02:00 Lars-Peter Clausen <lars@xxxxxxxxxx>:
>
> On 06/06/2014 04:30 PM, Josselin Costanzi wrote:
>>
>> Currently the IIO buffer blocking read only wait until at least one
>> data element is available.
>
> But that is how it is supposed to work. With this patch for example you won't be able to read the last data from the buffer after the buffer has been disabled.

I don't understand the usecase this patch breaks... If the buffer is
disabled then we return what was read alreay.


> Or if for example n is not aligned to the sample size you'll also continue to loop forever.

If n isn't aligned to the sample size, wouldn't iio_read_first_n_kfifo
still return data multiple of samples size? In that case we would copy
complete elements until we try to do a short read which would fail at
n < kfifo_esize(&kf->kf) (in iio_read_first_n_kfifo).

-- 
Josselin Costanzi
  Embedded Linux System Engineer
--
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