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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02A2BC433F5 for ; Mon, 3 Oct 2022 15:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbiJCP2R (ORCPT ); Mon, 3 Oct 2022 11:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbiJCP2P (ORCPT ); Mon, 3 Oct 2022 11:28:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C7096410 for ; Mon, 3 Oct 2022 08:28:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A8BF661053 for ; Mon, 3 Oct 2022 15:28:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12E8FC433C1; Mon, 3 Oct 2022 15:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664810893; bh=m9WGrVnUN7ntsy9LkSqU88tht2yXhOCMyHJs4NJXAI8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NBfjbu3NMpOmBcxOxSe9w5r+TCMQYDKZnlBgekTec3Qt1AVWayrvjFwigTy4ukEH/ NbL4uZjnS/BBzL+fHrA4jcUwkXeGrgdVRvxGXQabvmCVfjsuXxVVkMMFGVX0S6eTK4 XpLxFWt0Sx6Ox0QKhlQ4J+VqcRW6HL1mLPvkAa0Uc0pyWG9C9O1w4afjuENEqozo2o U7b5OVra5bWRkgt7wEY7Y5S40ybPFvTdf0lh5QOJSvA6xubSEmuRsyXv5lZarJHyAF DVrbZlIMXK94s+tnfQTCmpG671zj7+IMbpBATzsfwZKLWMrIiQw/9/J5UxGjyJvEVL NLyMlkocAXB7g== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ofNMY-00EKWH-S4; Mon, 03 Oct 2022 16:28:10 +0100 Date: Mon, 03 Oct 2022 16:28:10 +0100 Message-ID: <864jwlapv9.wl-maz@kernel.org> From: Marc Zyngier To: Vladimir Oltean Cc: Arnd Bergmann , Lee Jones , Thomas Gleixner , "linux-kernel@vger.kernel.org" , Rasmus Villemoes , "Z.Q. Hou" , Biwen Li , Sean Anderson Subject: Re: [PATCH v4] irqchip/ls-extirq: fix invalid wait context by avoiding to use regmap In-Reply-To: <20221003094542.tlh6xoee77akuubn@skbuf> References: <20220728144254.175385-1-vladimir.oltean@nxp.com> <20220818141309.ifl3kddmxojqc2jl@skbuf> <20221003094542.tlh6xoee77akuubn@skbuf> 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 (aarch64-unknown-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: vladimir.oltean@nxp.com, arnd@arndb.de, lee.jones@linaro.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk, zhiqiang.hou@nxp.com, biwen.li@nxp.com, sean.anderson@seco.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: linux-kernel@vger.kernel.org On Mon, 03 Oct 2022 10:45:43 +0100, Vladimir Oltean wrote: > > Hi Marc, Arnd, > > On Thu, Aug 18, 2022 at 05:13:09PM +0300, Vladimir Oltean wrote: > > Hi, > > > > On Thu, Jul 28, 2022 at 05:42:54PM +0300, Vladimir Oltean wrote: > > > The irqchip->irq_set_type method is called by __irq_set_trigger() under > > > the desc->lock raw spinlock. > > > > > > The ls-extirq implementation, ls_extirq_irq_set_type(), uses an MMIO > > > regmap created by of_syscon_register(), which uses plain spinlocks > > > (the kind that are sleepable on RT). > > > > > > Therefore, this is an invalid locking scheme for which we get a kernel > > > splat stating just that ("[ BUG: Invalid wait context ]"), because the > > > context in which the plain spinlock may sleep is atomic due to the raw > > > spinlock. We need to go raw spinlocks all the way. > > > > > > Make this driver ioremap its INTPCR register on its own, and stop > > > relying on syscon to provide a regmap. Since the regmap we got from > > > syscon belonged to the parent and the newly ioremapped region belongs > > > just to us, the offset to the INTPCR register is now 0, because of the > > > address translation that takes place through the device tree. > > > > > > One complication, due to the fact that this driver uses IRQCHIP_DECLARE > > > rather than traditional platform devices with probe and remove methods, > > > is that we cannot use devres, so we need to implement a full-blown > > > cleanup procedure on the error path. > > > > > > Fixes: 0dcd9f872769 ("irqchip: Add support for Layerscape external interrupt lines") > > > Signed-off-by: Vladimir Oltean > > > --- > > > > Just checking in on this patch to make sure it hasn't been forgotten. > > Is there something else I need to do such that this patch gets accepted? No, it just went under the radar. I would have liked an ack from Rasmus, but this has been there for long enough. I'll queue this as a fix for 6.1. Thanks, M. -- Without deviation from the norm, progress is not possible.