From: Lars-Peter Clausen Date: Thu, 6 Sep 2012 09:05:00 +0000 (+0100) Subject: staging:iio:sysfs-trigger: Use irq_work to properly active trigger X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~75^2~406^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f38bc926d022ebd67baad6ac7fc22c95fbc6238c;p=pandora-kernel.git 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 Signed-off-by: Jonathan Cameron --- Reading git-diff-tree failed