linux/drivers/staging/iio
Lars-Peter Clausen f38bc926d0 staging:iio:sysfs-trigger: Use irq_work to properly active trigger
Since iio_trigger_poll() calls generic_handle_irq() it need to be called from
hardirq context. The sysfs trigger is kicked from userspace, so it is obviously
not possible to fulfill this requirement by calling iio_trigger_poll directly.
As a workaround commit 1f785681 ("staging:iio:trigger sysfs userspace trigger
rework.") added iio_trigger_poll_chained() which uses handle_nested_irq instead
of generic_handle_irq. This in itself is a hack and only works by chance.
handle_nested_irq is intended to be called from the threaded interrupt handler
of the parent IRQ. Using handle_nested_irq is also problematic since it will
only call the threaded handler of the IRQ. But quite a few IIO drivers rely on
their hardirq handler being called or undefined behaviour will occur.

This patch uses the irq_work framework to schedule the call to
iio_trigger_poll() from hardirq context, which fixes the issues described above.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-06 22:00:28 +01:00
..
accel staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
adc staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
addac staging:iio:addac: Use dev_to_iio_dev() 2012-05-14 13:39:20 -07:00
cdc staging:iio: Request threaded-only IRQs with IRQF_ONESHOT 2012-07-08 20:02:24 +01:00
Documentation IIO: Add 4-byte unsigned reads into generic-buffer example 2012-08-16 20:16:19 +01:00
frequency staging:iio:frequency: Use dev_to_iio_dev() 2012-05-14 13:39:21 -07:00
gyro staging:iio: Add missing __devinit and __devexit annotations 2012-08-27 18:58:11 +01:00
impedance-analyzer staging:iio: Constify static iio_chan_spec arrays 2012-08-14 20:27:42 +01:00
imu staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
light staging:iio: Add missing __devinit and __devexit annotations 2012-08-27 18:58:11 +01:00
magnetometer staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
meter staging:iio: Add missing __devinit and __devexit annotations 2012-08-27 18:58:11 +01:00
resolver staging:iio: Constify static iio_chan_spec arrays 2012-08-14 20:27:42 +01:00
trigger staging:iio:sysfs-trigger: Use irq_work to properly active trigger 2012-09-06 22:00:28 +01:00
iio_dummy_evgen.c staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
iio_dummy_evgen.h staging:iio:dummy Add event support + fake event generator 2011-10-17 15:36:30 -07:00
iio_hwmon.c staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
iio_simple_dummy_buffer.c iio staging: fix cast warning 2012-07-15 17:33:17 +01:00
iio_simple_dummy_events.c staging: iio: Fix typo in iio 2012-05-08 16:04:12 -07:00
iio_simple_dummy.c staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
iio_simple_dummy.h staging:iio:dummy Add buffered reading support 2011-10-17 15:36:30 -07:00
Kconfig iio: fix spelling of subsystem 2012-09-03 20:26:44 +01:00
Makefile staging:iio: Move DAC drivers out of staging 2012-06-05 14:02:25 +09:00
ring_hw.h staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00
ring_sw.c staging: iio:: fix some typos 2012-06-15 14:39:18 -07:00
ring_sw.h IIO: Move core headers to include/linux/iio 2012-04-25 11:01:43 -07:00
TODO staging:iio: Update email address for Jonathan Cameron. 2012-09-03 20:26:46 +01:00