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: <adqu7gyhxe55cocimsgcbifilmyos2h3dc4tqbw4uxv4pmbdkj@ps4akoyq6v76>
Date: Sun, 2 Nov 2025 22:23:01 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Ilia Lin <ilia.lin@...nel.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konradybcio@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        Raag Jadav <raag.jadav@...el.com>, linux-arm-msm@...r.kernel.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] cpufreq: qcom-nvmem: add compatible fallback for
 ipq806x for no SMEM

On Sat, Nov 01, 2025 at 12:50:09PM +0100, Christian Marangi wrote:
> On Fri, Oct 31, 2025 at 04:34:22PM +0200, Andy Shevchenko wrote:
> > On Fri, Oct 31, 2025 at 03:19:12PM +0100, Christian Marangi wrote:
> > > 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:
> > 
> > ...
> > 
> > > > > +		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.
> > 
> > Oh, this is unfortunate. Wouldn't it be possible to use some API that returns
> > an index (or an error if not found) of the compatible? I believe we have a such
> > for the regular 'compatible' properties.
> > 
> 
> Well also using something like checking for the virst compatible might
> be problematic as real device have something like "netgear,r7800",
> "qcom,ipq8065","qcom,ipq8064".
> 
> I will check if I can implement some alternative logic to have
> consistent order.

See drivers/soc/qcom/qcom_pd_mapper.c. You can use of_match_node() on
the root device.

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ