WSL2-Linux-Kernel/include/linux/iio
Jonathan Cameron a18aeac73c iio: trigger: Fix a scheduling whilst atomic issue seen on tsc2046
commit 9020ef6598 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-27 11:02:57 +01: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: accel: st_sensors: Support generic mounting matrix 2021-06-03 18:24:13 +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: add burst_max_speed_hz variable 2021-05-17 13:49:09 +01:00
timer treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
buffer-dma.h iio: dma-buffer: Cleanup buffer.h/buffer_impl.h includes 2020-04-19 16:56:31 +01: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: buffer: introduce support for attaching more IIO buffers 2021-03-11 20:47:05 +00:00
buffer_impl.h iio: buffer: add ioctl() to support opening extra buffers for IIO device 2021-03-11 20:47:05 +00: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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02: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: move @clock_id from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:54:21 +01:00
iio.h iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01: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 2022-01-27 11:02:57 +01: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: add {devm_}iio_triggered_buffer_setup_ext variants 2020-11-21 14:53:09 +00: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:event: Add timeout event info type 2021-04-07 08:36:36 +01:00