From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4782CC433EF for ; Thu, 30 Sep 2021 13:53:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F00B619EB for ; Thu, 30 Sep 2021 13:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235551AbhI3Nze (ORCPT ); Thu, 30 Sep 2021 09:55:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:50864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351519AbhI3Nzd (ORCPT ); Thu, 30 Sep 2021 09:55:33 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 88D3361440; Thu, 30 Sep 2021 13:53:50 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mVwVQ-00E025-OM; Thu, 30 Sep 2021 14:53:48 +0100 Date: Thu, 30 Sep 2021 14:53:48 +0100 Message-ID: <871r56tbir.wl-maz@kernel.org> From: Marc Zyngier To: Daniel Palmer Cc: Linus Walleij , DTML , Rob Herring , Thomas Gleixner , linux-arm-kernel , Romain Perier Subject: Re: [PATCH 2/3] irqchip: SigmaStar SSD20xD gpi In-Reply-To: References: <20210914100415.1549208-1-daniel@0x0f.com> <20210914100415.1549208-3-daniel@0x0f.com> <87zgs7vavl.wl-maz@kernel.org> <87wnnbv6ac.wl-maz@kernel.org> <87lf3quydn.wl-maz@kernel.org> <874ka2tdqe.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: daniel@0x0f.com, linus.walleij@linaro.org, devicetree@vger.kernel.org, robh+dt@kernel.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, romain.perier@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, 30 Sep 2021 14:36:52 +0100, Daniel Palmer wrote: > > Hi Marc, > > On Thu, 30 Sept 2021 at 22:06, Marc Zyngier wrote: > > No, this is the right spot if you really need to set the handler. But > > it should really be after the parent allocation (see below for > > something totally untested). > > Your change resolves the null pointer difference when enabling the > interrupt but when it triggers the below happens. > This might just be my driver so I'll try to debug. > > Thanks, > > Daniel > > # gpiomon -r 0 44 > [ 61.770519] irq 66, desc: (ptrval), depth: 0, count: 0, unhandled: 0 > [ 61.770646] > [ 61.770659] ============================= > [ 61.770670] [ BUG: Invalid wait context ] > [ 61.770683] 5.15.0-rc2+ #2583 Not tainted > [ 61.770702] ----------------------------- > [ 61.770712] swapper/0/0 is trying to lock: > [ 61.770729] c1789eb0 (&port_lock_key){-.-.}-{3:3}, at: > serial8250_console_write+0x1b0/0x254 > [ 61.770840] other info that might help us debug this: > [ 61.770853] context-{2:2} > [ 61.770868] 2 locks held by swapper/0/0: > [ 61.770889] #0: c10189ec (console_lock){+.+.}-{0:0}, at: > vprintk_emit+0xa4/0x200 > [ 61.770986] #1: c1018b44 (console_owner){-...}-{0:0}, at: > console_unlock+0x1e8/0x4b4 > [ 61.771080] stack backtrace: > [ 61.771093] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.15.0-rc2+ #2583 > [ 61.771130] Hardware name: MStar/Sigmastar Armv7 (Device Tree) > [ 61.771156] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 61.771235] [] (show_stack) from [] > (dump_stack_lvl+0x58/0x70) > [ 61.771312] [] (dump_stack_lvl) from [] > (__lock_acquire+0x384/0x16a0) > [ 61.771394] [] (__lock_acquire) from [] > (lock_acquire+0x2a0/0x320) > [ 61.771470] [] (lock_acquire) from [] > (_raw_spin_lock_irqsave+0x5c/0x70) > [ 61.771542] [] (_raw_spin_lock_irqsave) from [] > (serial8250_console_write+0x1b0/0x254) > [ 61.771620] [] (serial8250_console_write) from > [] (console_unlock+0x3fc/0x4b4) > [ 61.771699] [] (console_unlock) from [] > (vprintk_emit+0x1d0/0x200) > [ 61.771769] [] (vprintk_emit) from [] > (vprintk_default+0x1c/0x24) > [ 61.771840] [] (vprintk_default) from [] > (_printk+0x18/0x28) > [ 61.771914] [] (_printk) from [] > (handle_bad_irq+0x44/0x22c) > [ 61.771991] [] (handle_bad_irq) from [] > (handle_irq_desc+0x24/0x34) > [ 61.772066] [] (handle_irq_desc) from [] > (ssd20xd_gpi_chainedhandler+0xb4/0xc4) > [ 61.772147] [] (ssd20xd_gpi_chainedhandler) from > [] (handle_irq_desc+0x24/0x34) > [ 61.772223] [] (handle_irq_desc) from [] > (handle_domain_irq+0x40/0x54) > [ 61.772299] [] (handle_domain_irq) from [] > (gic_handle_irq+0x60/0x6c) > [ 61.772372] [] (gic_handle_irq) from [] > (__irq_svc+0x4c/0x64) Somehow, the handler for this interrupt is set to handle_bad_irq(), which probably isn't what you want. You'll have to find out who sets this (there is a comment about that in gpiolib.c, but I haven't had a chance to find where this is coming from). Do you happen to set it in your driver? M. -- Without deviation from the norm, progress is not possible.