public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: William Breathitt Gray <william.gray@linaro.org>
Cc: Michael Walle <michael@walle.cc>,
	linus.walleij@linaro.org, brgl@bgdev.pl,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	broonie@kernel.org
Subject: Re: [PATCH v3 3/9] gpio: 104-dio-48e: Migrate to the regmap-irq API
Date: Mon, 28 Nov 2022 11:51:09 +0200	[thread overview]
Message-ID: <Y4SEjVpLUd1wA8nd@smile.fi.intel.com> (raw)
In-Reply-To: <Y4PeCBy/8slpMp2R@fedora>

On Sun, Nov 27, 2022 at 05:00:40PM -0500, William Breathitt Gray wrote:
> On Sun, Nov 27, 2022 at 07:31:48PM +0100, Michael Walle wrote:
> > Am 2022-11-22 11:29, schrieb William Breathitt Gray:

...

> > gpiochip doesn't seem to be the correct place, gpiochip_add_irqchip()
> > is a noop for gpio-regmap, right? So using gpiochip_irqchip_init_hw()
> > seems wrong.
> > 
> > Maybe make gpio-regmap call it on its own? But really we just connect
> > the regmap-irq to the gpiochip irqdomain.
> 
> I think you're right, it feels strange to handle IRQ initialization via
> the GPIO framework. Maybe somewhere in regmap_irq might be more
> appropriate?

The problem that that callback solves is possible interrupt storm, spurious
interrupts, and Use Before Initialized.

If you can guarantee that in your case it never happens, add a comment
and go on.

(It might be useful to tweak code a bit and try CONFIG_DEBUG_SHIRQ=y)

> > What is the purpose of the
> > .init_hw callback? I've looked at other drivers which use regmap-irq
> > and they all seem to just initialize the hardware in their _probe().
> > 
> > -michael
> 
> I'm not opposed to initializing the hardware in _probe(), although I can
> see merit in pushing that operation instead closer to the framework
> where the initialization is actually relevant.
> 
> Andy, maybe you can shed some light about .init_hw; I think you
> introduced it to gpiolib in commit 9411e3aaa6342.

It seems that commit message doesn't fully  explain the situation behind
that change. But it was observed in real life, see above.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-11-28  9:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22  7:10 [PATCH v3 0/9] Migrate i8255 GPIO drivers to regmap API William Breathitt Gray
2022-11-22  7:10 ` [PATCH v3 1/9] gpio: regmap: Always set gpio_chip get_direction William Breathitt Gray
2022-11-22  7:10 ` [PATCH v3 2/9] regmap-irq: Add handle_mask_sync() callback William Breathitt Gray
2022-11-22  7:11 ` [PATCH v3 3/9] gpio: 104-dio-48e: Migrate to the regmap-irq API William Breathitt Gray
2022-11-23 15:01   ` Andy Shevchenko
2022-11-22 10:29     ` William Breathitt Gray
2022-11-27 18:31       ` Michael Walle
2022-11-27 22:00         ` William Breathitt Gray
2022-11-28  9:51           ` Andy Shevchenko [this message]
2022-11-28  9:56             ` Andy Shevchenko
2022-11-28 10:04               ` Andy Shevchenko
2022-11-28  9:41         ` Andy Shevchenko
2022-11-28  9:56           ` Michael Walle
2022-11-28 10:02             ` Andy Shevchenko
2022-11-22  7:11 ` [PATCH v3 4/9] gpio: 104-idi-48: " William Breathitt Gray
2022-11-23 17:28   ` Andy Shevchenko
2022-11-22  7:11 ` [PATCH v3 5/9] gpio: 104-idi-48: Migrate to gpio-regmap API William Breathitt Gray
2022-11-23 17:31   ` Andy Shevchenko
2022-11-22  7:11 ` [PATCH v3 6/9] gpio: i8255: " William Breathitt Gray
2022-11-23 17:42   ` Andy Shevchenko
2022-11-22 11:34     ` William Breathitt Gray
2022-11-22  7:11 ` [PATCH v3 7/9] gpio: 104-dio-48e: Migrate to regmap API William Breathitt Gray
2022-11-23 17:43   ` Andy Shevchenko
2022-11-22  7:11 ` [PATCH v3 8/9] gpio: gpio-mm: " William Breathitt Gray
2022-11-23 17:46   ` Andy Shevchenko
2022-11-22  7:11 ` [PATCH v3 9/9] gpio: i8255: Remove unused legacy interface William Breathitt Gray
2022-11-23 17:31   ` Andy Shevchenko
2022-12-09 18:59 ` (subset) [PATCH v3 0/9] Migrate i8255 GPIO drivers to regmap API Mark Brown

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=Y4SEjVpLUd1wA8nd@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=william.gray@linaro.org \
    /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