From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932671AbcHKVYC (ORCPT ); Thu, 11 Aug 2016 17:24:02 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36838 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932574AbcHKVX5 (ORCPT ); Thu, 11 Aug 2016 17:23:57 -0400 Date: Thu, 11 Aug 2016 14:23:53 -0700 From: Bjorn Andersson To: Marc Zyngier Cc: Jon Hunter , Linus Walleij , John Stultz , Thomas Gleixner , lkml Subject: Re: [Regression] "irqdomain: Don't set type when mapping an IRQ" breaks nexus7 gpio buttons Message-ID: <20160811212353.GD26240@tuxbot> References: <57AC3959.2030404@arm.com> <57AC7388.6070900@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57AC7388.6070900@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 > >> > >> 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