linux/drivers/iio
Vignesh R 90c43ec699 iio: adc: ti_am335x_adc: Protect FIFO1 from concurrent access
It is possible that two or more ADC channels can be simultaneously
requested for raw samples, in which case there can be race in access to
FIFO data resulting in loss of samples.
If am335x_tsc_se_set_once() is called again from tiadc_read_raw(), when
ADC is still acquired to sample one of the channels, the second process
might be put into uninterruptible sleep state. Fix these issues, by
protecting FIFO access and channel configurations with a mutex. Since
tiadc_read_raw() might take anywhere between few microseconds to few
milliseconds to finish execution (depending on averaging and delay
values supplied via DT), its better to use mutex instead of spinlock.

Fixes: 7ca6740cd1 ("mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization")
Signed-off-by: Vignesh R <vigneshr@ti.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 19:47:58 +01:00
..
accel iio: add Kconfig selects needed for triggered buffer compiles 2016-08-15 15:42:04 +01:00
adc iio: adc: ti_am335x_adc: Protect FIFO1 from concurrent access 2016-08-21 19:47:58 +01:00
amplifiers spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
buffer iio: buffer-dma: Use ARRAY_SIZE in for loop range 2016-06-27 21:06:40 +01:00
chemical iio: chemical: atlas-ph-sensor: fix typo in val assignment 2016-08-21 16:23:27 +01:00
common iio:st_sensors: align on storagebits boundaries 2016-07-04 18:07:45 +01:00
dac iio: stx104: Unregister IIO device on remove callback 2016-08-15 15:39:32 +01:00
dummy iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
frequency iio: frequency: ad9523: use unsigned int rather then bare unsigned 2016-04-17 10:31:03 +01:00
gyro iio: bmg160: add callbacks for the filter frequency 2016-07-03 12:39:55 +01:00
health First round of IIO new device support, features and cleanups for the 4.8 cycle. 2016-06-09 09:15:58 -07:00
humidity iio: humidity: hdc100x: fix sensor data reads of temp and humidity 2016-08-15 17:01:53 +01:00
imu Third set of IIO new device support, features and cleanups for the 4.8 cycle. 2016-07-14 12:05:29 +09:00
light iio: add Kconfig selects needed for triggered buffer compiles 2016-08-15 15:42:04 +01:00
magnetometer iio: magn: ak8975: deploy runtime and system PM 2016-06-30 20:40:16 +01:00
orientation
potentiometer iio: potentiometer: Fix typo in Kconfig 2016-07-03 12:40:01 +01:00
pressure iio: pressure: bmp280: fix runtime suspend/resume crash 2016-08-15 15:46:06 +01:00
proximity iio: proximity: as3935: set up buffer timestamps for non-zero values 2016-08-15 15:39:27 +01:00
temperature iio: Export I2C module alias information 2016-05-21 20:08:14 +01:00
trigger iio:trigger: Experimental kthread tight loop trigger (thread only) 2016-06-03 13:18:44 +01:00
iio_core_trigger.h
iio_core.h iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
industrialio-buffer.c iio: fix sched WARNING "do not call blocking ops when !TASK_RUNNING" 2016-08-21 16:22:44 +01:00
industrialio-configfs.c iio:configfs: Introduce iio/configfs.h to provide a location for the configfs_subsystem 2015-12-05 16:25:30 +00:00
industrialio-core.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
industrialio-event.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
industrialio-sw-device.c iio: Add support for creating IIO devices via configfs 2016-05-04 11:43:54 +01:00
industrialio-sw-trigger.c iio: core: fix ptr_ret.cocci warnings 2016-01-20 17:09:18 -08:00
industrialio-trigger.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
industrialio-triggered-event.c iio: Support triggered events 2015-08-27 20:47:09 +01:00
inkern.c iio: core: Add devm_ APIs for iio_channel_{get,release}_all 2016-04-19 19:58:15 +01:00
Kconfig iio: Add support for creating IIO devices via configfs 2016-05-04 11:43:54 +01:00
Makefile iio: Add support for creating IIO devices via configfs 2016-05-04 11:43:54 +01:00