linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andy.shevchenko@gmail.com
To: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: linus.walleij@linaro.org, brgl@bgdev.pl, mkshah@codeaurora.org,
	Ben Brown <ben.brown@alliedtelesis.co.nz>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpiolib: Don't implicitly disable irq when masking
Date: Wed, 10 May 2023 10:42:20 +0300	[thread overview]
Message-ID: <ZFtK3DydE24Qijle@surfacebook> (raw)
In-Reply-To: <20230510001151.3946931-1-chris.packham@alliedtelesis.co.nz>

Wed, May 10, 2023 at 12:11:51PM +1200, Chris Packham kirjoitti:
> When preparing to kexec into a new kernel the kexec code will mask all
> interrupts for all interrupt domains before disabling them. In the case
> of a gpio chip which has a mix of gpio and irq pins a warning would be
> triggered as follows

>   [root@localhost ~]# echo c >/proc/sysrq-trigger

Besides the very noisy traceback in the commit message (read
https://kernel.org/doc/html/latest/process/submitting-patches.html#backtraces-in-commit-messages)
see below.

> This is because gpiochip_irq_mask was being used to mask all possible

We refer to the functions in the form as follows gpiochip_irq_mask().


> irqs in the domain but gpiochip_disable_irq will WARN if any of those

IRQs
gpiochip_disable_irq()

> gpios haven't been requested as interrupts yet. Remove the call to

GPIOs

> gpiochip_disable_irq to stop the warning.

gpiochip_disable_irq()

> Fixes: a8173820f441 ("gpio: gpiolib: Allow GPIO IRQs to lazy disable")
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
>  drivers/gpio/gpiolib.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 8c041a8dd9d8..903f5185ae55 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1451,7 +1451,6 @@ static void gpiochip_irq_mask(struct irq_data *d)
>  
>  	if (gc->irq.irq_mask)
>  		gc->irq.irq_mask(d);
> -	gpiochip_disable_irq(gc, d->hwirq);
>  }

At the same time the gpiochip_irq_unmask() has the symmetrical call. Why?

Also it's obvious that you have used outdated repository. You need to rebase
against subsystem tree for-next branch.

P.S. It's also makes sense to Cc to Marc Zyngier <maz@kernel.org>.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-05-10  7:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10  0:11 [PATCH] gpiolib: Don't implicitly disable irq when masking Chris Packham
2023-05-10  7:42 ` andy.shevchenko [this message]
2023-05-10 20:58   ` Chris Packham
2023-05-11  8:00     ` Linus Walleij
2023-05-11 20:36       ` Chris Packham
2023-05-11 20:48         ` Linus Walleij
2023-05-12  3:50         ` Chris Packham

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=ZFtK3DydE24Qijle@surfacebook \
    --to=andy.shevchenko@gmail.com \
    --cc=ben.brown@alliedtelesis.co.nz \
    --cc=brgl@bgdev.pl \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkshah@codeaurora.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;
as well as URLs for NNTP newsgroup(s).