linux_dsm_epyc7002/drivers/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
..
accel 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
adc The first round of IIO fixes for the 3.11 cycle. 2013-07-16 22:41:38 -07:00
amplifiers iio:amplifiers:ad8366 move to info_mask_(shared_by_type/separate) 2013-03-17 19:49:30 +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: dac: ad7303: fix error return code in ad7303_probe() 2013-06-29 10:18:21 +01:00
frequency iio: frequency: adf4350: Add support for dt bindings 2013-06-09 19:15:43 +01:00
gyro staging:iio:adis16130: Move out of staging 2013-06-11 20:34:36 +01:00
imu iio:trigger: Introduce iio_tigger_{set,get}_drvdata 2013-03-25 21:06:09 +00:00
light iio: Correct HID light sensor name in comments 2013-05-22 22:16:49 +01:00
magnetometer 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
pressure iio: lps331ap: Fix wrong in_pressure_scale output value 2013-07-16 08:51:57 +01:00
trigger iio:trigger:interrupt fix formatting of rsize variable in name 2013-06-08 10:00:58 +01:00
buffer_cb.c iio:callback buffer: free the scan_mask 2013-06-04 18:19:30 +01:00
iio_core_trigger.h IIO: Move the core files to drivers/iio 2012-04-25 11:11:38 -07:00
iio_core.h iio: Add OF support 2013-03-16 10:17:59 +00:00
industrialio-buffer.c iio: buffer: cleanup messages in iio_update_buffers() 2013-05-22 22:16:47 +01:00
industrialio-core.c iio:core drop info_mask from struct iio_info 2013-03-17 19:49:44 +00:00
industrialio-event.c iio: events: Make iio_push_event() IRQ context save 2013-03-17 20:04:45 +00:00
industrialio-trigger.c iio:trigger: Fix use_count race condition 2013-07-20 10:18:53 +01:00
industrialio-triggered-buffer.c iio: Add helper function for initializing triggered buffers 2012-06-18 17:26:09 -07:00
inkern.c iio: inkern: fix iio_convert_raw_to_processed_unlocked 2013-07-03 20:30:52 +01:00
Kconfig iio:pressure: Add STMicroelectronics pressures driver 2013-06-05 18:41:23 +01:00
kfifo_buf.c staging:iio: Remove noop call to __iio_update_buffer 2013-01-31 17:56:44 +00:00
Makefile iio:pressure: Add STMicroelectronics pressures driver 2013-06-05 18:41:23 +01:00