From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936381AbcHJTyx (ORCPT ); Wed, 10 Aug 2016 15:54:53 -0400 Received: from foss.arm.com ([217.140.101.70]:49354 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936202AbcHJSgY (ORCPT ); Wed, 10 Aug 2016 14:36:24 -0400 Subject: Re: [Regression] "irqdomain: Don't set type when mapping an IRQ" breaks nexus7 gpio buttons To: Linus Walleij , Jon Hunter References: <566aa781-6364-07ba-054a-2fcce0f4331b@nvidia.com> <773ccdb0-a225-f2d0-eb5d-3c27243ee76b@nvidia.com> Cc: John Stultz , Thomas Gleixner , lkml , Bjorn Andersson From: Marc Zyngier X-Enigmail-Draft-Status: N1110 Organization: ARM Ltd Message-ID: <57AAF6B7.7030902@arm.com> Date: Wed, 10 Aug 2016 10:41:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On 10/08/16 00:03, Linus Walleij wrote: > On Tue, Aug 9, 2016 at 3:20 PM, Jon Hunter wrote: > >> If that works, then does the following also work (without the above) ... >> >> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c >> index b4c1bc7c9ca2..e111b72e3162 100644 >> --- a/kernel/irq/chip.c >> +++ b/kernel/irq/chip.c >> @@ -824,6 +824,7 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle, >> irq_settings_set_norequest(desc); >> irq_settings_set_nothread(desc); >> desc->action = &chained_action; >> + __irq_set_trigger(desc, irqd_get_trigger_type(&desc->irq_data)); >> irq_startup(desc, true); >> } >> } >> >> It looks like there is a path for parent interrupts where the type >> is not getting set. If the above works then we can discuss with Thomas >> and Marc on the correct fix. > > I tried this on my problematic platform and then this happens: > > preparing networking... > [ 2.628246] ------------[ cut here ]------------ > [ 2.628303] WARNING: CPU: 0 PID: 92 at ../kernel/irq/chip.c:26 > bad_chained_irq+0x44/0x4c > [ 2.631939] Chained irq 109 should not call an action > [ 2.640008] Modules linked in: > [ 2.647909] CPU: 0 PID: 92 Comm: ip Not tainted > 4.8.0-rc1-00011-ga21e27b4cb66 #194 > [ 2.647996] Hardware name: Generic DT based system > [ 2.655486] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 2.660254] [] (show_stack) from [] > (dump_stack+0x78/0x8c) > [ 2.668147] [] (dump_stack) from [] (__warn+0xec/0x104) > [ 2.675173] [] (__warn) from [] > (warn_slowpath_fmt+0x38/0x48) > [ 2.682033] [] (warn_slowpath_fmt) from [] > (bad_chained_irq+0x44/0x4c) > [ 2.689687] [] (bad_chained_irq) from [] > (__handle_irq_event_percpu+0x5c/0x290) > [ 2.697836] [] (__handle_irq_event_percpu) from > [] (handle_irq_event_percpu+0x1c/0x58) > [ 2.706778] [] (handle_irq_event_percpu) from > [] (handle_irq_event+0x38/0x5c) > [ 2.716498] [] (handle_irq_event) from [] > (handle_level_irq+0xc4/0x150) > [ 2.725438] [] (handle_level_irq) from [] > (generic_handle_irq+0x24/0x34) > [ 2.733602] [] (generic_handle_irq) from [] > (msm_gpio_irq_handler+0xc8/0x150) > [ 2.742280] [] (msm_gpio_irq_handler) from [] > (generic_handle_irq+0x24/0x34) > [ 2.751048] [] (generic_handle_irq) from [] > (__handle_domain_irq+0x7c/0xec) > [ 2.759901] [] (__handle_domain_irq) from [] > (gic_handle_irq+0x48/0x8c) > [ 2.768323] [] (gic_handle_irq) from [] > (__irq_svc+0x6c/0xa8) > [ 2.776644] Exception stack(0xdeca1d48 to 0xdeca1d90) > [ 2.784284] 1d40: deca1dc0 00000000 00000000 > deca0018 ffff8bd6 deca1dc0 > [ 2.789324] 1d60: 00000000 c0378ad0 60070013 00000000 00000000 > 001f3df8 c108fa04 deca1d98 > [ 2.797481] 1d80: c08b77fc c0377930 60070013 ffffffff > [ 2.805651] [] (__irq_svc) from [] > (init_timer_key+0x28/0x104) > [ 2.810679] [] (init_timer_key) from [] > (schedule_timeout+0x48/0x410) > [ 2.818145] [] (schedule_timeout) from [] > (msleep+0x2c/0x38) > [ 2.826399] [] (msleep) from [] > (smsc911x_open+0x268/0x50c) > [ 2.833859] [] (smsc911x_open) from [] > (__dev_open+0xa8/0x10c) > [ 2.840887] [] (__dev_open) from [] > (__dev_change_flags+0x94/0x144) > [ 2.848525] [] (__dev_change_flags) from [] > (dev_change_flags+0x18/0x48) > [ 2.856428] [] (dev_change_flags) from [] > (devinet_ioctl+0x6b0/0x768) > [ 2.865120] [] (devinet_ioctl) from [] > (sock_ioctl+0x1f4/0x2c8) > [ 2.873186] [] (sock_ioctl) from [] > (do_vfs_ioctl+0x9c/0x910) > [ 2.880645] [] (do_vfs_ioctl) from [] > (SyS_ioctl+0x34/0x5c) > [ 2.888290] [] (SyS_ioctl) from [] > (ret_fast_syscall+0x0/0x3c) > [ 2.895395] ---[ end trace a53e1e63b7bdfc4a ]--- > [ 2.903917] random: fast init done > [ 3.036378] random: crng init done > [ 3.883906] irq 109: nobody cared (try booting with the "irqpoll" option) > [ 3.883940] CPU: 0 PID: 92 Comm: ip Tainted: G W > 4.8.0-rc1-00011-ga21e27b4cb66 #194 > [ 3.889673] Hardware name: Generic DT based system > [ 3.898538] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 3.903137] [] (show_stack) from [] > (dump_stack+0x78/0x8c) > [ 3.911034] [] (dump_stack) from [] > (__report_bad_irq+0x28/0xcc) > [ 3.918065] [] (__report_bad_irq) from [] > (note_interrupt+0x298/0x2e8) > [ 3.925971] [] (note_interrupt) from [] > (handle_irq_event_percpu+0x4c/0x58) > [ 3.934040] [] (handle_irq_event_percpu) from > [] (handle_irq_event+0x38/0x5c) > [ 3.942634] [] (handle_irq_event) from [] > (handle_level_irq+0xc4/0x150) > [ 3.951660] [] (handle_level_irq) from [] > (generic_handle_irq+0x24/0x34) > [ 3.959821] [] (generic_handle_irq) from [] > (msm_gpio_irq_handler+0xc8/0x150) > [ 3.968502] [] (msm_gpio_irq_handler) from [] > (generic_handle_irq+0x24/0x34) > [ 3.977269] [] (generic_handle_irq) from [] > (__handle_domain_irq+0x7c/0xec) > [ 3.986122] [] (__handle_domain_irq) from [] > (gic_handle_irq+0x48/0x8c) > [ 3.994541] [] (gic_handle_irq) from [] > (__irq_svc+0x6c/0xa8) > [ 4.002865] Exception stack(0xdeca1c60 to 0xdeca1ca8) > [ 4.010507] 1c60: 00000000 c0abce68 c109f9c0 00000000 c109f9c0 > 00000000 deca0000 00000000 > [ 4.015546] 1c80: 00000282 deca1d48 c0210800 001f3df8 e080400c > deca1cb0 c0322330 c0322340 > [ 4.023701] 1ca0: 20070113 ffffffff > [ 4.031868] [] (__irq_svc) from [] > (__do_softirq+0x9c/0x388) > [ 4.035166] [] (__do_softirq) from [] > (irq_exit+0xc0/0xfc) > [ 4.042805] [] (irq_exit) from [] > (__handle_domain_irq+0x80/0xec) > [ 4.049835] [] (__handle_domain_irq) from [] > (gic_handle_irq+0x48/0x8c) > [ 4.057735] [] (gic_handle_irq) from [] > (__irq_svc+0x6c/0xa8) > [ 4.065887] Exception stack(0xdeca1d48 to 0xdeca1d90) > [ 4.073528] 1d40: deca1dc0 00000000 00000000 > deca0018 ffff8bd6 deca1dc0 > [ 4.078566] 1d60: 00000000 c0378ad0 60070013 00000000 00000000 > 001f3df8 c108fa04 deca1d98 > [ 4.086723] 1d80: c08b77fc c0377930 60070013 ffffffff > [ 4.094889] [] (__irq_svc) from [] > (init_timer_key+0x28/0x104) > [ 4.099921] [] (init_timer_key) from [] > (schedule_timeout+0x48/0x410) > [ 4.107389] [] (schedule_timeout) from [] > (msleep+0x2c/0x38) > [ 4.115640] [] (msleep) from [] > (smsc911x_open+0x268/0x50c) > [ 4.123100] [] (smsc911x_open) from [] > (__dev_open+0xa8/0x10c) > [ 4.130128] [] (__dev_open) from [] > (__dev_change_flags+0x94/0x144) > [ 4.137769] [] (__dev_change_flags) from [] > (dev_change_flags+0x18/0x48) > [ 4.145670] [] (dev_change_flags) from [] > (devinet_ioctl+0x6b0/0x768) > [ 4.154357] [] (devinet_ioctl) from [] > (sock_ioctl+0x1f4/0x2c8) > [ 4.162425] [] (sock_ioctl) from [] > (do_vfs_ioctl+0x9c/0x910) > [ 4.169887] [] (do_vfs_ioctl) from [] > (SyS_ioctl+0x34/0x5c) > [ 4.177529] [] (SyS_ioctl) from [] > (ret_fast_syscall+0x0/0x3c) > [ 4.184635] handlers: > [ 4.192273] [] bad_chained_irq > [ 4.198255] Disabling IRQ #109 > (...) > [ 34.170316] smsc911x 1b800000.ethernet-ebi2 eth0: ISR failed > signaling test (IRQ 208) Is this platform related to the Dragonboard 410C? I've got one from Sudeep, and it seems to work fine (though I've spotted a couple of gotchas in the DT). Do you see this symptom on all chained interrupts? Or just this particular one? Thanks, M. -- Jazz is not dead. It just smells funny...