Re: [PATCH v2 3/3] cpufreq: qcom-nvmem: add compatible fallback for ipq806x for no SMEM

From: Christian Marangi

Date: Fri Oct 31 2025 - 10:19:17 EST


On Fri, Oct 31, 2025 at 03:26:46PM +0200, Andy Shevchenko wrote:
> On Fri, Oct 31, 2025 at 02:08:34PM +0100, Christian Marangi wrote:
> > On some IPQ806x SoC SMEM might be not initialized by SBL. This is the
> > case for some Google devices (the OnHub family) that can't make use of
> > SMEM to detect the SoC ID.
> >
> > To handle these specific case, check if the SMEM is not initialized (by
> > checking if the qcom_smem_get_soc_id returns -ENODEV) and fallback to
> > OF machine compatible checking to identify the SoC variant.
> >
> > Notice that the checking order is important as the machine compatible
> > are normally defined with the specific one following the generic SoC
> > (for example compatible = "qcom,ipq8065", "qcom,ipq8064").
>
> ...
>
> > + if (of_machine_is_compatible("qcom,ipq8062"))
> > + msm_id = QCOM_ID_IPQ8062;
> > + else if (of_machine_is_compatible("qcom,ipq8065") ||
> > + of_machine_is_compatible("qcom,ipq8069"))
> > + msm_id = QCOM_ID_IPQ8065;
> > + else if (of_machine_is_compatible("qcom,ipq8064") ||
> > + of_machine_is_compatible("qcom,ipq8066") ||
> > + of_machine_is_compatible("qcom,ipq8068"))
> > + msm_id = QCOM_ID_IPQ8064;
>
> A nit-pick (in case you need a new version of the series): I would expect
> the conditionals be sorted by assigned value.
>
> if (of_machine_is_compatible("qcom,ipq8062"))
> msm_id = QCOM_ID_IPQ8062;
> else if (of_machine_is_compatible("qcom,ipq8064") ||
> of_machine_is_compatible("qcom,ipq8066") ||
> of_machine_is_compatible("qcom,ipq8068"))
> msm_id = QCOM_ID_IPQ8064;
> else if (of_machine_is_compatible("qcom,ipq8065") ||
> of_machine_is_compatible("qcom,ipq8069"))
> msm_id = QCOM_ID_IPQ8065;
>

Hi as said in the commit, parsing 65/69 before 64 is needed as we might
have compatible like

"qcom,ipq8065","qcom,ipq8064" so we might incorrectly parse msm_id
ipq8064.

> --
> With Best Regards,
> Andy Shevchenko
>
>

--
Ansuel