Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp314027iol; Thu, 9 Jun 2022 04:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvDiRvbJDcawWCu4+ppV6S2ZRPMjGwHIuOUzNDKbhCks4NVgIAadYY98NaplpADhD8Os0E X-Received: by 2002:a17:902:ecc2:b0:163:fe60:43cd with SMTP id a2-20020a170902ecc200b00163fe6043cdmr38346588plh.43.1654774334787; Thu, 09 Jun 2022 04:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654774334; cv=none; d=google.com; s=arc-20160816; b=iSbZhJd/A24VMxw6n7cSih3bujT4v8X52ygESHn7oAmACmM/bLjaYdsnUDrxJtvyDe BIolCEnSIjaHziYGoYmFIwpGbQGj2rjS6QTXxSI4Ze3IarIOmYfXIsPe1n7XanJdqazY yypR/HAcdfBvV4bZHTJk0gvaEQrPuRm6S6O7gxgXPaCuDAXsNPvJX9wA8Nkb5QAkxCQe +fmlZuo78l0DWJaxhhOM/zoeEjAtgV3FGThW27+fB+t69R77DiO5HwDrUBXBGpUW/wgX eYD1Y7uMLeNXy8chnw8A4E/Y71sWZkEuTG7QhqPgYiM5izYExTT2QIRnMrkxdwUP4feQ RiuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=dFSOs9rbs9HAL9RXs6Qvug2lSplU4QDPmvDnca3mK/4=; b=Ws1i8yitZHAGLBs/PuZGnWncAGek6utrVVBVrdyfH7LwQc3tPMS1Xk19zOtVP/JpKl rpjr5eQcq276f1KpYszPkmfVZNoMDBuj82iGstTSkgY8qk48RzuRV2jzqz1Zb7ecrlSA ed+bmmlIvNAGR+BbWOSakvegaINAZMKPPtjaj3Sv9hhC2RnXaPOnYFCbdGZoW7m+Z0UP JLiBv71Qn0ib8liux9PEYF5tBltqWcRGPsaygFW4zOBjPvlN0cXBQocKWW+evN1MlAqp /GIAedubGspdYwhGkvnYH0dc84ViS5F+ySpeA80UrlD3shqK8Iib5ZJCWdEvPQdc4Ydk jRrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Apvizybv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020a170902f21200b00163539b9430si27651914plc.434.2022.06.09.04.32.00; Thu, 09 Jun 2022 04:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Apvizybv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236987AbiFILZ3 (ORCPT + 99 others); Thu, 9 Jun 2022 07:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235756AbiFILZY (ORCPT ); Thu, 9 Jun 2022 07:25:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1900C44754 for ; Thu, 9 Jun 2022 04:25:22 -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 ams.source.kernel.org (Postfix) with ESMTPS id D13E7B82D29 for ; Thu, 9 Jun 2022 11:25:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89171C34114; Thu, 9 Jun 2022 11:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654773919; bh=6/sOlCyCw6rHNEeZDbfk6xBrqaNslLwkK28Hj2D8Uno=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ApvizybvaKty43n7ZSt6NW7is7g+cvIJh9Pd/MqBqLZEFrxfAzrTJ1p6w9t+SBP55 I8Le7+ggZMXjb+hUX/Xew3ob8scpltj6wHGRtRuwWnONoUe8qr/Uci4wHfh0p0zjQu bc82kRCO8SxTsysOmLzzX3OFyxc2nI5FD/DAIEPI2LCvap15IPB0sSymL6FkfCQJIh YQg4gsNcPE4vHCogzLZlnMbMo1z5z3yyj0ytx0fGrkAzXGOhWUGl4mplxtTbr8iHZe ceEwalPaugox/QO7FQNlUZTZa0iMlZ21pfgUQC3g1X9rGuzwv05aVRNBJgtWaMF3rf qDZ+303+PlhMw== 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 1nzGHt-00GqeJ-4G; Thu, 09 Jun 2022 12:25:17 +0100 Date: Thu, 09 Jun 2022 12:25:16 +0100 Message-ID: <87czfi3wpv.wl-maz@kernel.org> From: Marc Zyngier To: Liu Ying Cc: Lucas Stach , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Subject: Re: [PATCH] irqchip/irq-imx-irqsteer: Get/put PM runtime in ->irq_unmask()/irq_mask() In-Reply-To: <07e01555c4722daed2dc13871c42ef7764a157ae.camel@nxp.com> References: <20220608105057.2607812-1-victor.liu@nxp.com> <2d79719b8670a3693b210af5ab45716dba23999a.camel@pengutronix.de> <17d3adc7d7d329cab65b54ce71db05bc070872d1.camel@nxp.com> <26973cddee5f527ea17184c0f3fccb70bc8969a0.camel@pengutronix.de> <87k09r45ww.wl-maz@kernel.org> <07e01555c4722daed2dc13871c42ef7764a157ae.camel@nxp.com> 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: victor.liu@nxp.com, l.stach@pengutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 09 Jun 2022 02:41:55 +0100, Liu Ying wrote: > > On Wed, 2022-06-08 at 14:54 +0100, Marc Zyngier wrote: > > On Wed, 08 Jun 2022 13:02:46 +0100, > > Lucas Stach wrote: > > > > > > Am Mittwoch, dem 08.06.2022 um 19:29 +0800 schrieb Liu Ying: > > > > On Wed, 2022-06-08 at 12:56 +0200, Lucas Stach wrote: > > > > > Am Mittwoch, dem 08.06.2022 um 18:50 +0800 schrieb Liu Ying: > > > > > > Now that runtime PM support was added in this driver, we have > > > > > > to enable power before accessing irqchip registers. And, > > > > > > after > > > > > > the access is done, we should disable power. This patch > > > > > > calls > > > > > > pm_runtime_get_sync() in ->irq_unmask() and pm_runtime_put() > > > > > > in > > > > > > ->irq_mask() to make sure power is managed for the register > > > > > > access. > > > > > > > > > > > > > > > > Can you tell me in which case this is necessary? IIRC the IRQ > > > > > core > > > > > > > > With the i.MX8qxp DPU driver[1], I see below synchronous external > > > > abort: > > > > > > > > [ 1.207270] Internal error: synchronous external abort: > > > > 96000210 > > > > [#1] PREEMPT SMP > > > > [ 1.207287] Modules linked in: > > > > [ 1.207299] CPU: 1 PID: 64 Comm: kworker/u8:2 Not tainted > > > > 5.18.0- > > > > rc6-next-20220509-00053-gf01f74ee1c18 #272 > > > > [ 1.207311] Hardware name: Freescale i.MX8QXP MEK (DT) > > > > [ 1.207319] Workqueue: events_unbound deferred_probe_work_func > > > > [ 1.207339] pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT > > > > -SSBS > > > > BTYPE=--) > > > > [ 1.207349] pc : imx_irqsteer_irq_unmask+0x48/0x80 > > > > [ 1.207360] lr : imx_irqsteer_irq_unmask+0x38/0x80 > > > > [ 1.207368] sp : ffff80000a88b900 > > > > [ 1.207372] x29: ffff80000a88b900 x28: ffff8000080fed90 x27: > > > > ffff8000080fefe0 > > > > [ 1.207388] x26: ffff8000080fef40 x25: ffff0008012538d4 x24: > > > > ffff8000092fe388 > > > > [ 1.207407] x23: 0000000000000001 x22: ffff0008013295b4 x21: > > > > ffff000801329580 > > > > [ 1.207425] x20: ffff0008003faa60 x19: 000000000000000e x18: > > > > 0000000000000000 > > > > [ 1.207443] x17: 0000000000000003 x16: 0000000000000162 x15: > > > > 0000000000000001 > > > > [ 1.207459] x14: 0000000000000002 x13: 0000000000000018 x12: > > > > 0000000000000040 > > > > [ 1.207477] x11: ffff000800682480 x10: ffff000800682482 x9 : > > > > ffff80000a072678 > > > > [ 1.207495] x8 : ffff0008006a64a8 x7 : 0000000000000000 x6 : > > > > ffff0008006a6608 > > > > [ 1.207513] x5 : ffff800009070a18 x4 : 0000000000000000 x3 : > > > > ffff80000b240000 > > > > [ 1.207529] x2 : ffff80000b240038 x1 : 00000000000000c0 x0 : > > > > 00000000000000c0 > > > > [ 1.207549] Call trace: > > > > [ 1.207553] imx_irqsteer_irq_unmask+0x48/0x80 > > > > [ 1.207562] irq_enable+0x40/0x8c > > > > [ 1.207575] __irq_startup+0x78/0xa4 > > > > [ 1.207588] irq_startup+0x78/0x16c > > > > [ 1.207601] irq_activate_and_startup+0x38/0x70 > > > > [ 1.207612] __irq_do_set_handler+0xcc/0x1e0 > > > > [ 1.207626] irq_set_chained_handler_and_data+0x58/0xa0 > > > > > > Ooh, I think this is the problem. The IRQ is not requested in the > > > usual > > > way when a chained handler is added, so this might bypass the > > > runtime > > > PM handling normally done in the IRQ core. In that case this is a > > > core > > > issue and should not be worked around in the driver, but the core > > > should take the RPM reference for the chained handler, just like it > > > does for normal IRQs. > > > > Well spotted. Could you please give the hack below (compile-tested > > only) a go? > > I don't see the splat after your patch is applied. Can I take this as a formal "Tested-by:" tag? Thanks, M. -- Without deviation from the norm, progress is not possible.