From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 2AA53193455 for ; Wed, 10 Jul 2024 14:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720622120; cv=none; b=STvvryPt2uz9FqVNmWRq4h41fwxFUoaVqmfYpgQNmZ+hgdXKvo8gL8D7FTRejW3GoH4Wmtd+Faa4r7U0Mz3rUilENqxhwJVSh4NKDmLN0Adn7XXcDBQnYtDuVJMSGDD1RRnG+e8+cGBzcwfcDU+g7InkH2tDm2z0TH2EpmiAuG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720622120; c=relaxed/simple; bh=7ZxJZY6gKoQFwNHdxiPGNOckl89lxdBAnIdeXwRvngo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=mFH03+XEreCRUr2QXhMcbEmfD0iCWXjeiJKc12xUrjXlNnYWv866mWTgE19mBrogkZUCBC9Y+R6BPv3jj5P8Pa8dRW/R6KWmmfdJ0CGhgQs3RIKhC4vUrRn+kT5HkLIAe/6n9HCJetRUjZhKen72Nzlrh1nlkK/OaqLHgWZzJCk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=mbxLu5p3; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="mbxLu5p3" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240710143516euoutp01cfc69ef383d23d08d8b6c0c1b2e24391~g4LLgWVMm2586225862euoutp01A for ; Wed, 10 Jul 2024 14:35:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240710143516euoutp01cfc69ef383d23d08d8b6c0c1b2e24391~g4LLgWVMm2586225862euoutp01A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1720622116; bh=aEBvXZqhS4HH+bJh8VEk5/tXzC2cbn/RN1jKxc/D+Ts=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=mbxLu5p3EamHhQp5Kew1KujYyRcsL3dho9oglRqdJgqt4zv6rtRO1N8Lr5tIy0bIe 0bl7RjrJkC91tuiS+Q+o9e2Tcv+/LtFtegoSV8mbkXtim8exhI1RgpvxJ9CBzFiWKe UQt3fvjimOFNmTbFeHBSLZB43rkz6H4Fo9tRrbPE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240710143516eucas1p105f3f6ae03c7dbfa3024557a3b6be453~g4LLG7kls0056600566eucas1p1v; Wed, 10 Jul 2024 14:35:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A6.5F.09875.32C9E866; Wed, 10 Jul 2024 15:35:16 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240710143515eucas1p259fa5a03cb56cc2b3d82d124fb8f1cb1~g4LKpxdnc2890628906eucas1p2-; Wed, 10 Jul 2024 14:35:15 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240710143515eusmtrp2afbfab2c14d5a198be6ade93b7f9dfaa~g4LKpABwN2804928049eusmtrp2v; Wed, 10 Jul 2024 14:35:15 +0000 (GMT) X-AuditID: cbfec7f4-9acd8a8000002693-a3-668e9c2375dd Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 71.D7.08810.32C9E866; Wed, 10 Jul 2024 15:35:15 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240710143513eusmtip12b69aa17ffc422426b00e9e44f936f53~g4LJAFqBO2253622536eusmtip1i; Wed, 10 Jul 2024 14:35:13 +0000 (GMT) Message-ID: <0faacbeb-2ca3-4749-89a8-6dd81621a07d@samsung.com> Date: Wed, 10 Jul 2024 16:35:13 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] clk: samsung: gs101: don't mark non-essential (UART) clocks critical To: =?UTF-8?Q?Andr=C3=A9_Draszik?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Griffin , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Michael Turquette , Stephen Boyd , Sam Protsenko , Tudor Ambarus Cc: Will McVicker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org Content-Language: en-US From: Marek Szyprowski In-Reply-To: <20240710-gs101-non-essential-clocks-2-v3-2-5dcb8d040d1c@linaro.org> Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBKsWRmVeSWpSXmKPExsWy7djPc7oqc/rSDNZuZrJ4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/dkhr1USKOPOxMq23mBhx1+mAx8KG3asiE98Z17F91Z6Yf3p3w5ZIn6VfDRvm rL1X/c6Uc2Jpd8yOol2HA80sn03uDT1qZVKm0e375IVNTpLl7RoNqSTPlGSpXTY3dx6K3pk0 0ff2kpy3KcKRxqUdycoutVdivL8GXBZ6vYPPbuVHf+lTb//wu1qn6fdXtj12YP5rKtiZslaJ pTgj0VCLuag4EQAGpS7nnQMAAA== X-CMS-MailID: 20240710143515eucas1p259fa5a03cb56cc2b3d82d124fb8f1cb1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20240710132933eucas1p1b4367ec7a3938a39e732b3079eff6f32 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240710132933eucas1p1b4367ec7a3938a39e732b3079eff6f32 References: <20240710-gs101-non-essential-clocks-2-v3-0-5dcb8d040d1c@linaro.org> <20240710-gs101-non-essential-clocks-2-v3-2-5dcb8d040d1c@linaro.org> On 10.07.2024 15:29, André Draszik wrote: > The peric0_top1_ipclk_0 and peric0_top1_pclk_0 are the clocks going to > peric0/uart_usi, with pclk being the bus clock. Without pclk running, > any bus access will hang. > Unfortunately, in commit d97b6c902a40 ("arm64: dts: exynos: gs101: > update USI UART to use peric0 clocks") the gs101 DT ended up specifying > an incorrect pclk in the respective node and instead the two clocks > here were marked as critical. > > Since then, the DT has been updated to use the correct clock in > commit 21e4e8807bfc ("arm64: dts: exynos: gs101: use correct clocks for > usi_uart") and the driver here should be corrected and the work-around > removed. > > Note that this commit has the side-effect of causing earlycon to stop > to work sometime into the boot for two reasons: > * peric0_top1_ipclk_0 requires its parent gout_cmu_peric0_ip to be > running, but because earlycon doesn't deal with clocks that > parent will be disabled when none of the other drivers that > actually deal with clocks correctly require it to be running and > the real serial driver (which does deal with clocks) hasn't taken > over yet > * hand-over between earlycon and serial driver appears to be > fragile and clocks get enabled and disabled a few times, which > also causes register access to hang while earlycon is still > active > (A wordier explanation can also be found in [1]) > > Nonetheless we shouldn't keep these clocks running unconditionally just > for earlycon. Clocks should be disabled where possible. If earlycon is > required in the future, e.g. for debug, this commit can simply be > reverted (locally!). > > Link: https://lore.kernel.org/all/d45de3b2bb6b48653842cf1f74e58889ed6783ae.camel@linaro.org/ [1] > Fixes: 893f133a040b ("clk: samsung: gs101: add support for cmu_peric0") > Signed-off-by: André Draszik > Reviewed-by: Tudor Ambarus > Reviewed-by: Sam Protsenko Frankly speaking I'm not sure that anyone will find this comment and do local reverts before getting angry that earlycon doesn't work for his device and wasting his time. I think that it would be much better to check if earlycon is specified in kernel's cmdline and if so, simply mark those problematic clocks critical in this driver. Make this code hidden under IS_ENABLED(CONFIG_SERIAL_EARLYCON) to avoid polluting release builds. Any comments? Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland