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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBBE1C433F5 for ; Tue, 21 Sep 2021 08:29:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8487C61215 for ; Tue, 21 Sep 2021 08:29:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8487C61215 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ccOaMRl6JWgM18HPFibYNMrvNNuBX+mcDAn74stIFOM=; b=y9verFZpGR9Zlt NMi6lL3uggE7mQ0gC3oqwJnQDTo5cU3qN31NkHzzBHyEeeD5Ii/L5wrvExzheE78dBFxdGjnML1Aa utB1ieeYfJr1Z+cyOao6ipOpIpL1giGHuVQ/VnrK2BKDQek5eYubrsBVHTDkIcQelagtKzwzocvHK 3GwV0x3RJsParSMo+jVpPcRUyr1etzwrasWyreZ7SRw776B3zDVPDkBNASSyF3mMcdEsVAngfiVyb m6h346GD9wCnyhsw6catAi2RnTz67sWU2z6AdvFqNfyY7Ftnf/j8MHNDZkJ0ORFhX2nC6g+W1QBKx 8LXRqdmLQarQ+jpS7iiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSb7q-003wLI-UR; Tue, 21 Sep 2021 08:27:39 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSb7n-003wKZ-HD for linux-arm-kernel@lists.infradead.org; Tue, 21 Sep 2021 08:27:37 +0000 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 2D89C61215; Tue, 21 Sep 2021 08:27:35 +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 1mSb7l-00C0DE-9X; Tue, 21 Sep 2021 09:27:33 +0100 Date: Tue, 21 Sep 2021 09:27:32 +0100 Message-ID: <87lf3quydn.wl-maz@kernel.org> From: Marc Zyngier To: Daniel Palmer , Linus Walleij Cc: 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> 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") 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210921_012735_650979_9D710A91 X-CRM114-Status: GOOD ( 19.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 21 Sep 2021 05:16:35 +0100, Daniel Palmer wrote: + Linus. > So if I set irq_chip_ack_parent as the ack callback I get another explosion: > > # gpiomon -r 0 44 > [ 22.370689] 8<--- cut here --- > [ 22.373802] Unable to handle kernel NULL pointer dereference at > virtual address 00000018 > [ 22.381945] pgd = (ptrval) > [ 22.384685] [00000018] *pgd=235cb835, *pte=00000000, *ppte=00000000 > [ 22.391038] Internal error: Oops: 17 [#1] SMP ARM > [ 22.395776] Modules linked in: > [ 22.398860] CPU: 1 PID: 193 Comm: gpiomon Not tainted 5.15.0-rc2+ #2566 > [ 22.405515] Hardware name: MStar/Sigmastar Armv7 (Device Tree) > [ 22.411376] PC is at irq_chip_ack_parent+0x8/0x10 > [ 22.416120] LR is at __irq_do_set_handler+0x3c/0x11c > [ 22.421119] pc : [] lr : [] psr: a0040093 > [ 22.427419] sp : c3505d68 ip : ffffe000 fp : 00000000 > [ 22.432673] r10: c0d592d4 r9 : 00000001 r8 : 00000000 > [ 22.437927] r7 : c3502618 r6 : 00000000 r5 : c017b9cc r4 : c3502600 > [ 22.444489] r3 : 00000000 r2 : c10bb294 r1 : c10bb294 r0 : c26a3440 > [ 22.451053] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM > Segment user > [ 22.458317] Control: 10c5387d Table: 235b006a DAC: 00000055 > ---snip--- > [ 22.725196] [] (irq_chip_ack_parent) from [] > (__irq_do_set_handler+0x3c/0x11c) > [ 22.734219] [] (__irq_do_set_handler) from [] > (__irq_set_handler+0x38/0x50) > [ 22.742976] [] (__irq_set_handler) from [] > (irq_domain_set_info+0x34/0x48) > [ 22.751649] [] (irq_domain_set_info) from [] > (gpiochip_hierarchy_irq_domain_alloc+0x104/0x228) > [ 22.762069] [] (gpiochip_hierarchy_irq_domain_alloc) from > [] (__irq_domain_alloc_irqs+0xd8/0x318) > [ 22.772748] [] (__irq_domain_alloc_irqs) from > [] (irq_create_fwspec_mapping+0x22c/0x298) > [ 22.782641] [] (irq_create_fwspec_mapping) from > [] (gpiochip_to_irq+0x60/0x84) > [ 22.791664] [] (gpiochip_to_irq) from [] > (gpiod_to_irq+0x48/0x60) > [ 22.799552] [] (gpiod_to_irq) from [] > (gpio_ioctl+0x1b4/0x420) > [ 22.807178] [] (gpio_ioctl) from [] (vfs_ioctl+0x20/0x38) > [ 22.814371] [] (vfs_ioctl) from [] (sys_ioctl+0xb0/0x818) > [ 22.821564] [] (sys_ioctl) from [] > (ret_fast_syscall+0x0/0x1c) > [ 22.829190] Exception stack(0xc3505fa8 to 0xc3505ff0) > [ 22.834273] 5fa0: ???????? ???????? ???????? > ???????? ???????? ???????? > [ 22.842488] 5fc0: ???????? ???????? ???????? ???????? ???????? > ???????? ???????? ???????? > [ 22.850701] 5fe0: ???????? ???????? ???????? ???????? > [ 22.855790] Code: e593301c e12fff13 e5900018 e5903010 (e5933018) > [ 22.861919] ---[ end trace 10524aa06eced7e3 ]--- This seems to be caused by your GPIO driver installing a flow handler (via irq_domain_set_info()), which is a bit odd. I would expect that only the root irqchip in the hierarchy would do that. At the point where this is called, the hierarchy isn't fully populated (the irq_domain_alloc_irqs_parent() call comes after that), and irq_chip_ack_parent() explodes as above. Linus: is there a reason why the gpiolib insist on setting its own handler while building the hierarchy? I guess this could be worked around by swapping the calls to irq_domain_set_info and irq_domain_alloc_irqs_parent, but having two levels of the hierarchy competing for the flow handler looks a bit odd. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel