linux/drivers/iio
Quentin Schulz be2ea53330 iio: adc: sun4i-gpadc-iio: fix unbalanced irq enable/disable
When initializing interrupts, the devm_request_any_context_irq will
enable them right away. An atomic flag was set in sun4i_irq_init and read
in the interrupt handler to make sure no unwanted interrupts were
handled. If an unwanted interrupt occurred, the handler would disable
the irq and return IRQ_HANDLED. However, at the end of sun4i_irq_init,
the irq would be disabled as well, resulting in an unbalanced enable
(since there are more disables than enables, the code enabling the
interrupt would never be called).

When reading the ADC or the temperature, the respective irq would be
enabled in the read function and disabled in the irq handler. In the
read function, we would wait for a completion (with a timeout) that will
be set in the irq handler. However, if the completion is never set or if
the wait for completion times out, the irq would not be disabled in the
read function resulting in an unbalanced enable once the read function
is called again (since there are 2+ enables for no disable).

Moving disable_irq from the irq handler to the read function get rid of
these two cases of unbalanced enable.

Fixes: d1caa99055 ("iio: adc: add support for Allwinner SoCs ADC")

Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-07-04 20:28:34 +01:00
..
accel Merge 4.11-rc6 into staging-next 2017-04-10 15:21:55 +02:00
adc iio: adc: sun4i-gpadc-iio: fix unbalanced irq enable/disable 2017-07-04 20:28:34 +01:00
amplifiers spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
buffer iio: buffer-dmaengine: Add missing header buffer_impl.h 2017-06-13 20:56:05 +01:00
chemical drivers: iio: chemical: replace comma with a semicolon 2017-03-30 19:13:23 +01:00
common Fifth set of IIO fixes for the 4.11 cycle. 2017-04-18 19:38:38 +02:00
counter iio: pc104: Mask PC/104 drivers via the PC104 Kconfig option 2017-03-15 21:59:08 +00:00
dac Annotation of module parameters that specify device settings 2017-05-10 19:13:03 -07:00
dummy iio:dummy: Stop enabling timestamp by default. 2017-01-10 19:54:55 +00:00
frequency iio: frequency: ad9523: use unsigned int rather then bare unsigned 2016-04-17 10:31:03 +01:00
gyro Fourth set of IIO new device support, features and cleanups for the 4.12 cycle 2017-04-18 17:13:31 +02:00
health First set of IIO new device support, features and cleanup for the 4.12 cycle. 2017-03-06 13:17:21 +01:00
humidity iio: humidity: hts221: Remove unnecessary cast on void pointer 2017-04-02 09:50:32 +01:00
imu iio: imu: inv_mpu6050: add accel lpf setting for chip >= MPU6500 2017-06-03 09:40:40 +01:00
light iio: light: tsl2563: use correct event code 2017-06-24 20:42:49 +01:00
magnetometer Merge 4.11-rc4 into staging-next 2017-03-27 09:11:25 +02:00
orientation iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) 2016-11-05 17:47:47 +00:00
potentiometer iio: max5481: Add support for Maxim digital potentiometers 2017-01-28 12:13:31 +00:00
potentiostat iio: lmp91000: Set parent device 2017-02-19 12:01:52 +00:00
pressure iio: pressure: st_pressure_core: disable multiread by default for LPS22HB 2017-06-24 20:46:25 +01:00
proximity iio: proximity: as3935: fix iio_trigger_poll issue 2017-05-07 13:21:55 +01:00
temperature iio: mlx96014: Add OF device ID table 2017-03-19 10:49:24 +00:00
trigger Fifth set of IIO fixes for the 4.11 cycle. 2017-04-18 19:38:38 +02: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 sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +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 char/misc patches for 4.12-rc1 2017-05-04 19:15:35 -07:00
industrialio-event.c iio: iio_push_event(): Don't crash if the event interface is not registered 2016-09-10 16:40:44 +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: trigger: fix NULL pointer dereference in iio_trigger_write_current() 2017-05-21 12:36:59 +01:00
industrialio-triggered-event.c
inkern.c iio: inkern: pass through raw values if no scaling 2017-01-14 12:20:18 +00:00
Kconfig iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8 2016-10-01 17:06:21 +01:00
Makefile iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8 2016-10-01 17:06:21 +01:00