linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: iio: dummy: complete IIO events delivery to userspace
@ 2015-10-27 18:40 Ioana Ciornei
  2015-10-28  8:26 ` [Outreachy kernel] " Daniel Baluta
  2015-10-28 22:47 ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Ioana Ciornei @ 2015-10-27 18:40 UTC (permalink / raw)
  To: linux-iio; +Cc: outreachy-kernel, cristina.opriceana, Ioana Ciornei

Starting with commit fd2bb310ca (Staging: iio: Move evgen interrupt
generation to irq_work) event processing is handled by calling
both the top half and the threaded part properly simulating real
hardware interrupts making use of threaded interrupts.
This way the processing is split in 2 parts:

* the IRQ handler that runs in IRQ context and only saves the event
timestamp
* the threaded handler that runs in process context, reads the events
and pushes the in the userspace.

If the IRQ handler returns IRQ_HANDLED the threaded handler is not
even being called since the interrupt is considered to be processed.
Because the iio dummy driver processes the events in the threaded
handler the IRQ handler must return IRQ_WAKE_THREAD so that the
threaded part would be awakened and called.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
rebased on linux-iio tree

 drivers/iio/dummy/iio_simple_dummy_events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dummy/iio_simple_dummy_events.c b/drivers/iio/dummy/iio_simple_dummy_events.c
index bfbf1c5..6eb600f 100644
--- a/drivers/iio/dummy/iio_simple_dummy_events.c
+++ b/drivers/iio/dummy/iio_simple_dummy_events.c
@@ -159,7 +159,7 @@ static irqreturn_t iio_simple_dummy_get_timestamp(int irq, void *private)
 	struct iio_dummy_state *st = iio_priv(indio_dev);
 
 	st->event_timestamp = iio_get_time_ns();
-	return IRQ_HANDLED;
+	return IRQ_WAKE_THREAD;
 }
 
 /**
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-31 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 18:40 [PATCH] staging: iio: dummy: complete IIO events delivery to userspace Ioana Ciornei
2015-10-28  8:26 ` [Outreachy kernel] " Daniel Baluta
2015-10-28 22:47 ` Greg KH
2015-10-28 22:49   ` Ioana Ciornei
2015-10-28 23:07     ` Greg KH
2015-10-31 10:39       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).