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] [day] [month] [year] [list]
Message-ID: <faafcc6f-d5f5-449b-bb43-81bf496bdbb0@kernel.org>
Date: Wed, 13 Aug 2025 20:19:57 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Michael Walle <mwalle@...nel.org>, Frank Binns <frank.binns@...tec.com>,
 Matt Coster <matt.coster@...tec.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
 David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, Nishanth Menon <nm@...com>,
 Vignesh Raghavendra <vigneshr@...com>, Tero Kristo <kristo@...nel.org>
Cc: dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 Stephan Gerhold <stephan.gerhold@...aro.org>,
 Abel Vesa <abel.vesa@...aro.org>, Bjorn Andersson <andersson@...nel.org>,
 Konrad Dybcio <konradybcio@...nel.org>, Stephen Boyd <sboyd@...nel.org>
Subject: Re: [RFC PATCH 2/3] drm/imagination: fix clock control on the J722S

On 16/07/2025 15:47, Michael Walle wrote:
> The J722S won't let you set the clock frequency if there is no device
> using it. Thus, the assigned-clocks property won't work per se.
> 
> As a workaround, set the clock again during the probing of the driver.
> 
> Signed-off-by: Michael Walle <mwalle@...nel.org>
> ---
>  drivers/gpu/drm/imagination/pvr_device.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c
> index 8b9ba4983c4c..e7a7cc1bdf93 100644
> --- a/drivers/gpu/drm/imagination/pvr_device.c
> +++ b/drivers/gpu/drm/imagination/pvr_device.c
> @@ -16,6 +16,7 @@
>  
>  #include <linux/bitfield.h>
>  #include <linux/clk.h>
> +#include <linux/clk/clk-conf.h>
>  #include <linux/compiler_attributes.h>
>  #include <linux/compiler_types.h>
>  #include <linux/dma-mapping.h>
> @@ -641,6 +642,14 @@ pvr_device_init(struct pvr_device *pvr_dev)
>  	if (err)
>  		return err;
>  
> +	/* Set any 'assigned-clocks' properties again. This is a workaround for
> +	 * the clock handling on k3 platforms. There, one cannot set the clock
> +	 * frequency until there is at least one (enabled) user if it.
> +	 */
> +	err = of_clk_set_defaults(drm_dev->dev->of_node, true);
> +	if (err)
> +		return err;

+Cc Abel, Bjorn, Konrad, Stephan G. and Stephen B.,

Interesting stuff. This touches a bit similar problems we have (and had)
for Qualcomm Display PHYs, where assigned-clock-parents were called too
early - before the block (PHY) is being enabled.

The workaround we implemented so far was - last patch hook in:
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=80dd5911cbfdc2f6ae904341d41a7a8bd8cc546c

I know Stephan G. is working on something better, so probably he will Cc
you once this is ready.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ