mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "Enrico Weigelt, metux IT consult" <lkml@metux.net>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	William Breathitt Gray <vilhelm.gray@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	<joyce.ooi@intel.com>, Andrew Jeffery <andrew@aj.id.au>,
	Hoan Tran <hoan@os.amperecomputing.com>,
	Serge Semin <fancer.lancer@gmail.com>, <orsonzhai@gmail.com>,
	<baolin.wang7@gmail.com>, <zhang.lyra@gmail.com>,
	Andy Shevchenko <andy@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Jun Nie <jun.nie@linaro.org>, Shawn Guo <shawnguo@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [RFC PATCH] RFC: drivers: gpio: helper for generic pin IRQ handling
Date: Thu, 10 Dec 2020 17:40:05 +0200	[thread overview]
Message-ID: <ff1dcd9a-eb83-2cb5-30d3-b25976a227ab@ti.com> (raw)
In-Reply-To: <710efa0f-063e-8a9e-1c3f-49337506b044@metux.net>



On 09/12/2020 12:23, Enrico Weigelt, metux IT consult wrote:
> On 08.12.20 17:18, Grygorii Strashko wrote:
> 
>>>>> Having all GPIO drivers doing their IRQ management entirely through the
>>>>> GPIO subsystem (eg. never calling generic_handle_irq() and using the
>>>>> builtin
>>>>> IRQ handling) would also allow a more direct (eg. callback-based)
>>>>> pin change
>>>>> notification for GPIO consumers, that doesn't involve registering
>>>>> them as
>>>>> generic IRQ handlers.
>>
>> Above part makes me worry - why?
> 
> Why so ?
> 
> Little clarification, in case i've been a bit confusion - there're two
> separate topics:
> 
> a) consolidating repeated patterns (eg. calling the actual irq handling)
>     into gpiolib, (and later possibly use more fields already existing in
>     struct gpio_chip for irq handling)

Even if there is some pattern It doesn't mean consolidation is always reasonable.
one of the things to think about is compiler optimization and will/will not this change
add additional

> 
> b) a direct consumer callback for change, where the consumer doesn't
>     have to care about IRQs at all (some drivers could even do polling,
>     when hw doesn't have IRQs). This is for consumers that don't use
>     GPIOs as interrupt source, but more more like a very raw serial port,
>     eg. bitbanging of other interfaces (maybe an gpio bus type ? ;-))

in his case they do polling, so what's the issue with this?

or you want gpio-controller to do polling for you?

Actually there are few types of consumers:
- gpio users, no irq
- irq users, no gpio
- gpio users and irq users
- and finally (only few) use the same gpio as gpio and as an irq,
   including dynamic direction change.

> 
> The above paragraph just outlines that b) might be much easier to
> implement, once the suggested refactoring is done and no driver would
> call irq handlers directly anymore. But this hasn't much to do with
> the proposal itself, just an idea for future use.
> 
> --mtx
> 

-- 
Best regards,
grygorii

  reply	other threads:[~2020-12-10 15:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 14:14 Enrico Weigelt, metux IT consult
2020-12-08 14:19 ` Andy Shevchenko
2020-12-08 14:38   ` Andy Shevchenko
2020-12-08 16:18     ` Grygorii Strashko
2020-12-09 10:23       ` Enrico Weigelt, metux IT consult
2020-12-10 15:40         ` Grygorii Strashko [this message]
2020-12-15 16:00           ` Enrico Weigelt, metux IT consult
2020-12-09  8:51   ` Enrico Weigelt, metux IT consult

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=ff1dcd9a-eb83-2cb5-30d3-b25976a227ab@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=andrew@aj.id.au \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=baolin.wang7@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=fancer.lancer@gmail.com \
    --cc=hoan@os.amperecomputing.com \
    --cc=info@metux.net \
    --cc=joyce.ooi@intel.com \
    --cc=jun.nie@linaro.org \
    --cc=khilman@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lkml@metux.net \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=orsonzhai@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=vilhelm.gray@gmail.com \
    --cc=zhang.lyra@gmail.com \
    /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

all inboxes | Powered by JetHome®