lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0faacbeb-2ca3-4749-89a8-6dd81621a07d@samsung.com>
Date: Wed, 10 Jul 2024 16:35:13 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: André Draszik <andre.draszik@...aro.org>, Greg
	Kroah-Hartman <gregkh@...uxfoundation.org>, Jiri Slaby
	<jirislaby@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski
	<krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Peter Griffin
	<peter.griffin@...aro.org>, Sylwester Nawrocki <s.nawrocki@...sung.com>,
	Chanwoo Choi <cw00.choi@...sung.com>, Alim Akhtar <alim.akhtar@...sung.com>,
	Michael Turquette <mturquette@...libre.com>, Stephen Boyd
	<sboyd@...nel.org>, Sam Protsenko <semen.protsenko@...aro.org>, Tudor
	Ambarus <tudor.ambarus@...aro.org>
Cc: Will McVicker <willmcvicker@...gle.com>, kernel-team@...roid.com,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
	devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-samsung-soc@...r.kernel.org, linux-clk@...r.kernel.org
Subject: Re: [PATCH v3 2/2] clk: samsung: gs101: don't mark non-essential
 (UART) clocks critical

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 <andre.draszik@...aro.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@...aro.org>
> Reviewed-by: Sam Protsenko <semen.protsenko@...aro.org>

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ