Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp104463lqm; Tue, 30 Apr 2024 14:27:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPxV8TadSSA+21Z49uR+enl4oaF2BpgYFawB0EIV3OyYijzRQufGqrZO9rp3XXyK2Q6CYPlllL9XyIQaf7c3kCL/HIQnuY38icUmCCUA== X-Google-Smtp-Source: AGHT+IGMiQwPyN56aiy2A7w2nxZ85k82Q9KyNpcKlVejxjRz+wvuK/UcYjEW/6++I6FvOuIT+16n X-Received: by 2002:a05:620a:2888:b0:790:f6eb:178b with SMTP id j8-20020a05620a288800b00790f6eb178bmr646728qkp.11.1714512434529; Tue, 30 Apr 2024 14:27:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714512434; cv=pass; d=google.com; s=arc-20160816; b=shaCnmUWFOuk9JoXyTpuMGWTJq06d+8lPk4ybY6XRRd3rWAoLu7txGP+3UPajjkegE IVWJgVgZSS46w+hsJeaeM/QPMW1eMJDk2lpRY0SmWJ233D0Kw4VTcWoL/1fHrA7Rep1h uH4Fmhws69Q2gOll4CninBjvCoE0wWrTcJHj9Xkklkq7gJ1b4E9w/8WNN2Ql9hRt8gzx s5qBGhyfWQijEiUompE0/RxqpxUMYVvDz4Fs5YLXcAeB0PD48Ei4xKC3x2/ZkSb0vFwq vwwC1EWGGXdVRfXHqPNwnYv+OoXkqOl2qevv5B3grztXvpyfeHt+3GgflSlBki4wdBuf E0bQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=4Qsj4iHcIQ1sTvDBJPsX/NRqttXw7Jkavm6xNKW0QHw=; fh=81r5zU75yX0J+43QIXJZTD57FRWNx/n+gGLUNxxIaqw=; b=d2Gu/Ovx+2z077U1V7GO1kb2iPJ/m4ELPZj27gTAfOq8s5otJZGxjLFiieNNRQT+x+ NtR2Fx0mme2llA8FBWY1IPH6vAui1pi3iSy/5erGiKGi/1ynE/Qva4Qa9oQK+GnWfHaZ bycfwC+aBVg6LfKLa/BeteFMv5oCLVaqsBjVSeHgInt3j0HCyZOpSsCAEEp8d4QGrB3T /ABT519u/B1c8uuLHNazF4kXWw6R9V0WyhSb2W3RApqn6HOVufrNl/UBTJMzFcjiluHQ I+X2iYPRW1r3QhGKzW2Wm5NUIFzHLs2LNdj9gBNYkOdqnOGokdEw3TiSIcCQWAQxKpRG Zq8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fvOmal7l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-164738-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164738-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g23-20020ae9e117000000b0078edb349c10si29024836qkm.179.2024.04.30.14.27.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 14:27:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164738-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fvOmal7l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-164738-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164738-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3FAC31C20D36 for ; Tue, 30 Apr 2024 21:27:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA4D01BED8F; Tue, 30 Apr 2024 21:26:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fvOmal7l" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CC1441BED7D; Tue, 30 Apr 2024 21:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714512415; cv=none; b=hilFu+jQHggagAV77/pgl+vPU35c81BdtcMmd9QC6EQUdj4YcYNESpGK/myM5cPGZ7ThjfKgpr+iGrpVetByToIHYf4iJqV4qKdi+vHxoodb/4cbvGN/CXg1MrJBHn39SQAzxRZ0Y1OgHyPaDqJE/6YReW4qErLas7FhaUFTvEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714512415; c=relaxed/simple; bh=GftF5dObvo3DzQZhK73nALUS/OoRTVHwkjrSlkRcFbo=; h=Message-ID:Content-Type:MIME-Version:In-Reply-To:References: Subject:From:Cc:To:Date; b=cv+16YLt0mg/vrk6mPDIUSa6/QWIo0LR9qYBngPd5Wv9JM0bymKV8edfXIO6V7cAOy4cl1+CMWEGdKABGbdfaZFQHs1sgVaVT6mWGs3Sm23JBG+nQQ98AIkNUuZi8ibEIZtyU0Mmo1qIjYzb1T7iJ9ObOVtVcw25sk2j11AhkYY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fvOmal7l; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40CB6C2BBFC; Tue, 30 Apr 2024 21:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714512415; bh=GftF5dObvo3DzQZhK73nALUS/OoRTVHwkjrSlkRcFbo=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=fvOmal7lzsUj+2CqlwMvZ4sxr0DkAnclbUMAl9ZB4KkCGN4mpb4quKap3elDYGBFX DwU+EYqit3s+kT+5liiPJkNwIjgMeLjrNzybqib341eXKzupLwXuHAJ4okVtK5QVQW jLLzyvHvXMjXPfRAwMN203crGbLAoQ3FNtzVRCArk+BaNKa0ws/JK3jTaNmDKwVMTr BdyNOxZC/z8Zf8f0ScZnrImhu8jbfEV365wI1AF1TtitJJ8P/qZwk8ueyqSAgiSlr8 Bg/9JSjm/+MTTolErbY0BbgVLwQvoYoB7QOKz/FudeDnz3ypJEHAC7z2H9qCCBpWYN cg/T9p1mjIiXg== Message-ID: <6ba2967c6c9d24e3f1c9b76496176010.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <11bd7146-30cd-4b71-b2ca-d76875763731@linaro.org> References: <20240427-topic-8450sdc2-v1-1-631cbb59e0e5@linaro.org> <2337ba58adb3fb127710bead9b8665a9.sboyd@kernel.org> <11bd7146-30cd-4b71-b2ca-d76875763731@linaro.org> Subject: Re: [PATCH] clk: qcom: gcc-sm8450: set OPS_PARENT_ENABLE on gcc_sdcc2_apps_clk_src From: Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Vinod Koul Date: Tue, 30 Apr 2024 14:26:53 -0700 User-Agent: alot/0.10 Quoting Konrad Dybcio (2024-04-30 03:46:52) > On 30.04.2024 2:21 AM, Stephen Boyd wrote: > > Quoting Konrad Dybcio (2024-04-27 05:01:07) > >> Similar to how it works on other SoCs, the top frequency of the SDHCI2 > >> core clock is generated by a separate PLL (peculiar design choice) that > >> is not guaranteed to be enabled (why does the clock framework not hand= le > >> this by default?). > >> > >> Add the CLK_OPS_PARENT_ENABLE flag to make sure we're not muxing the > >> RCG input to a dormant source. > >=20 > > The RCG2 hardware hasn't required the parent to be enabled for clk > > operations besides for the glitch-free source switch. What scenario is > > happening here that's requiring this flag? Is the RCG forcibly enabled > > perhaps because the bootloader has left the root enable bit set > > (CMD_ROOT_EN)? Or are we changing the parent while the clk framework > > thinks the clk is off when it is actually on? > >=20 > > TL;DR: This is papering over a bigger bug. >=20 > Definitely. >=20 >=20 > Take a look at: >=20 > static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] =3D { > F(400000, P_BI_TCXO, 12, 1, 4), > F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0), > F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0), > F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0), > F(202000000, P_GCC_GPLL9_OUT_MAIN, 4, 0, 0), > { } > }; >=20 > XO and GPLL0 are more or less always on, but GPLL9 is described to only > be used for this specific clock for this specific frequency (perhaps it > feeds something else on the soc but that's besides the point). >=20 > Then, the parent input is changed during set_rate, but GPLL9 seems to > never be enabled: Is the sdcc2 RCG enabled during the set_rate?