OpenCloudOS-Kernel/include/linux/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: accel: kxcjk1013: Support orientation matrix 2020-01-18 14:26:13 +00:00
adc iio: adc: ad_sigma_delta: remove ad_sd_{setup,cleanup}_buffer_and_trigger() 2021-06-13 17:00:17 +01:00
common iio: st_sensors: remove reference to parent device object on st_sensor_data 2021-09-14 12:00:32 +01:00
dac dt-bindings:iio:dac: update microchip,mcp4725.yaml reference 2021-04-07 08:36:38 +01:00
frequency iio: adf4350: Convert to use GPIO descriptor 2019-12-15 11:42:16 +00:00
gyro treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
imu iio: adis: handle devices that cannot unmask the drdy pin 2021-10-19 08:27:34 +01:00
timer treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
buffer-dma.h iio: buffer-dma: Remove unused iio_buffer_block struct 2021-11-27 15:12:01 +00:00
buffer-dmaengine.h iio: buffer-dma,adi-axi-adc: introduce devm_iio_dmaengine_buffer_setup() 2021-03-11 20:47:02 +00:00
buffer.h iio: Add output buffer support 2021-10-19 08:30:44 +01:00
buffer_impl.h iio: Add output buffer support 2021-10-19 08:30:44 +01:00
configfs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
consumer.h iio: Provide iio_read_channel_processed_scale() API 2021-03-25 19:13:51 +00:00
driver.h iio: inkern: introduce devm_iio_map_array_register() short-hand function 2021-10-19 08:27:34 +01:00
events.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hw-consumer.h iio: buffer: drop devm_iio_hw_consumer_free() API call 2020-04-19 16:56:37 +01:00
iio-opaque.h iio: core: Introduce iio_push_to_buffers_with_ts_unaligned() 2021-10-19 08:29:22 +01:00
iio.h iio: expose shared parameter in IIO_ENUM_AVAILABLE 2021-11-27 16:12:23 +00:00
kfifo_buf.h iio: kfifo: add devm_iio_triggered_buffer_setup_ext variant 2021-03-25 19:13:52 +00:00
machine.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sw_device.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sw_trigger.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sysfs.h iio: add reference to iio buffer on iio_dev_attr 2021-03-11 20:47:04 +00:00
trigger.h iio: trigger: Fix a scheduling whilst atomic issue seen on tsc2046 2021-12-12 17:12:18 +00:00
trigger_consumer.h iio: Add __printf() attributes to various allocation functions 2020-09-21 18:54:18 +01:00
triggered_buffer.h iio: triggered-buffer: extend support to configure output buffers 2021-10-19 08:30:45 +01:00
triggered_event.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
types.h iio: core: Introduce IIO_VAL_INT_64. 2021-11-17 17:51:34 +00:00