[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <wuavhpbdx6onb6m7xxkztifyigcmhjevzs5ihjof75zksk7rui@4nixiuioyqeb>
Date: Tue, 26 Aug 2025 11:24:22 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>
Cc: Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>, Krzysztof Wilczyński <kwilczynski@...nel.org>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Bjorn Andersson <andersson@...nel.org>, Konrad Dybcio <konradybcio@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v4 7/7] PCI: qcom: Use frequency and level based OPP
lookup
On Wed, Aug 20, 2025 at 01:58:53PM GMT, Krishna Chaitanya Chundru wrote:
> PCIe supports multiple data rates that may operate at the same clock
> frequency by varying the link width. In such cases, frequency alone
> is insufficient to identify the correct OPP.
You need to reword the description. It mostly sounds like you want to select OPP
based on freq and link width instead of freq and data rate due to that fact that
you used 'link width' as the differentiating factor in the first sentence.
>Use the newly introduced
> dev_pm_opp_find_key_exact() API to match both frequency and
> level when selecting an OPP, here level indicates PCIe data rate.
>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 294babe1816e4d0c2b2343fe22d89af72afcd6cd..4f40fc7b828483419b87057c53e2f754811bdda0 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1555,6 +1555,7 @@ static void qcom_pcie_icc_opp_update(struct qcom_pcie *pcie)
> {
> u32 offset, status, width, speed;
> struct dw_pcie *pci = pcie->pci;
> + struct dev_pm_opp_key key;
> unsigned long freq_kbps;
> struct dev_pm_opp *opp;
> int ret, freq_mbps;
> @@ -1582,8 +1583,10 @@ static void qcom_pcie_icc_opp_update(struct qcom_pcie *pcie)
> return;
>
> freq_kbps = freq_mbps * KILO;
> - opp = dev_pm_opp_find_freq_exact(pci->dev, freq_kbps * width,
> - true);
> + key.freq = freq_kbps * width;
> + key.level = speed;
> + key.bw = 0;
> + opp = dev_pm_opp_find_key_exact(pci->dev, key, true);
As Neil said, this needs to work with older DTs too where there were no 'level'
properties.
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists