linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH v1] gpio: lynxpoint: Setup correct IRQ handlers
Date: Mon, 18 Nov 2019 20:22:19 +0200	[thread overview]
Message-ID: <20191118182219.GA32742@smile.fi.intel.com> (raw)
In-Reply-To: <20191118180251.31439-1-andriy.shevchenko@linux.intel.com>

On Mon, Nov 18, 2019 at 08:02:51PM +0200, Andy Shevchenko wrote:
> When commit 75e99bf5ed8f ("gpio: lynxpoint: set default handler to be
> handle_bad_irq()") switched default handler to be handle_bad_irq() the
> lp_irq_type() function remained untouched. It means that even request_irq()
> can't change the handler and we are not able to handle IRQs properly anymore.
> Fix it by setting correct handlers in the lp_irq_type() callback.

Linus, I can send this one and MAINTAINERS update as a PR for v5.4 if it would
work better for you.

P.S. I eventually found the platform to test this with GPIO IRQs (another
platform I had wasn't providing GpioInt() resources and thus not possible to
test).

> Fixes: 75e99bf5ed8f ("gpio: lynxpoint: set default handler to be handle_bad_irq()")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-lynxpoint.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c
> index e9e47c0d5be7..490ce7bae25e 100644
> --- a/drivers/gpio/gpio-lynxpoint.c
> +++ b/drivers/gpio/gpio-lynxpoint.c
> @@ -164,6 +164,12 @@ static int lp_irq_type(struct irq_data *d, unsigned type)
>  		value |= TRIG_SEL_BIT | INT_INV_BIT;
>  
>  	outl(value, reg);
> +
> +	if (type & IRQ_TYPE_EDGE_BOTH)
> +		irq_set_handler_locked(d, handle_edge_irq);
> +	else if (type & IRQ_TYPE_LEVEL_MASK)
> +		irq_set_handler_locked(d, handle_level_irq);
> +
>  	spin_unlock_irqrestore(&lg->lock, flags);
>  
>  	return 0;
> -- 
> 2.24.0
> 

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2019-11-18 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 18:02 [PATCH v1] gpio: lynxpoint: Setup correct IRQ handlers Andy Shevchenko
2019-11-18 18:22 ` Andy Shevchenko [this message]
2019-11-21 14:02 ` Linus Walleij
2019-11-25 11:53   ` Andy Shevchenko
2019-11-25 11:54     ` Andy Shevchenko

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=20191118182219.GA32742@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.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).