Skip to content

Commit

Permalink
staging: iio: dummy: complete IIO events delivery to userspace
Browse files Browse the repository at this point in the history
Starting with commit fd2bb31 (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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Ioana Ciornei authored and Jonathan Cameron committed Nov 21, 2015
1 parent b57f9f3 commit 2e9fed4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/iio_simple_dummy_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 2e9fed4

Please sign in to comment.