alistair23-linux/include/linux/iio
Lars-Peter Clausen a1a8e1dc11 iio:trigger: Fix use_count race condition
When using more than one trigger consumer it can happen that multiple threads
perform a read-modify-update cycle on 'use_count' concurrently. This can cause
updates to be lost and use_count can get stuck at non-zero value, in which case
the IIO core assumes that at least one thread is still running and will wait for
it to finish before running any trigger handlers again. This effectively renders
the trigger disabled and a reboot is necessary before it can be used again. To
fix this make use_count an atomic variable. Also set it to the number of
consumers before starting the first consumer, otherwise it might happen that
use_count drops to 0 even though not all consumers have been run yet.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-07-20 10:18:53 +01:00
..
adc
common iio:common: Removed stuff macros, added num_data_channels on st_sensors struct and added support on one-shot sysfs reads to 3 byte channel 2013-06-05 18:41:23 +01:00
dac
frequency iio: frequency: adf4350: cast value to unsigned to make code checkers happy 2013-06-04 18:36:52 +01:00
gyro
imu
buffer.h
consumer.h
driver.h
events.h
iio.h iio: Fix iio_channel_has_info 2013-07-02 22:08:20 +01:00
kfifo_buf.h
machine.h
sysfs.h
trigger.h iio:trigger: Fix use_count race condition 2013-07-20 10:18:53 +01:00
trigger_consumer.h
triggered_buffer.h
types.h