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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41A2BC433F5 for ; Mon, 25 Oct 2021 09:13:57 +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 097B060E75 for ; Mon, 25 Oct 2021 09:13:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 097B060E75 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=er63lGrr0j6TJbVp1yZZNsY5U0ndu+CoxWxfE4CPTWA=; b=zZszUd7ZkPhreC Zs72OKklLTMaUyp2iFlJjr+qrQYX3vBz99WtimUTYpikm++xqIJRUN4XTKEdepPBpsJ8ZZGzO+OWb 3ICQz5BRRdBtOWaGFG9kZXbJEq8UbrNEnZnAeJwvK0FG7craPYIe1yAN+zzg+F+y8pQGghQeWnmBl JVLi1Kkkzhb1UA8QNUjBh9BV25P3s8Qy7vWDKMncw55CZlmOpNQgPtigB6EkXqkCXtbPj8yjsWUw3 ETTDCsebA+nHlJV3xBJXfv+BX2q6SPF2G1Je1urun+kFURF7h5I7C/W2hvOhpD2U2UjlLuhVSyxYE iPRgMWlZm3GLHGwYxyCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mew21-00FuFd-6t; Mon, 25 Oct 2021 09:12:37 +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 1mew1x-00FuF7-Lc for linux-arm-kernel@lists.infradead.org; Mon, 25 Oct 2021 09:12:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A652460E75; Mon, 25 Oct 2021 09:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635153153; bh=MjBexmc+UwyAQdIuRX30ws8hPJix22br3QpCrOQ0dyY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p3UxHM3x7BttuZNCO0VVvfuOeg4fHL89nqnrZVHKEOQY6MXLzHNC9zx6s7ADGIScu MYHd78nLDFRPNUHSgz1/TUjG0oqdjB/iMtOJT6eKcWe4JFMXEg+TnN8R1GAcLHRH+R eqstupuMGJdObAZZnMrqBHrtasQcu36j7hVvzUbdLiFmE9BuHfnrgMBMwY2xFhm3d8 1lg1nVIs6uevMiYHDZjwHdCrvU9wtDlnOQobZd4izjbUJ52fiAmBiI06qqF/3zIqG6 5HZtePMCpWFTT992jJKvR56D9qmAB1PYz1f2oNDfeRiIcP1ko+OBlxUFcLXRiOiE7B GDILHcbTOcSVQ== Date: Mon, 25 Oct 2021 12:12:28 +0300 From: Abel Vesa To: Peng Fan Cc: Ahmad Fatoum , "Peng Fan (OSS)" , "sboyd@kernel.org" , "mturquette@baylibre.com" , Abel Vesa , "s.hauer@pengutronix.de" , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , "festevam@gmail.com" , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] clk: imx: gate off peripheral clock slice Message-ID: References: <20211022130946.16683-1-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211025_021233_779912_B0FD4A04 X-CRM114-Status: GOOD ( 30.98 ) 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 21-10-22 15:46:20, Peng Fan wrote: > Hi Ahmad, > > > Subject: Re: [PATCH] clk: imx: gate off peripheral clock slice > > > > Hello Peng, > > > > On 22.10.21 15:09, Peng Fan (OSS) wrote: > > > From: Peng Fan > > > > > > The Peripheral clocks are default enabled when SoC power on, and > > > bootloader not gate off the clocks when booting Linux Kernel. > > > > > > So Linux Kernel is not aware the peripheral clocks are enabled and > > > still take them as disabled because of enable count is zero. > > > > > > Then Peripheral clock's source without clock gated off could be > > > changed when have assigned-parents in device tree > > > > > > However, per i.MX8M* reference mannual, "Peripheral clock slices must > > > be stopped to change the clock source", so need to gate off the the > > > peripheral clock when registering the clocks to avoid glitch. > > > > This sounds like a fix that should be backported. If so, could you provide a > > Fixes: Tag? > > We not see any critical issue without this patch, just to avoid > any potential risk here. So I not add fix tag here. > > Abel, do you prefer a fixes tag or leave it as is? > Lets put a fixes tag still. That way, it will be backported and it will probably save someone (who's maybe using an older kernel) a headache. Plus, it will get in sooner. > Thanks, > Peng. > > > > > Thanks, > > Ahmad > > > > > > > > Tested boot on i.MX8MM/P-EVK board > > > > > > Signed-off-by: Peng Fan > > > --- > > > drivers/clk/imx/clk-composite-8m.c | 9 ++++++++- > > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/clk/imx/clk-composite-8m.c > > > b/drivers/clk/imx/clk-composite-8m.c > > > index 2dfd6149e528..ee41fbf90589 100644 > > > --- a/drivers/clk/imx/clk-composite-8m.c > > > +++ b/drivers/clk/imx/clk-composite-8m.c > > > @@ -184,6 +184,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const > > char *name, > > > struct clk_mux *mux = NULL; > > > const struct clk_ops *divider_ops; > > > const struct clk_ops *mux_ops; > > > + u32 val; > > > > > > mux = kzalloc(sizeof(*mux), GFP_KERNEL); > > > if (!mux) > > > @@ -216,8 +217,14 @@ struct clk_hw *__imx8m_clk_hw_composite(const > > char *name, > > > div->width = PCG_PREDIV_WIDTH; > > > divider_ops = &imx8m_clk_composite_divider_ops; > > > mux_ops = &clk_mux_ops; > > > - if (!(composite_flags & IMX_COMPOSITE_FW_MANAGED)) > > > + if (!(composite_flags & IMX_COMPOSITE_FW_MANAGED)) { > > > flags |= CLK_SET_PARENT_GATE; > > > + if (!(flags & CLK_IS_CRITICAL)) { > > > + val = readl(reg); > > > + val &= ~BIT(PCG_CGC_SHIFT); > > > + writel(val, reg); > > > + } > > > + } > > > } > > > > > > div->lock = &imx_ccm_lock; > > > > > > > > > -- > > Pengutronix e.K. | > > | > > Steuerwalder Str. 21 | > > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.p > > engutronix.de%2F&data=04%7C01%7Cpeng.fan%40nxp.com%7Cb5b827 > > 20263e43680e9208d995597f48%7C686ea1d3bc2b4c6fa92cd99c5c301635% > > 7C0%7C0%7C637705033902868076%7CUnknown%7CTWFpbGZsb3d8eyJWIj > > oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1 > > 000&sdata=PolK7YYK66Bbyd6KJgINnvma8JZ6OdDZ8e1cp6rvIww%3D&a > > mp;reserved=0 | > > 31137 Hildesheim, Germany | Phone: > > +49-5121-206917-0 | > > Amtsgericht Hildesheim, HRA 2686 | Fax: > > +49-5121-206917-5555 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel