Re: [PATCH] soc: qcom: smem: fix 32-bit overflow in DDR frequency calculation

From: Konrad Dybcio

Date: Fri Aug 28 2026 - 07:39:48 EST


On 8/27/26 10:13 AM, Gopikrishna Garmidi wrote:
> The DDR frequency in SMEM is reported in kHz and converted to Hz by
> multiplying it by 1000. Since the SMEM frequency value is a u32, using
> an unsuffixed integer constant causes the multiplication to be performed
> with 32-bit arithmetic.
>
> This overflows for DDR frequencies above 4294967 kHz, resulting in an
> incorrect frequency being reported through the SMEM DRAM interface.
>
> Use an unsigned long constant for the multiplication so the calculation
> is performed with 64-bit arithmetic on the supported Qualcomm platforms.
> Apply the fix consistently to the v3, v3.1, v4, v5, and v7 SMEM parsers.
>
> Fixes: 1d234eeafc56 ("soc: qcom: smem: Expose DDR data from SMEM")
> Signed-off-by: Gopikrishna Garmidi <gopikrishna.garmidi@xxxxxxxxxxxxxxxx>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad