Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1655568pxp; Thu, 17 Mar 2022 13:44:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVTA2sTQBRQlXqxIitBpYzMWVJK8aiUrTmN/W1NJP1Tg9s94UaY64ICMH+wKK3udS4cU4D X-Received: by 2002:a65:424a:0:b0:375:6d8b:8d44 with SMTP id d10-20020a65424a000000b003756d8b8d44mr5258895pgq.170.1647549890649; Thu, 17 Mar 2022 13:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647549890; cv=none; d=google.com; s=arc-20160816; b=KkT8isznLaRTuuTxldgZTktKH/pQbV7XmsX9SqPMd8a1rXrMNphVbfI6rHBkQAS5Yl aDEP/mK0Ee5hIt7VnocZoRFJ6bSEVrohbCTJwyhw/jhuQkZ2e3Y+tJY9ZKGw/6iGzOHi DSc9ND/AJ1Z1Y2dQv84XgXvxn+zBUgs9ETMjsauHnr0qVCkWum9qmXlgVyIkoifHdF+E 7WfW1uce/+cEWJtIK5lbeD1dzWHrGWEwnAh6nNxrgDAEMJOpfsZV2C2+MkPbB9iyV9+H imMtPge36fmzlqiKfTzGUi0ySPhXJjUiyZnwN5ki8HghFVarnBLs0ezXyJPHl2vYP9wU xwiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=Es1GxZCQyHimmaZU1hdZKPtlY52LhFtU1jc1PT86Ug0=; b=u17w5kah/QNY99Ifm49O2S6jwmoHCvCee7Z32mx+zzGYNiqftByxNqaetS38NwzWRw 74eu/gK0kwx8waq4tQMbaCxG8jI35XSkdKixmH6ScQOBslbNYtnmbVOD38/EUdJBmfs4 K5KQR8jvo4ZM3LWBjpASA2lQnAnn+kKl+DeA9bKr4/hucAcoVnH8uqpNmOgCk3rvUCwn WjOyKjzfxx1BIKsuCh2OsVxX8RLr6KcwB7N28VisU5sHD6GLQUfb3EAzVFerts0ZE0hU WN4VhYNw67BieqYg/3DGaXOzb5y3f9I5vKrG8HxmVQ62cBC2neGdHwqhnkVrjU2o/Pv4 nTTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QHOjltqe; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o2-20020a170902778200b00153be5d2ecasi112750pll.186.2022.03.17.13.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:44:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QHOjltqe; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 338FD1B6972; Thu, 17 Mar 2022 13:12:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbiCQTjh (ORCPT + 99 others); Thu, 17 Mar 2022 15:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231955AbiCQTjf (ORCPT ); Thu, 17 Mar 2022 15:39:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F21EAC8B; Thu, 17 Mar 2022 12:38:16 -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 E7870618B3; Thu, 17 Mar 2022 19:38:15 +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== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Quoting Peng Fan (OSS) (2022-02-28 04:41:12) > From: Peng Fan >=20 > 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. >=20 > Signed-off-by: Peng Fan > --- >=20 > V2: > None >=20 > drivers/clk/imx/clk-composite-8m.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-com= posite-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 =3D &imx_ccm_lock; > div->flags =3D CLK_DIVIDER_ROUND_CLOSEST; > =20 > - gate =3D kzalloc(sizeof(*gate), GFP_KERNEL); > - if (!gate) > - goto fail; > - > - gate_hw =3D &gate->hw; > - gate->reg =3D reg; > - gate->bit_idx =3D PCG_CGC_SHIFT; > - gate->lock =3D &imx_ccm_lock; > + /* skip registering the gate ops if M4 is enabled */ > + if (mcore_booted) { > + gate_hw =3D NULL; It could even use the protected-clocks property and then parse it to figure out to not register this gate? > + } else { > + gate =3D kzalloc(sizeof(*gate), GFP_KERNEL); > + if (!gate) > + goto fail; > + > + gate_hw =3D &gate->hw; > + gate->reg =3D reg; > + gate->bit_idx =3D PCG_CGC_SHIFT; > + gate->lock =3D &imx_ccm_lock; > + }