linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "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>,
	Grygorii Strashko <grygorii.strashko@ti.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: Tue, 8 Dec 2020 16:38:37 +0200	[thread overview]
Message-ID: <CAHp75VfOjb4Rfo9yPmwEYUDbaPXNjfGs6goM27ZnLdAMtiU+jA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VfMKmJ074R2-04be0Ag6OuKcY=_xhhbRKsL2D0H8hZZLg@mail.gmail.com>

On Tue, Dec 8, 2020 at 4:19 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Tue, Dec 8, 2020 at 4:14 PM Enrico Weigelt, metux IT consult
> <info@metux.net> wrote:
> >
> > Many gpio drivers already use gpiolib's builtin irqchip handling
> > (CONFIG_GPIOLIB_IRQCHIP), but still has some boilerplate for retrieving
> > the actual Linux IRQ number and calling into the generic handler.
> > That boilerplate can be reduced by moving that into a helper function.
> >
> > This is an RFC patch to outline how that could be done. Note: it's
> > completely untested yet.
> >
> > Several drivers still have their completely IRQ own implementation and
> > thus can't be converted yet. Some of them perhaps could be changed to
> > store their irq domain in the struct gpio, so the new helper could
> > also be used for those.
> >
> > 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.
> >
> > Further reduction of boilerplate could be achieved by additional helpers
> > for common patterns like for_each_set_bit() loops on irq masks.
>
> Have you able to test them all?
> As the PCA953x case showed us this is not so simple, besides the name
> which sucks — we don't *raise* and IRQ we *handle* it.
>
> NAK.

To be on constructive side what I think can help here:
- split patch on per driver basis (and first patch is a simple
introduction of new API)
- rename function
- in each new per-driver patch explain what is the difference in behaviour
- test as many as you can and explain in a cover letter what has been
done and what are the expectations on the ones that you weren't able
to test.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-12-08 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 14:14 [RFC PATCH] RFC: drivers: gpio: helper for generic pin IRQ handling Enrico Weigelt, metux IT consult
2020-12-08 14:19 ` Andy Shevchenko
2020-12-08 14:38   ` Andy Shevchenko [this message]
2020-12-08 16:18     ` Grygorii Strashko
2020-12-09 10:23       ` Enrico Weigelt, metux IT consult
2020-12-10 15:40         ` Grygorii Strashko
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=CAHp75VfOjb4Rfo9yPmwEYUDbaPXNjfGs6goM27ZnLdAMtiU+jA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andrew@aj.id.au \
    --cc=andy@kernel.org \
    --cc=baolin.wang7@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=fancer.lancer@gmail.com \
    --cc=grygorii.strashko@ti.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=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;
as well as URLs for NNTP newsgroup(s).