linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Thorsten Scherer" <t.scherer@eckelmann.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: siox: indicate exclusive support of threaded IRQs
Date: Thu, 6 Aug 2020 15:32:41 +0200	[thread overview]
Message-ID: <CACRpkdaOysS1-Y=3ghQ+1qbMTR8yi3bHg=_+gUOPo_EcmGmJiw@mail.gmail.com> (raw)
In-Reply-To: <871rkkhy7v.fsf@nanos.tec.linutronix.de>

On Thu, Aug 6, 2020 at 12:20 PM Thomas Gleixner <tglx@linutronix.de> wrote:

> So the solution for this driver is either to make the dispatch handler
> threaded or use the hard interrupt variant of dispatching the
> demultiplexed GPIO interrupts.

The struct gpio_irq_chip .threaded bool that the patch
sets just instructs the gpio core to issue
irq_set_nested_thread(irq, 1) on the child IRQ.

This is a driver of type "struct siox_driver" handling the
IRQ through the special .get_data callback supplied in the
driver struct and it calls handle_nested_irq(irq) so with
this fix it percolated up to the parent as intended.

So far so good. So I think the patch should be applied.

But what is behind this .get_data() callback for siox drivers?

The siox driver framework in drivers/siox dispatches calls
to .get_data() from a polling thread which is just some ordinary
kthread. It looks like this because the SIOX (I think) needs
to do polled I/O. (drivers/siox/siox-core.c)

So this is a thread but it is not an irq thread from the irq core,
however it is treated like such by the driver, and in a way what
happens is events, just polled by a thread.

So when we call handle_nested_irq() ... we are not really
calling that from an irq handler.

I am just very confused :D

But Uwe must have designed this thread to mimic IRQs
specifically? (Uwe?)

I don't know if the IRQ core even sees a difference between which
thread it gets interfaced with. I suppose it does? :/

Yours,
Linus Walleij

  reply	other threads:[~2020-08-06 17:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04  9:16 [PATCH] gpio: siox: indicate exclusive support of threaded IRQs Ahmad Fatoum
2020-08-05  6:17 ` Uwe Kleine-König
2020-08-06 10:20   ` Thomas Gleixner
2020-08-06 13:32     ` Linus Walleij [this message]
2020-08-06 18:50       ` Thomas Gleixner
2020-08-06 19:46         ` Uwe Kleine-König
2020-08-06 20:33           ` Thomas Gleixner
2020-08-06 21:07             ` Uwe Kleine-König
2020-08-10 13:33               ` Uwe Kleine-König
2020-08-06 15:07     ` Uwe Kleine-König
2020-08-27 22:55 ` Linus Walleij
2020-09-07 15:33   ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACRpkdaOysS1-Y=3ghQ+1qbMTR8yi3bHg=_+gUOPo_EcmGmJiw@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=a.fatoum@pengutronix.de \
    --cc=bgolaszewski@baylibre.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=t.scherer@eckelmann.de \
    --cc=tglx@linutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).