Re: [Outreachy kernel] [PATCH] staging: iio: change IRQ_HANDLED to IRQ_WAKE_THREAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 27, 2015 at 5:26 PM, Ioana Ciornei <ciorneiioana@xxxxxxxxx> wrote:
> This patch changes the return value of the primary interrupt handler to
> IRQ_WAKE_THREAD in order to wake the kernel thread represented by the
> iio_simple_dummy_event_handler function and continue handling the event.
>

This is a very good catch! We need to have a better commit message. You
need to describe why the commit is needed.

==
iio: dummy: Complete IIO events delivery to userspace

Since commit fd2bb310ca ("Staging: iio: Move evgen interrupt
generation to irq_work")
event processing is split in two parts using threaded interrupts:

* part 1, IRQ handler - runs in IRQ context and only saves event timestamp.
* part 2, threaded handler, runs in process context, get events and
pushes them to userspace.

When IRQ handler returns IRQ_HANDLED code the interrupt is considered
to be processed
and the threaded handler will not be called. We don't want this for
IIO dummy events driver, since
the events processing takes places in the threaded handler.

Thus, IRQ handler needs to wake up threaded handler by returning IRQ_WAKE_THREAD

Fixes: fd2bb310ca ("Staging: iio: Move evgen interrupt generation to irq_work")
==

Also, because IIO driver was moved out of staging please rebase your
patch on Jonathan's tree:

https://git.kernel.org/cgit/linux/kernel/git/jic23/iio.git/log/?h=testing

use testing branch for this.


> Signed-off-by: Ioana Ciornei <ciorneiioana@xxxxxxxxx>
> ---
>  drivers/staging/iio/iio_simple_dummy_events.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/iio_simple_dummy_events.c b/drivers/staging/iio/iio_simple_dummy_events.c
> index bfbf1c5..6eb600f 100644
> --- a/drivers/staging/iio/iio_simple_dummy_events.c
> +++ b/drivers/staging/iio/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
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@xxxxxxxxxxxxxxxx.
> To post to this group, send email to outreachy-kernel@xxxxxxxxxxxxxxxx.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1445959587-25953-1-git-send-email-ciorneiioana%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux