Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2005583lqo; Mon, 13 May 2024 05:26:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjlAockiZL368vcJv0U/vxsWwAqpof9KHfKU8iDev1wKo/65DsfqDCluzWo8LhE8DD+oaq+jYaI8maW7eOsCNypCBlRY+eFceFbxLpFA== X-Google-Smtp-Source: AGHT+IGc5VilYy7RLz3El1xhq83YZVmVUPynl4xdlnjg1ApV9T2ubZhaDCe87KbYDg8O0qvjvuvB X-Received: by 2002:a17:906:ae50:b0:a59:c3a5:4df0 with SMTP id a640c23a62f3a-a5a2d53b0bbmr1036005366b.4.1715603215726; Mon, 13 May 2024 05:26:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715603215; cv=pass; d=google.com; s=arc-20160816; b=w9mSjOXb+XVPHmjpqF0MqwTxQ5gC1qLJnM2ZGpoie/QplhpGCRVqVSI5/4KFmnqw1K 7k3K4fmkb6wkJkDfx41GxM+tP5cTRSE1mDj4HlM/fIV2h6znynsEf01pSbdINkB+wZ04 TYHjjuyBuveDijRJ8SOZyji+oyapItyLrpYN+nmVeflTOgtW8wMnIVeerbQpHMZS5NhH Txoja17ztWeQp7ma45SpiUvHeSBWJYWCc3xu1AIPuFo/G0Rge+vPIxTEvucGWh/XwCzv IghqsJr7vQlmK2/lfXln0jQVRORdexU55lLitNnGnqPPvPHSQ6d5aJybLz4ihytRW6Zq /axQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=EodGgJr8syf6L7wTStzcu8PNGWePtbkgyatzLArNNC4=; fh=4kbrR7g8ouCmXJBu/LpBsS8js+fDdMOrmeLi70nzDKI=; b=yIZxmqXdeoYXib6XRyIfExqn6a5wgd15Da+zyRrc5PnffOTYWUCqSf0kIfPW9iMVVO Gs3KgYM5udxDdDawR+7GBGq8pNUn/KFjFlkZHoAXgUELLUa2bUAZIcr44u7u0Q3BzihN ByAq3LLU+hBOkAIR+3QtxO9zGUh85ceOgLOMVSCVaieQUEG1laqvlauZ4hzNvZkXbrgp kIRn4CNsAYIyTiWge3oALguxut9buF3Gzl9sR/Bj3pNp33XKd90dMtBaX8snCIlWPkFX 4R78e1dm7yuXqrZp4ZItdvRUuIgOo21tciY92nYo2HdccP4JFNXsVOf00I3DUO44kWaQ HGrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-177555-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177555-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c670si516786266b.992.2024.05.13.05.26.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 05:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177555-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-177555-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177555-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 65C931F24288 for ; Mon, 13 May 2024 12:26:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47AF414F13D; Mon, 13 May 2024 12:26:50 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A439914F133 for ; Mon, 13 May 2024 12:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715603209; cv=none; b=Ac33/Yh4XWv59uOsup4qFdV30Pq3FVlIIEjJkko7HQFF/rjLNGLqSC9XFkRjAmRGbJEDpswi7cYIiEjlUNoD1Ky/MYSwBcVsCvlIMBSY81Sm274KBr0ZKm0qwimgWN8t+ugW0HTdUEc/lCcEHc//Gl9XjpW0yIfCyrB6n2+2TaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715603209; c=relaxed/simple; bh=QqDCC4k0NPdJbIRo5g2C9AZNgV71fSbSWfaOiOVXx8o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VZ/joQXCh5zs+AnRH76GIbj2z3oTDn4YfheTnM3Wr5HYwc78B1vd9MEouBJdZAJRRRqkew20j85TY3ehjRUdQQ3EH6LI7Eecv+z/KCT75ywKmt28xTCOrcEK6UgDShEN8hNL8ye9GpY5jJ99YfbUCpw4iGe4UlhgfjR0E8jKvGU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1s6Ul4-0006Rd-I3; Mon, 13 May 2024 14:26:22 +0200 Message-ID: <3ecbba68-d8c8-4700-b438-b47e9b8a4525@pengutronix.de> Date: Mon, 13 May 2024 14:26:20 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 08/17] clk: imx: imx8mp: fix clock tree update of TF-A managed clocks To: "Peng Fan (OSS)" , Abel Vesa , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Jacky Bai , Ye Li , Dong Aisheng Cc: imx@lists.linux.dev, Peng Fan , linux-kernel@vger.kernel.org, Zhipeng Wang , Abel Vesa , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240510-imx-clk-v2-0-c998f315d29c@nxp.com> <20240510-imx-clk-v2-8-c998f315d29c@nxp.com> Content-Language: en-US From: Ahmad Fatoum In-Reply-To: <20240510-imx-clk-v2-8-c998f315d29c@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Hello Peng, The commit message looks eerily familiar ;) Small correction below. On 10.05.24 11:19, Peng Fan (OSS) wrote: > From: Zhipeng Wang > > On the i.MX8M*, the TF-A exposes a SiP (Silicon Provider) service > for DDR frequency scaling. The imx8m-ddrc-devfreq driver calls the > SiP and then does clk_set_parent on the DDR muxes to synchronize > the clock tree. > > since commit 936c383673b9 ("clk: imx: fix composite peripheral flags"), > these TF-A managed muxes have SET_PARENT_GATE set, which results > in imx8m-ddrc-devfreq's clk_set_parent after SiP failing with -EBUSY: > > clk_set_parent(dram_apb_src, sys1_pll_40m);(busfreq-imx8mq.c) > > This is safe to do, because updating the Linux clock tree to reflect > reality will always be glitch-free. This refers to the next sentence, thus swap position of this sentence with the next one: > > commit 926bf91248dd > ("clk: imx8m: fix clock tree update of TF-A managed clocks") adds this > method and enables 8mm, 8mn and 8mq. i.MX8MP also needs it. s/this method/imx8m_clk_hw_fw_managed_composite which sets the SET_PARENT_GATE flag/ > > Another reason to this patch is that powersave image BT music > requires dram to be 400MTS, so clk_set_parent(dram_alt_src, > sys1_pll_800m); is required. Without this patch, it will not succeed. > > Fixes: 936c383673b9 ("clk: imx: fix composite peripheral flags") > Signed-off-by: Zhipeng Wang > Signed-off-by: Peng Fan With commit message adjusted: Reviewed-by: Ahmad Fatoum Thanks, Ahmad > --- > drivers/clk/imx/clk-imx8mp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c > index 670aa2bab301..e561ff7b135f 100644 > --- a/drivers/clk/imx/clk-imx8mp.c > +++ b/drivers/clk/imx/clk-imx8mp.c > @@ -551,8 +551,8 @@ static int imx8mp_clocks_probe(struct platform_device *pdev) > > hws[IMX8MP_CLK_IPG_ROOT] = imx_clk_hw_divider2("ipg_root", "ahb_root", ccm_base + 0x9080, 0, 1); > > - hws[IMX8MP_CLK_DRAM_ALT] = imx8m_clk_hw_composite("dram_alt", imx8mp_dram_alt_sels, ccm_base + 0xa000); > - hws[IMX8MP_CLK_DRAM_APB] = imx8m_clk_hw_composite_critical("dram_apb", imx8mp_dram_apb_sels, ccm_base + 0xa080); > + hws[IMX8MP_CLK_DRAM_ALT] = imx8m_clk_hw_fw_managed_composite("dram_alt", imx8mp_dram_alt_sels, ccm_base + 0xa000); > + hws[IMX8MP_CLK_DRAM_APB] = imx8m_clk_hw_fw_managed_composite_critical("dram_apb", imx8mp_dram_apb_sels, ccm_base + 0xa080); > hws[IMX8MP_CLK_VPU_G1] = imx8m_clk_hw_composite("vpu_g1", imx8mp_vpu_g1_sels, ccm_base + 0xa100); > hws[IMX8MP_CLK_VPU_G2] = imx8m_clk_hw_composite("vpu_g2", imx8mp_vpu_g2_sels, ccm_base + 0xa180); > hws[IMX8MP_CLK_CAN1] = imx8m_clk_hw_composite("can1", imx8mp_can1_sels, ccm_base + 0xa200); > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |