linux-stable/drivers/iio
Frank Li 0fc3562a99 iio: imx8qxp-adc: fix irq flood when call imx8qxp_adc_read_raw()
irq flood happen when run
    cat /sys/bus/iio/devices/iio:device0/in_voltage1_raw

imx8qxp_adc_read_raw()
{
	...
	enable irq
	/* adc start */
	writel(1, adc->regs + IMX8QXP_ADR_ADC_SWTRIG);
	^^^^ trigger irq flood.
	wait_for_completion_interruptible_timeout();
	readl(adc->regs + IMX8QXP_ADR_ADC_RESFIFO);
	^^^^ clear irq here.
	...
}

There is only FIFO watermark interrupt at this ADC controller.
IRQ line will be assert until software read data from FIFO.
So IRQ flood happen during wait_for_completion_interruptible_timeout().

Move FIFO read into irq handle to avoid irq flood.

Fixes: 1e23dcaa1a ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
Cc: stable@vger.kernel.org

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Cai Huoqing <cai.huoqing@linux.dev>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://lore.kernel.org/r/20221201140110.2653501-1-Frank.Li@nxp.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:20:03 +00:00
..
accel 4th set of IIO fixes for 6.1 2022-11-27 15:05:05 +01:00
adc iio: imx8qxp-adc: fix irq flood when call imx8qxp_adc_read_raw() 2022-12-28 17:20:03 +00:00
addac iio: addac: ad74413r: fix blank line after declaration warning 2022-11-24 19:24:34 +00:00
afe iio: afe: rescale: export symbols used during testing 2022-07-16 19:01:14 +01:00
amplifiers iio: amplifier: hmc425a: simplify using devm_regulator_get_enable() 2022-11-23 19:44:01 +00:00
buffer iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
cdc iio: cdc: ad7746: Convert to i2c's .probe_new() 2022-11-23 20:01:40 +00:00
chemical iio: chemical: vz89x: Convert to i2c's .probe_new() 2022-11-23 20:01:40 +00:00
common iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
dac iio: dac: ti-dac5571: Convert to i2c's .probe_new() 2022-11-23 20:01:41 +00:00
dummy
filter iio: filter: admv8818: close potential out-of-bounds read in __admv8818_read_[h|l]pf_freq() 2022-11-23 19:43:57 +00:00
frequency iio: frequency: adf4377: add support for ADF4377 2022-11-23 21:05:51 +00:00
gyro iio: gyro: adis16260: Call '__adis_initial_startup()' in probe 2022-11-23 20:37:51 +00:00
health 4th set of IIO fixes for 6.1 2022-11-27 15:05:05 +01:00
humidity iio: humidity: si7020: Convert to i2c's .probe_new() 2022-11-23 20:01:42 +00:00
imu 2nd set of IIO new device support, cleanups etc for 6.2 2022-11-27 14:40:05 +01:00
light 4th set of IIO fixes for 6.1 2022-11-27 15:05:05 +01:00
magnetometer iio: magnetometer: yamaha-yas530: Convert to i2c's .probe_new() 2022-11-23 20:20:30 +00:00
multiplexer iio: multiplexer: Switch to use dev_err_probe() helper 2022-11-23 19:43:57 +00:00
orientation
position
potentiometer iio: potentiometer: tpl0102: Convert to i2c's .probe_new() 2022-11-23 20:20:30 +00:00
potentiostat iio: potentiostat: lmp91000: Convert to i2c's .probe_new() 2022-11-23 20:20:30 +00:00
pressure 2nd set of IIO new device support, cleanups etc for 6.2 2022-11-27 14:40:05 +01:00
proximity iio: proximity: sx9500: Convert to i2c's .probe_new() 2022-11-23 20:20:31 +00:00
resolver
temperature iio: temperature: Add driver support for Maxim MAX30208 2022-11-23 20:20:32 +00:00
test iio: test: Mark file local structure arrays static. 2022-08-15 22:30:01 +01:00
trigger 1st set of IIO new device support, feature and cleanup for 6.2 (take2) 2022-11-25 18:35:16 +01:00
iio_core.h
iio_core_trigger.h
industrialio-buffer.c iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
industrialio-configfs.c
industrialio-core.c iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00
industrialio-event.c 4th set of IIO fixes for 6.1 2022-11-27 15:05:05 +01:00
industrialio-sw-device.c
industrialio-sw-trigger.c iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails 2022-11-12 17:53:35 +00:00
industrialio-trigger.c iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00
industrialio-triggered-event.c
inkern.c iio: inkern: fix coding style warnings 2022-08-15 22:30:00 +01:00
Kconfig
Makefile
TODO iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00