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 iio:adc:ad_sigma_delta move to info_mask_(shared_by_type/separate) 2013-03-17 19:49:24 +00:00
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 iio: add mcp4725 I2C DAC driver 2012-06-12 14:50:51 -07:00
frequency iio: frequency: adf4350: cast value to unsigned to make code checkers happy 2013-06-04 18:36:52 +01:00
gyro itg3200: fix incorrect ifdef comment 2013-03-18 10:59:42 +01:00
imu staging:iio:accel:adis move to info_mask_(shared_by_type/separate) 2013-03-17 19:49:37 +00:00
buffer.h staging:iio: Remove noop call to __iio_update_buffer 2013-01-31 17:56:44 +00:00
consumer.h iio: Update iio_channel_get API to use consumer device pointer as argument 2013-02-06 19:23:52 +00:00
driver.h iio: Simplify iio_map_array_unregister API 2013-02-02 12:02:20 +00:00
events.h iio: iio/events.h typos 2012-06-15 14:39:19 -07:00
iio.h iio: Fix iio_channel_has_info 2013-07-02 22:08:20 +01:00
kfifo_buf.h iio: Add missing include guards to headers 2012-08-27 18:57:56 +01:00
machine.h staging:iio:in kernel users: Add a data field for channel specific info. 2012-11-10 10:17:27 +00:00
sysfs.h iio: correct documentation for IIO_CONST_ATTR_SAMP_FREQ_AVAIL, match name of #define 2012-06-18 17:31:42 -07:00
trigger.h iio:trigger: Fix use_count race condition 2013-07-20 10:18:53 +01:00
trigger_consumer.h iio:trigger_consumer.h: Add missing includes and forward declarations 2012-08-27 18:57:59 +01:00
triggered_buffer.h iio: Add helper function for initializing triggered buffers 2012-06-18 17:26:09 -07:00
types.h iio: Add pressure channel type 2012-11-20 21:26:38 +00:00