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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9FEBAC433F5 for ; Thu, 17 Mar 2022 19:39:24 +0000 (UTC) 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:Message-Id:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iNwPp+1hily+YqGNiYkc16OqA4eobQuAWgC0DDXYlTc=; b=Gg2oQfJhXBHMPZ FPb3tuGFq+xrPycpZ+0LIx1xcwJNdxGQs+jDwK53y04A6W0AryfG5tnUsfHzTy2BCAOmGayd8oWh/ o9RFGjNip/GJklzXXhG/cbKhVCXu9AUMLb4ifd0ueptBTBtIbeVD2EieDh01ac54SHU8AG3E40HI3 c4c4LxvhoMliPuhL16XBk8tV2dsF/M+bjcmyolCS82Prg7ZgxLM+u50sRey9qGLWquK455uW9+8jT 5eULxMsxWUg+t1gX1hDhl4Cbv8cYcBNtutzEa1pk7vA1IDLcETKB+L3TSveaCmc21OjGPAC7JogwD LIIODevJpEKKiGS/3D0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUvx1-00HDJU-TV; Thu, 17 Mar 2022 19:38:24 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUvwv-00HDHu-SY for linux-arm-kernel@lists.infradead.org; Thu, 17 Mar 2022 19:38:22 +0000 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 8D5B4B81FC7; Thu, 17 Mar 2022 19:38:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47BC1C340E9; Thu, 17 Mar 2022 19:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647545895; bh=YDBqqtsD8hurDcBaCOcL4NXPfM8to2wSvDT1JakwR+U=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=QHOjltqeHi+HQG2Xky3LWk1zqqafGF3WxgeGSm8rT3vPU0OrIVtLl3wS6uocN6bUc Iz9caqzXOHhc9wy/pqpGQWLiUT7tEAYL04H3Off9vCiP7LW2TXslbbnrF9M9FlQCV8 attIKQFFR35qHc16JPmEtjl44Q5Ff7maf96V5okDuWAb49J7rdiDeNzTYTncKzvF6Z T1iQSTqsCDlTlep0XNjgklbMVXIHWtcGfmRnX1G3rClnGTe5a/M2H3sdA+adcK70ew XDm0JwOvUwJoPhdpLYxbPEH2ppUF0xVoM3GXRKcaZKCN77N1oT1TWg0Zam3UXU1/mi F6m00k3fi+c+Q== MIME-Version: 1.0 In-Reply-To: <20220228124112.3974242-2-peng.fan@oss.nxp.com> References: <20220228124112.3974242-1-peng.fan@oss.nxp.com> <20220228124112.3974242-2-peng.fan@oss.nxp.com> Subject: Re: [PATCH V2 2/2] clk: imx8m: check mcore_booted before register clk From: Stephen Boyd Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan To: Peng Fan (OSS) , abel.vesa@nxp.com, s.hauer@pengutronix.de, shawnguo@kernel.org Date: Thu, 17 Mar 2022 12:38:13 -0700 User-Agent: alot/0.10 Message-Id: <20220317193815.47BC1C340E9@smtp.kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220317_123818_092061_FC39461C X-CRM114-Status: GOOD ( 16.15 ) 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 Quoting Peng Fan (OSS) (2022-02-28 04:41:12) > From: Peng Fan > > If mcore_booted is true, ignore the clk root gate registration and > this will simplify AMP clock management and avoid system hang unexpectly > especially Linux shutdown clk used by mcore. > > Signed-off-by: Peng Fan > --- > > V2: > None > > drivers/clk/imx/clk-composite-8m.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) > > diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c > index 2dfd6149e528..b16c2c0ea9f6 100644 > --- a/drivers/clk/imx/clk-composite-8m.c > +++ b/drivers/clk/imx/clk-composite-8m.c > @@ -223,14 +223,19 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, > div->lock = &imx_ccm_lock; > div->flags = CLK_DIVIDER_ROUND_CLOSEST; > > - gate = kzalloc(sizeof(*gate), GFP_KERNEL); > - if (!gate) > - goto fail; > - > - gate_hw = &gate->hw; > - gate->reg = reg; > - gate->bit_idx = PCG_CGC_SHIFT; > - gate->lock = &imx_ccm_lock; > + /* skip registering the gate ops if M4 is enabled */ > + if (mcore_booted) { > + gate_hw = NULL; It could even use the protected-clocks property and then parse it to figure out to not register this gate? > + } else { > + gate = kzalloc(sizeof(*gate), GFP_KERNEL); > + if (!gate) > + goto fail; > + > + gate_hw = &gate->hw; > + gate->reg = reg; > + gate->bit_idx = PCG_CGC_SHIFT; > + gate->lock = &imx_ccm_lock; > + } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel