linux/drivers/iio
Jonathan Cameron 9020ef6598 iio: trigger: Fix a scheduling whilst atomic issue seen on tsc2046
IIO triggers are software IRQ chips that split an incoming IRQ into
separate IRQs routed to all devices using the trigger.
When all consumers are done then a trigger callback reenable() is
called.  There are a few circumstances under which this can happen
in atomic context.

1) A single user of the trigger that calls the iio_trigger_done()
function from interrupt context.
2) A race between disconnecting the last device from a trigger and
the trigger itself sucessfully being disabled.

To avoid a resulting scheduling whilst atomic, close this second corner
by using schedule_work() to ensure the reenable is not done in atomic
context.

Note that drivers must be careful to manage the interaction of
set_state() and reenable() callbacks to ensure appropriate reference
counting if they are relying on the same hardware controls.

Deliberately taking this the slow path rather than via a fixes tree
because the error has hard to hit and I would like it to soak for a while
before hitting a release kernel.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211017172209.112387-1-jic23@kernel.org
2021-12-12 17:12:18 +00:00
..
accel iio: expose shared parameter in IIO_ENUM_AVAILABLE 2021-11-27 16:12:23 +00:00
adc iio:adc:axp20x: add support for NTC thermistor 2021-12-04 15:34:18 +00:00
addac iio: addac: add AD74413R driver 2021-12-12 17:09:11 +00:00
afe iio: afe: iio-rescale: Support processed channels 2021-06-03 18:24:13 +01:00
amplifiers iio: amplifiers: hmc425a: Simplify with dev_err_probe() 2020-09-03 19:40:50 +01:00
buffer iio: buffer-dma: Use round_down() instead of rounddown() 2021-11-27 15:12:44 +00:00
cdc iio:cdc:ad7150: Fix use of uninitialized ret 2021-04-07 08:36:39 +01:00
chemical iio: atlas-sensor: Remove no-op trigger ops 2021-11-17 17:51:38 +00:00
common iio/scmi: Add reading "raw" attribute. 2021-11-17 17:51:35 +00:00
dac iio:dac:ad7293: add support for AD7293 2021-12-04 16:22:41 +00:00
dummy iio: dummy: Fix build error when CONFIG_IIO_TRIGGERED_BUFFER is not set 2021-06-13 17:00:17 +01:00
frequency iio: frequency: adrf6780: Fix adrf6780_spi_{read,write}() 2021-10-24 13:14:26 +02:00
gyro iio: gyro: mpu3050: Fix alignment and size issues with buffers. 2021-10-19 08:29:22 +01:00
health iio: afe4404: Remove no-op trigger ops 2021-11-17 17:51:37 +00:00
humidity iio: humidity: hdc100x: Add margin to the conversion time 2021-07-24 18:13:02 +01:00
imu iio: imu: st_lsm6dsx: add dts property to disable sensor-hub 2021-12-04 15:34:17 +00:00
light iio: ltr501: Export near level property for proximity sensor 2021-12-04 15:34:18 +00:00
magnetometer iio: expose shared parameter in IIO_ENUM_AVAILABLE 2021-11-27 16:12:23 +00:00
multiplexer iio: multiplexer: iio-mux: Support settle-time-us property 2021-10-21 20:02:54 +01:00
orientation iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
position iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
potentiometer iio: potentiometer: max5487: Don't return an error in .remove() 2021-10-19 08:30:46 +01:00
potentiostat iio: lmp91000: Remove no-op trigger ops 2021-11-17 17:51:38 +00:00
pressure iio: mpl3115: Use scan_type.shift and realbit in mpl3115_read_raw 2021-11-17 17:51:44 +00:00
proximity iio: as3935: Remove no-op trigger ops 2021-11-17 17:51:37 +00:00
resolver iio:resolver:ad2s1200: Drop of_match_ptr protection 2020-09-21 18:41:31 +01:00
temperature iio: temperature: Add MAX31865 RTD Support 2021-09-14 12:00:33 +01:00
test iio: test: Add test for IIO_VAL_INT_64. 2021-11-27 16:33:45 +00:00
trigger iio: expose shared parameter in IIO_ENUM_AVAILABLE 2021-11-27 16:12:23 +00:00
iio_core_trigger.h iio: core-trigger: make iio_device_register_trigger_consumer() an int return 2021-03-11 20:47:02 +00:00
iio_core.h iio: Mark iio_device_type as const 2021-11-17 17:51:35 +00:00
industrialio-buffer.c iio: buffer: Use dedicated variable in iio_buffers_alloc_sysfs_and_mask() 2021-11-20 14:17:22 +00:00
industrialio-configfs.c
industrialio-core.c iio: Mark iio_device_type as const 2021-11-17 17:51:35 +00:00
industrialio-event.c iio:event: Add timeout event info type 2021-04-07 08:36:36 +01:00
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c iio: trigger: Fix a scheduling whilst atomic issue seen on tsc2046 2021-12-12 17:12:18 +00:00
industrialio-triggered-event.c iio: core: move @id from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
inkern.c iio: inkern: introduce devm_iio_map_array_register() short-hand function 2021-10-19 08:27:34 +01:00
Kconfig iio: add addac subdirectory 2021-12-12 17:09:11 +00:00
Makefile iio: add addac subdirectory 2021-12-12 17:09:11 +00:00
TODO iio: add a TODO 2020-03-08 17:28:53 +00:00