public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [Regression] "irqdomain: Don't set type when mapping an IRQ" breaks nexus7 gpio buttons
Date: Thu, 11 Aug 2016 14:23:53 -0700	[thread overview]
Message-ID: <20160811212353.GD26240@tuxbot> (raw)
In-Reply-To: <57AC7388.6070900@arm.com>

On Thu 11 Aug 05:46 PDT 2016, Marc Zyngier wrote:

> On 11/08/16 10:47, Jon Hunter wrote:
> > 
> > On 11/08/16 09:37, Marc Zyngier wrote:
> >> On 08/08/16 22:48, Linus Walleij wrote:
> >>> On Sat, Aug 6, 2016 at 1:45 AM, John Stultz <john.stultz@linaro.org> wrote:
> >>>
> >>>> @@ -614,7 +615,11 @@ unsigned int irq_create_fwspec_mapping(struct
> >>>> irq_fwspec *fwspec)
> >>>>                  * it now and return the interrupt number.
> >>>>                  */
> >>>>                 if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) {
> >>>> -                       irq_set_irq_type(virq, type);
> >>>> +                       irq_data = irq_get_irq_data(virq);
> >>>> +                       if (!irq_data)
> >>>> +                               return 0;
> >>>> +
> >>>> +                       irqd_set_trigger_type(irq_data, type);
> >>>>                         return virq;
> >>>>                 }
> >>>>
> >>>> If I revert just that, it works again.
> >>>
> >>> This makes my platform work too.
> >>> Tested-by: Linus Walleij <linus.walleij@linaro.org>
> >>
> >> Hmmm. I'm now booting your kernel on the APQ8060, and reverting this
> >> hunk doesn't fix it for me. I'm confused...
> >>
> >> The interesting part is this:
> >> 109:     100000          0   msmgpio  88 Level     (null)
> > 
> > 88 is the pm8058 parent interrupt and so I am surprised you would even
> > see this in /proc/interrupts as it should be a chained interrupt, right?
> > 
> > Are you seeing this with all the ethernet updates for the APQ8060 in
> > Linus' branch? I am curious what you see with stock v4.8-rc1 and if
> > interrupts work ok with the change I had proposed. Hard to tell if there
> > is more than one issue here.
> 
> Nailed the sucker:
> 
> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> index b4c1bc7..9d7284a 100644
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -820,6 +820,18 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
>  	desc->name = name;
>  
>  	if (handle != handle_bad_irq && is_chained) {
> +		int ret;
> +
> +		ret = __irq_set_trigger(desc,
> +					irqd_get_trigger_type(&desc->irq_data));
> +		WARN_ON(ret);
> +		/*
> +		 * This is beyond ugly: .set_type may have overridden
> +		 * the flow, not not knowing that we're dealing with a
> +		 * chained handler. Reset it here because we know
> +		 * better.
> +		 */

Thanks for this Marc!

But it makes me (author of pinctrl-msm) wonder, am I supposed to not
implement .set_type like this for handling the transition between edge
and level handlers?

Regards,
Bjorn

  parent reply	other threads:[~2016-08-11 21:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-30  4:39 [Regression] "irqdomain: Don't set type when mapping an IRQ" breaks nexus7 gpio buttons John Stultz
2016-07-30  4:52 ` Bjorn Andersson
2016-07-30 11:10   ` Marc Zyngier
2016-07-30  8:07 ` Thomas Gleixner
2016-08-05 18:12   ` John Stultz
2016-08-08  9:04     ` Jon Hunter
2016-08-08 21:50       ` Linus Walleij
2016-08-08 21:35   ` Linus Walleij
2016-08-01 10:26 ` Jon Hunter
2016-08-05 23:45   ` John Stultz
2016-08-08  9:31     ` Jon Hunter
2016-08-09  4:25       ` John Stultz
2016-08-09 13:20         ` Jon Hunter
2016-08-09 15:08           ` Marc Zyngier
2016-08-09 23:03           ` Linus Walleij
2016-08-10  9:41             ` Marc Zyngier
2016-08-10  9:56               ` Jon Hunter
2016-08-10 10:21                 ` Marc Zyngier
2016-08-10 13:58                 ` Linus Walleij
2016-08-10 14:12                   ` Jon Hunter
2016-08-10 22:06                     ` Linus Walleij
2016-08-10 13:50               ` Linus Walleij
2016-08-10 15:17                 ` Marc Zyngier
2016-08-10 22:14                   ` Linus Walleij
2016-08-08 21:48     ` Linus Walleij
2016-08-11  8:37       ` Marc Zyngier
2016-08-11  9:47         ` Jon Hunter
2016-08-11 11:45           ` Marc Zyngier
2016-08-11 11:53             ` Marc Zyngier
2016-08-11 12:46           ` Marc Zyngier
2016-08-11 13:29             ` Jon Hunter
2016-08-11 13:34               ` Marc Zyngier
2016-08-11 15:32             ` John Stultz
2016-08-11 15:51               ` Marc Zyngier
2016-08-11 21:08             ` Linus Walleij
2016-08-11 21:23             ` Bjorn Andersson [this message]
2016-08-12 10:22               ` Marc Zyngier
2016-08-11 12:01         ` Linus Walleij

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=20160811212353.GD26240@tuxbot \
    --to=bjorn.andersson@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    /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