[PATCH v2 0/5] rng: msm: fixes for MSM8916

Caleb Connolly caleb.connolly at linaro.org
Wed Feb 12 17:12:25 CET 2025



On 2/12/25 07:01, Sam Day wrote:
> The msm-rng driver is currently broken on MSM8916.
> 
> The first issue is that the core clock isn't defined and thus not being
> enabled before registers in the PRNG block are accessed.
> 
> The second issue is that the enable method is only initializing the PRNG
> registers if the block is *already* initialized. This would have likely
> caused issues elsewhere once the driver was in more active use, but the
> problems on MSM8916 are immediate: trying to modify the state of LFSR_CFG
> causes SErrors, presumably because this register is protected by TZ.
> 
> I also included a couple of extra patches while I'm in the neighborhood.
> One is to improve the logging in apq8016 clk_enable (which would have
> better surfaced the first issue). The other changes msm-rng driver slightly
> to only enable its core clock when it's needed (similar to how the kernel
> does it).
> 
> Signed-off-by: Sam Day <me at samcday.com>

Thanks Sam! Really appreciate you fixing up this platform.

Reviewed-by: Caleb Connolly <caleb.connolly at linaro.org>

Would be nice to get Neil's confirmation for the RNG stuff since it's 
really not my forte. Then LGTM!

> ---
> Changes in v2:
> - split hunk changing clk_ens of existing clocks into separate patch
> - Link to v1: https://lore.kernel.org/r/20250127-msm-rng-fixes-v1-0-00f5d2284314@samcday.com
> 
> ---
> Sam Day (5):
>        clk/qcom: apq8016: use BIT macro for clk en_vals
>        clk/qcom: apq8016: add PRNG_AHB_CLK
>        rng: msm: don't enable PRNG if it's already enabled
>        clk/qcom: apq8016: improve clk_enable logging
>        rng: msm: keep core clock disabled when PRNG not in use
> 
>   drivers/clk/qcom/clock-apq8016.c |  9 +++++----
>   drivers/rng/msm_rng.c            | 13 +++++++++++--
>   2 files changed, 16 insertions(+), 6 deletions(-)
> ---
> base-commit: 636fcc96c3d7e2b00c843e6da78ed3e9e3bdf4de
> change-id: 20250126-msm-rng-fixes-f5a722a9492c
> 
> Best regards,

-- 
Caleb (they/them)



More information about the U-Boot mailing list