* [PATCH 0/4] PCI: qcom: Recalibrate the PHY on temperature drift
@ 2026-11-25 10:17 Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 1/4] thermal/of: Add thermal_zone_get_zone_by_node() API Manivannan Sadhasivam via B4 Relay
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2026-11-25 10:17 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Abel Vesa
Cc: linux-pm, linux-kernel, linux-arm-msm, linux-pci, devicetree,
Manivannan Sadhasivam
Problem Statement
=================
Some PCIe PHY instances on SoCs like Glymur benefit from periodic
recalibration to compensate for temperature-related drift and maintain
stable link operation. Otherwise there is a potential for a link drop.
The PHY gets calibrated when the link trains and it cannot recalibrate
itself while the link is up, so the recalibration has to be driven by
software.
Proposal
========
The PCIe controller driver triggers the recalibration with a PCIe link
speed switch once the temperature change on a polled sensor exceeds the
defined threshold. For this purpose, the driver needs to know which
sensors track the PHY temperature and the drift temperature. Both of them
vary per platform, so they come from DT.
Once a zone has drifted far enough, the driver performs the link speed
switching by scaling down the Target Link Speed to 2.5 GT/s and then
restoring the original Target Link Speed. This forces the link to run
Equalization again, which recalibrates the PHY against the current
temperature, thereby maintaining stable link operation. Equalization only
runs on a speed change to 8.0 GT/s or above.
Patch 1 adds a lookup from a DT node to its thermal zone, which the driver
needs for resolving the phandles it is handed. Patch 2 adds the new DT
binding property to specify the tuples of thermal zones and their drift
temperature. Patch 3 adds support for reading those zones on an interval
and recalibrating the PHY once one of them has drifted far enough.
Finally, patch 4 wires up the two Glymur PCIe controllers that use this,
pointing each one at the sensor that tracks the temperature of the PHY it
feeds.
Testing
=======
Tested on the Glymur CRD, on the two controllers patch 4 describes.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
Manivannan Sadhasivam (4):
thermal/of: Add thermal_zone_get_zone_by_node() API
dt-bindings: PCI: qcom,pcie-x1e80100: Add qcom,pcie-recalibration-thermal-zones
PCI: qcom: Recalibrate the PHY on temperature drift
arm64: dts: qcom: glymur: Describe the PCIe thermal inputs
.../bindings/pci/qcom,pcie-x1e80100.yaml | 31 +++
arch/arm64/boot/dts/qcom/glymur.dtsi | 4 +
drivers/pci/controller/dwc/pcie-qcom.c | 224 +++++++++++++++++++++
drivers/thermal/thermal_of.c | 21 ++
include/linux/thermal.h | 8 +
5 files changed, 288 insertions(+)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261013-glymur-thermal-fix-17fdc3a0a762
Best regards,
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] thermal/of: Add thermal_zone_get_zone_by_node() API
2026-11-25 10:17 [PATCH 0/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
@ 2026-11-25 10:17 ` Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 2/4] dt-bindings: PCI: qcom,pcie-x1e80100: Add qcom,pcie-recalibration-thermal-zones Manivannan Sadhasivam via B4 Relay
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2026-11-25 10:17 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Abel Vesa
Cc: linux-pm, linux-kernel, linux-arm-msm, linux-pci, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Add an API to allow the drivers to get a registered thermal zone from OF
node.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
drivers/thermal/thermal_of.c | 21 +++++++++++++++++++++
include/linux/thermal.h | 8 ++++++++
2 files changed, 29 insertions(+)
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 9e96fb1b033e..e38f67c19c8e 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -530,6 +530,27 @@ void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_dev
}
EXPORT_SYMBOL_GPL(devm_thermal_of_zone_unregister);
+/**
+ * thermal_zone_get_zone_by_node() - get a registered zone from its OF node
+ * @np: device tree node of the thermal zone
+ *
+ * Thermal zones described in the device tree are registered using the name
+ * of their device tree node, so resolve @np to its registered thermal zone
+ * by that name.
+ *
+ * Return: a valid thermal zone on success, an ERR_PTR otherwise (-EINVAL for
+ * an invalid argument, -ENODEV if no zone matches @np and -EEXIST if the name
+ * is not unique).
+ */
+struct thermal_zone_device *thermal_zone_get_zone_by_node(struct device_node *np)
+{
+ if (!np)
+ return ERR_PTR(-EINVAL);
+
+ return thermal_zone_get_zone_by_name(np->name);
+}
+EXPORT_SYMBOL_GPL(thermal_zone_get_zone_by_node);
+
/**
* thermal_of_cooling_device_register() - register an OF thermal cooling device
* @np: a pointer to a device tree node.
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 306ad17aed89..c5278d1ff0ef 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -216,6 +216,8 @@ devm_thermal_of_child_cooling_device_register(struct device *dev,
struct device_node *np,
const char *type, void *devdata,
const struct thermal_cooling_device_ops *ops);
+
+struct thermal_zone_device *thermal_zone_get_zone_by_node(struct device_node *np);
#else
static inline
@@ -254,6 +256,12 @@ devm_thermal_of_child_cooling_device_register(struct device *dev,
{
return ERR_PTR(-ENODEV);
}
+
+static inline struct thermal_zone_device *
+thermal_zone_get_zone_by_node(struct device_node *np)
+{
+ return ERR_PTR(-ENODEV);
+}
#endif
int for_each_thermal_trip(struct thermal_zone_device *tz,
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] dt-bindings: PCI: qcom,pcie-x1e80100: Add qcom,pcie-recalibration-thermal-zones
2026-11-25 10:17 [PATCH 0/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 1/4] thermal/of: Add thermal_zone_get_zone_by_node() API Manivannan Sadhasivam via B4 Relay
@ 2026-11-25 10:17 ` Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 3/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 4/4] arm64: dts: qcom: glymur: Describe the PCIe thermal inputs Manivannan Sadhasivam via B4 Relay
3 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2026-11-25 10:17 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Abel Vesa
Cc: linux-pm, linux-kernel, linux-arm-msm, linux-pci, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Some PCIe PHY instances on SoCs like Glymur benefit from periodic
recalibration to compensate for temperature-related drift and maintain
stable link operation. Otherwise there is a potential for a link drop. The
recalibration is performed by the hardware during a PCIe link speed
switch, which the driver initiates once the temperature change on a
polled sensor exceeds the defined threshold. For this purpose, the driver
needs to know which sensors track the PHY temperature and the drift
temperature.
So introduce a new property 'qcom,pcie-recalibration-thermal-zones' to
specify the tuples of thermal zone phandle and the drift temperature in
millidegree Celsius to be monitored by the driver, and allow it only for
Glymur, which is the only SoC needing it so far.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
.../bindings/pci/qcom,pcie-x1e80100.yaml | 31 ++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-x1e80100.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie-x1e80100.yaml
index 3d3b9f309a73..389a6bbacaa9 100644
--- a/Documentation/devicetree/bindings/pci/qcom,pcie-x1e80100.yaml
+++ b/Documentation/devicetree/bindings/pci/qcom,pcie-x1e80100.yaml
@@ -78,6 +78,26 @@ properties:
- const: pci # PCIe core reset
- const: link_down # PCIe link down reset
+ qcom,pcie-recalibration-thermal-zones:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ minItems: 1
+ maxItems: 16
+ items:
+ items:
+ - description:
+ Phandle to a thermal zone corresponding to the sensor used to
+ monitor the PHY temperature drift.
+ - description:
+ Temperature drift this zone is allowed to accumulate before the
+ PHY needs a fresh calibration, in millidegree Celsius.
+ minimum: 1000
+ maximum: 100000
+ description:
+ Thermal zones whose sensors track the PCIe PHY temperature, along with
+ the temperature drift each zone is allowed to accumulate before the PHY
+ needs a fresh calibration. Applies to PCIe instances that rely on
+ periodic PHY recalibration to maintain stable link operation.
+
required:
- power-domains
- resets
@@ -85,6 +105,17 @@ required:
allOf:
- $ref: qcom,pcie-common.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: qcom,glymur-pcie
+ then:
+ properties:
+ qcom,pcie-recalibration-thermal-zones: true
+ else:
+ properties:
+ qcom,pcie-recalibration-thermal-zones: false
unevaluatedProperties: false
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] PCI: qcom: Recalibrate the PHY on temperature drift
2026-11-25 10:17 [PATCH 0/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 1/4] thermal/of: Add thermal_zone_get_zone_by_node() API Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 2/4] dt-bindings: PCI: qcom,pcie-x1e80100: Add qcom,pcie-recalibration-thermal-zones Manivannan Sadhasivam via B4 Relay
@ 2026-11-25 10:17 ` Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 4/4] arm64: dts: qcom: glymur: Describe the PCIe thermal inputs Manivannan Sadhasivam via B4 Relay
3 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2026-11-25 10:17 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Abel Vesa
Cc: linux-pm, linux-kernel, linux-arm-msm, linux-pci, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Some PCIe PHY instances on SoCs like Glymur benefit from periodic
recalibration to compensate for temperature-related drift and maintain
stable link operation. Otherwise there is a potential for a link drop. The
recalibration is performed by the hardware during a PCIe link speed
switch, which the driver initiates once the temperature change on a
polled sensor exceeds the defined threshold. For this purpose, the driver
needs to know which sensors track the PHY temperature and the drift
temperature.
First, get the list of thermal zones and the drift temperature by parsing
the 'qcom,pcie-recalibration-thermal-zones' DT property. Then record the
current temperature of each zone, which is the reference the drift gets
measured against. Then schedule a delayed worker thread 'recalib_work' for
every 5s to monitor the temperature drift and initiate the recalibration if
the drift happens.
qcom_pcie_recalib_work() does the actual work of reading the sensor
temperatures and performing recalibration when required. The worker
compares every zone against the reference recorded for it, and if none of
them has drifted far enough, it skips the recalibration. Otherwise the
worker performs the link speed switching by scaling down the Target Link
Speed to 2.5 GT/s and then restoring the original Target Link Speed. This
forces the link to run Equalization again, which recalibrates the PHY
against the current temperature, thereby maintaining stable link
operation. Equalization only runs on a speed change to 8.0 GT/s or above.
Finally, the recalibration has to be stopped across system suspend as it
touches config space, which is not reachable once the interconnect paths
are powered down. So cancel the work in the noirq suspend callback and
rearm the recalib worker on resume.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
drivers/pci/controller/dwc/pcie-qcom.c | 224 +++++++++++++++++++++++++++++++++
1 file changed, 224 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index d903f10211c2..fb11718cea39 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -8,6 +8,7 @@
* Author: Stanimir Varbanov <svarbanov@mm-sol.com>
*/
+#include <linux/atomic.h>
#include <linux/clk.h>
#include <linux/crc8.h>
#include <linux/debugfs.h>
@@ -34,6 +35,7 @@
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
#include <linux/slab.h>
+#include <linux/thermal.h>
#include <linux/types.h>
#include <linux/units.h>
@@ -314,6 +316,18 @@ struct qcom_pcie_port {
struct list_head perst;
};
+/**
+ * struct qcom_pcie_recalib_zone - thermal zone used for recalibration
+ * @tz: thermal zone whose sensor tracks the PHY temperature
+ * @drift: drift this zone may accumulate before the PHY needs recalibrating
+ * @ref: temperature @tz reported after the last recalibration
+ */
+struct qcom_pcie_recalib_zone {
+ struct thermal_zone_device *tz;
+ int drift;
+ int ref;
+};
+
struct qcom_pcie {
struct dw_pcie *pci;
void __iomem *parf; /* DT parf */
@@ -328,6 +342,11 @@ struct qcom_pcie {
int global_irq;
bool use_pm_opp;
struct mutex reset_lock;
+
+ struct qcom_pcie_recalib_zone *recalib_zones;
+ unsigned int recalib_num_zones;
+ struct workqueue_struct *recalib_wq;
+ struct delayed_work recalib_work;
};
#define to_qcom_pcie(x) dev_get_drvdata((x)->dev)
@@ -1839,6 +1858,197 @@ static void qcom_pcie_icc_opp_update(struct qcom_pcie *pcie)
}
}
+static int qcom_pcie_recalib_update_ref_temp(struct qcom_pcie *pcie)
+{
+ unsigned int i;
+ int temp, ret;
+
+ for (i = 0; i < pcie->recalib_num_zones; i++) {
+ struct qcom_pcie_recalib_zone *zone = &pcie->recalib_zones[i];
+
+ ret = thermal_zone_get_temp(zone->tz, &temp);
+ if (ret)
+ return ret;
+
+ zone->ref = temp;
+ }
+
+ return 0;
+}
+
+#define QCOM_PCIE_RECALIB_INTERVAL_MS 5000
+
+static void qcom_pcie_recalib_arm_worker(struct qcom_pcie *pcie)
+{
+ if (!pcie->recalib_wq)
+ return;
+
+ queue_delayed_work(pcie->recalib_wq, &pcie->recalib_work,
+ msecs_to_jiffies(QCOM_PCIE_RECALIB_INTERVAL_MS));
+}
+
+static void qcom_pcie_recalib_work(struct work_struct *work)
+{
+ struct qcom_pcie *pcie = container_of(work, struct qcom_pcie,
+ recalib_work.work);
+ struct dw_pcie_rp *pp = &pcie->pci->pp;
+ struct device *dev = pcie->pci->dev;
+ struct pci_dev *port __free(pci_dev_put) = pci_get_slot(pp->bridge->bus, PCI_DEVFN(0, 0));
+ enum pci_bus_speed speed;
+ bool drifted = false;
+ unsigned int i;
+ u16 lnkctl2;
+ int temp, ret;
+
+ if (!port || !port->subordinate)
+ goto rearm;
+
+ scoped_guard(mutex, &pcie->reset_lock) {
+ for (i = 0; i < pcie->recalib_num_zones; i++) {
+ struct qcom_pcie_recalib_zone *zone = &pcie->recalib_zones[i];
+
+ ret = thermal_zone_get_temp(zone->tz, &temp);
+ if (ret) {
+ dev_err(dev, "Failed to read %s: %d\n",
+ thermal_zone_device_type(zone->tz), ret);
+ continue;
+ }
+
+ if (abs(temp - zone->ref) >= zone->drift)
+ drifted = true;
+ }
+
+ /* No zone has drifted far enough to need a recalibration */
+ if (!drifted)
+ break;
+
+ ret = pcie_capability_read_word(port, PCI_EXP_LNKCTL2, &lnkctl2);
+ if (ret != PCIBIOS_SUCCESSFUL)
+ break;
+
+ speed = PCIE_LNKCTL2_TLS2SPEED(lnkctl2);
+ if (!pcie_valid_speed(speed))
+ break;
+
+ /*
+ * Equalization only runs at 8.0 GT/s and above, so a slower
+ * link has nothing to recalibrate.
+ */
+ if (speed >= PCIE_SPEED_8_0GT) {
+ ret = pcie_set_target_speed(port, PCIE_SPEED_2_5GT, true);
+ if (ret)
+ dev_err(dev, "Failed to step down the link speed: %d\n", ret);
+
+ /*
+ * The device below may not be able to train to the
+ * original Target Link Speed, which is reported as
+ * -EAGAIN even though the speed was restored.
+ */
+ ret = pcie_set_target_speed(port, speed, true);
+ if (ret && ret != -EAGAIN)
+ dev_err(dev, "Failed to restore the link speed: %d\n", ret);
+ }
+
+ /*
+ * Update the reference temperature of every zone and not just
+ * of the one that drifted, so all of them measure their next
+ * drift from the same point in time.
+ */
+ ret = qcom_pcie_recalib_update_ref_temp(pcie);
+ if (ret)
+ dev_err(dev, "Failed to update the reference temperature: %d\n", ret);
+ }
+
+rearm:
+ qcom_pcie_recalib_arm_worker(pcie);
+}
+
+#define QCOM_PCIE_RECALIB_ZONE_CELLS 2
+
+static int qcom_pcie_recalib_get_zones(struct qcom_pcie *pcie)
+{
+ const char *prop = "qcom,pcie-recalibration-thermal-zones";
+ struct device *dev = pcie->pci->dev;
+ struct of_phandle_args args;
+ unsigned int i, num_zones;
+ int ret;
+
+ ret = of_count_phandle_with_args(dev->of_node, prop, NULL);
+ if (ret == -ENOENT)
+ return 0;
+ if (ret < 0)
+ return ret;
+
+ if (!IS_ENABLED(CONFIG_THERMAL_OF))
+ return dev_err_probe(dev, -ENODEV,
+ "%s requires CONFIG_THERMAL_OF\n", prop);
+
+ num_zones = ret / QCOM_PCIE_RECALIB_ZONE_CELLS;
+
+ pcie->recalib_zones = devm_kcalloc(dev, num_zones,
+ sizeof(*pcie->recalib_zones), GFP_KERNEL);
+ if (!pcie->recalib_zones)
+ return -ENOMEM;
+
+ for (i = 0; i < num_zones; i++) {
+ struct qcom_pcie_recalib_zone *zone = &pcie->recalib_zones[i];
+ struct thermal_zone_device *tz;
+
+ ret = of_parse_phandle_with_fixed_args(dev->of_node, prop,
+ QCOM_PCIE_RECALIB_ZONE_CELLS - 1,
+ i, &args);
+ if (ret)
+ return ret;
+
+ tz = thermal_zone_get_zone_by_node(args.np);
+ of_node_put(args.np);
+ if (IS_ERR(tz))
+ return PTR_ERR(tz) == -ENODEV ? -EPROBE_DEFER : PTR_ERR(tz);
+
+ zone->tz = tz;
+ zone->drift = args.args[0];
+ }
+
+ pcie->recalib_num_zones = num_zones;
+
+ return 0;
+}
+
+static void qcom_pcie_recalib_deinit(void *data)
+{
+ struct qcom_pcie *pcie = data;
+
+ cancel_delayed_work_sync(&pcie->recalib_work);
+ destroy_workqueue(pcie->recalib_wq);
+}
+
+static int qcom_pcie_recalib_init(struct qcom_pcie *pcie)
+{
+ struct device *dev = pcie->pci->dev;
+ int ret;
+
+ if (!pcie->recalib_num_zones)
+ return 0;
+
+ pcie->recalib_wq = alloc_workqueue("pcie-recalib/%s",
+ WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM,
+ 0, dev_name(dev));
+ if (!pcie->recalib_wq)
+ return -ENOMEM;
+
+ INIT_DELAYED_WORK(&pcie->recalib_work, qcom_pcie_recalib_work);
+
+ ret = qcom_pcie_recalib_update_ref_temp(pcie);
+ if (ret) {
+ destroy_workqueue(pcie->recalib_wq);
+ return dev_err_probe(dev, ret, "Failed to update the reference temperature\n");
+ }
+
+ qcom_pcie_recalib_arm_worker(pcie);
+
+ return devm_add_action_or_reset(dev, qcom_pcie_recalib_deinit, pcie);
+}
+
static int qcom_pcie_set_max_opp(struct device *dev)
{
unsigned long max_freq = ULONG_MAX;
@@ -2370,6 +2580,10 @@ static int qcom_pcie_probe(struct platform_device *pdev)
goto err_pm_runtime_put;
}
+ ret = qcom_pcie_recalib_get_zones(pcie);
+ if (ret)
+ goto err_pm_runtime_put;
+
ret = pcie->cfg->ops->get_resources(pcie);
if (ret)
goto err_pm_runtime_put;
@@ -2430,6 +2644,10 @@ static int qcom_pcie_probe(struct platform_device *pdev)
qcom_pcie_icc_opp_update(pcie);
+ ret = qcom_pcie_recalib_init(pcie);
+ if (ret)
+ goto err_host_deinit;
+
if (pcie->mhi)
qcom_pcie_init_debugfs(pcie);
@@ -2464,6 +2682,10 @@ static int qcom_pcie_suspend_noirq(struct device *dev)
if (!pcie)
return 0;
+ /* Recalibration touches config space, so it must not run past here */
+ if (pcie->recalib_wq)
+ cancel_delayed_work_sync(&pcie->recalib_work);
+
ret = dw_pcie_suspend_noirq(pcie->pci);
if (ret)
return ret;
@@ -2575,6 +2797,8 @@ static int qcom_pcie_resume_noirq(struct device *dev)
qcom_pcie_icc_opp_update(pcie);
+ qcom_pcie_recalib_arm_worker(pcie);
+
return 0;
disable_icc_mem:
icc_disable(pcie->icc_mem);
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] arm64: dts: qcom: glymur: Describe the PCIe thermal inputs
2026-11-25 10:17 [PATCH 0/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
` (2 preceding siblings ...)
2026-11-25 10:17 ` [PATCH 3/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
@ 2026-11-25 10:17 ` Manivannan Sadhasivam via B4 Relay
2026-11-25 10:33 ` Konrad Dybcio
3 siblings, 1 reply; 6+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2026-11-25 10:17 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Abel Vesa
Cc: linux-pm, linux-kernel, linux-arm-msm, linux-pci, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Some PCIe PHY instances on Glymur benefit from periodic recalibration to
compensate for temperature-related drift and maintain stable link
operation. The controller driver triggers the recalibration with a link
speed switch once the temperature change on a polled sensor exceeds the
defined threshold, but for that it needs to know which sensors track the
PHY temperature and the drift temperature.
So add a property to identify the relevant temperature sensors,
'qcom,pcie-recalibration-thermal-zones', to PCIe domain 5 pointing at the
aoss-6 zone and to PCIe domain 7 pointing at the nsphmx-0 zone, as those
are the zones whose sensors track the respective PHY temperature. Both
zones are allowed a drift temperature of 25 degC.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/glymur.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/glymur.dtsi b/arch/arm64/boot/dts/qcom/glymur.dtsi
index 65a398c0a992..6fb254abf81a 100644
--- a/arch/arm64/boot/dts/qcom/glymur.dtsi
+++ b/arch/arm64/boot/dts/qcom/glymur.dtsi
@@ -3127,6 +3127,8 @@ pcie5: pcie@1b40000 {
operating-points-v2 = <&pcie5_opp_table>;
+ qcom,pcie-recalibration-thermal-zones = <&thermal_aoss_6 25000>;
+
msi-map = <0x0 &gic_its 0xd0000 0x10000>;
iommu-map = <0x0 &pcie_smmu 0x50000 0x10000>;
@@ -3615,6 +3617,8 @@ pcie3b: pcie@1b80000 {
operating-points-v2 = <&pcie3b_opp_table>;
+ qcom,pcie-recalibration-thermal-zones = <&thermal_nsphmx_0 25000>;
+
msi-map = <0x0 &gic_its 0xf0000 0x10000>;
iommu-map = <0x0 &pcie_smmu 0x70000 0x10000>;
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 4/4] arm64: dts: qcom: glymur: Describe the PCIe thermal inputs
2026-11-25 10:17 ` [PATCH 4/4] arm64: dts: qcom: glymur: Describe the PCIe thermal inputs Manivannan Sadhasivam via B4 Relay
@ 2026-11-25 10:33 ` Konrad Dybcio
0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2026-11-25 10:33 UTC (permalink / raw)
To: manivannan.sadhasivam, Rafael J. Wysocki, Daniel Lezcano,
Zhang Rui, Lukasz Luba, Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Abel Vesa
Cc: linux-pm, linux-kernel, linux-arm-msm, linux-pci, devicetree
On 11/25/26 11:17 AM, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
>
> Some PCIe PHY instances on Glymur benefit from periodic recalibration to
> compensate for temperature-related drift and maintain stable link
> operation. The controller driver triggers the recalibration with a link
> speed switch once the temperature change on a polled sensor exceeds the
> defined threshold, but for that it needs to know which sensors track the
> PHY temperature and the drift temperature.
>
> So add a property to identify the relevant temperature sensors,
> 'qcom,pcie-recalibration-thermal-zones', to PCIe domain 5 pointing at the
> aoss-6 zone and to PCIe domain 7 pointing at the nsphmx-0 zone, as those
> are the zones whose sensors track the respective PHY temperature. Both
> zones are allowed a drift temperature of 25 degC.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-25 10:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 10:17 [PATCH 0/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 1/4] thermal/of: Add thermal_zone_get_zone_by_node() API Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 2/4] dt-bindings: PCI: qcom,pcie-x1e80100: Add qcom,pcie-recalibration-thermal-zones Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 3/4] PCI: qcom: Recalibrate the PHY on temperature drift Manivannan Sadhasivam via B4 Relay
2026-11-25 10:17 ` [PATCH 4/4] arm64: dts: qcom: glymur: Describe the PCIe thermal inputs Manivannan Sadhasivam via B4 Relay
2026-11-25 10:33 ` Konrad Dybcio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®