Skip to contentSkip to conversation

arm64: dts: qcom: sc8280xp: PCIe fixes and GICv3 ITS enable

PATCH Superseded Johan Hovold 4 participants 20 messages Mar 5, 2024 – Mar 6, 2024

Subsystems (7)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover arm64: dts: qcom: sc8280xp: PCIe fixes and GICv3 ITS enable

This series addresses a few problems with the sc8280xp PCIe implementation.

The DWC PCIe controller can either use its internal MSI controller or an external one such as the GICv3 ITS. Enabling the latter allows for assigning affinity to individual interrupts, but results in a large amount of Correctable Errors being logged on both the Lenovo ThinkPad X13s and the sc8280xp-crd reference design.

It turns out that these errors are always generated, but for some yet to be determined reason, the AER interrupts are never received when using the internal MSI controller, which makes the link errors harder to notice.

On the X13s, there is a large number of errors generated when bringing up the link on boot. This is related to the fact that UEFI firmware has already enabled the Wi-Fi PCIe link at Gen2 speed and restarting the link at Gen3 generates a massive amount of errors until the Wi-Fi firmware is restarted. This has now also been shown to cause the Wi-Fi to sometimes not start at all on boot for some users.

A recent commit enabling ASPM on certain Qualcomm platforms introduced further errors when using the Wi-Fi on the X13s as well as when accessing the NVMe on the CRD. The exact reason for this has not yet been identified, but disabling ASPM L0s makes the errors go away. This could suggest that either the current ASPM implementation is incomplete or that L0s is not supported with these devices.

Note that the X13s and CRD use the same Wi-Fi controller, but the errors are only generated on the X13s. The NVMe controller on my X13s does not support L0s so there are no issues there, unlike on the CRD which uses a different controller. The modem on the CRD does not generate any errors, but both the NVMe and modem keeps bouncing in and out of L0s/L1 also when not used, which could indicate that there are bigger problems with the ASPM implementation. I don't have a modem on my X13s so I have not been able to test whether L0s causes any trouble there.

Enabling AER error reporting on sc8280xp could similarly also reveal existing problems with the related sa8295p and sa8540p platforms as they share the base dtsi.

After discussing this with Bjorn Andersson at Qualcomm we have decided to go ahead and disable L0s for all controllers on the CRD and the X13s.

Note that disabling ASPM L0s for the X13s Wi-Fi does not seem to have a significant impact on the power consumption (and there are indications that this applies generally for L0s on these platforms).

***

As we are now at 6.8-rc7, I've rebased this series on the Qualcomm PCIe binding rework in linux-next so that the whole series can be merged for 6.9 (the 'aspm-no-l0s' support and devicetree fixes are all marked for stable backport anyway).

The DT bindings and PCI patch are expected to go through the PCI tree, while Bjorn A takes the devicetree updates through the Qualcomm tree.

Johan

Changes in v3
- drop the two wifi link speed patches which have been picked up for
6.8
- rebase on binding rework in linux-next and add the properties also to
the new qcom,pcie-common.yaml
- https://lore.kernel.org/linux-pci/[email protected]/
- fix an 'L0s' typo in one commit message

Changes in v2
- drop RFC from ASPM patches and add stable tags
- reorder patches and move ITS patch last
- fix s/GB/MB/ typo in Gen2 speed commit messages
- fix an incorrect Fixes tag
- amend commit message X13 wifi link speed patch after user confirmation that this fixes the wifi startup issue
- disable L0s also for modem and wifi on CRD
- disable L0s also for nvme and modem on X13s

Johan Hovold (10):
dt-bindings: PCI: qcom: Allow 'required-opps'
dt-bindings: PCI: qcom: Do not require 'msi-map-mask'
dt-bindings: PCI: qcom: Allow 'aspm-no-l0s'
PCI: qcom: Add support for disabling ASPM L0s in devicetree
arm64: dts: qcom: sc8280xp: add missing PCIe minimum OPP
arm64: dts: qcom: sc8280xp-crd: disable ASPM L0s for NVMe
arm64: dts: qcom: sc8280xp-crd: disable ASPM L0s for modem and Wi-Fi
arm64: dts: qcom: sc8280xp-x13s: disable ASPM L0s for Wi-Fi
arm64: dts: qcom: sc8280xp-x13s: disable ASPM L0s for NVMe and modem
arm64: dts: qcom: sc8280xp: enable GICv3 ITS for PCIe

 .../bindings/pci/qcom,pcie-common.yaml        |  6 +++++-
 .../devicetree/bindings/pci/qcom,pcie.yaml    |  6 +++++-
 arch/arm64/boot/dts/qcom/sc8280xp-crd.dts     |  5 +++++
 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    |  5 +++++
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi        | 17 +++++++++++++++-
 drivers/pci/controller/dwc/pcie-qcom.c        | 20 +++++++++++++++++++
 6 files changed, 56 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/10 dt-bindings: PCI: qcom: Allow 'required-opps'

Some Qualcomm SoCs require a minimum performance level for the power domain so add 'required-opps' to the binding.

---
 Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml | 3 +++
 Documentation/devicetree/bindings/pci/qcom,pcie.yaml        | 3 +++
 2 files changed, 6 insertions(+)
Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml +3 -0
index 125136176f93..8d570669650a 100644
@@ -59,6 +59,9 @@ properties:
   power-domains:
     maxItems: 1
 
+  required-opps:
+    maxItems: 1
+
   resets:
     minItems: 1
     maxItems: 12
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +3 -0
index c8f36978a94c..1d7a6a520fef 100644
@@ -111,6 +111,9 @@ properties:
     description: GPIO controlled connection to PERST# signal
     maxItems: 1
 
+  required-opps:
+    maxItems: 1
+
   wake-gpios:
     description: GPIO controlled connection to WAKE# signal
     maxItems: 1
Signature · 1 line
2.43.0
#2 lore raw

PATCH v3 2/10 dt-bindings: PCI: qcom: Do not require 'msi-map-mask'

In reply to Johan Hovold

Whether the 'msi-map-mask' property is needed or not depends on how the MSI interrupts are mapped and it should therefore not be described as required.

Note that the current schema fails to detect omissions of the mask property if the internal MSI controller properties are also present.

---
 Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml | 1 -
 Documentation/devicetree/bindings/pci/qcom,pcie.yaml        | 1 -
 2 files changed, 2 deletions(-)
Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml +0 -1
index 8d570669650a..0d1b23523f62 100644
@@ -93,7 +93,6 @@ anyOf:
       - "#interrupt-cells"
   - required:
       - msi-map
-      - msi-map-mask
 
 allOf:
   - $ref: /schemas/pci/pci-bus.yaml#
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +0 -1
index 1d7a6a520fef..efaab5f82b47 100644
@@ -134,7 +134,6 @@ anyOf:
       - "#interrupt-cells"
   - required:
       - msi-map
-      - msi-map-mask
 
 allOf:
   - $ref: /schemas/pci/pci-bus.yaml#
Signature · 1 line
2.43.0
#3 lore raw

PATCH v3 3/10 dt-bindings: PCI: qcom: Allow 'aspm-no-l0s'

In reply to Johan Hovold

Add 'aspm-no-l0s', which can be used to indicate that ASPM L0s is not supported, to the binding.

---
 Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml | 2 ++
 Documentation/devicetree/bindings/pci/qcom,pcie.yaml        | 2 ++
 2 files changed, 4 insertions(+)
Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml +2 -0
index 0d1b23523f62..40ac5ba81233 100644
@@ -78,6 +78,8 @@ properties:
     description: GPIO controlled connection to WAKE# signal
     maxItems: 1
 
+  aspm-no-l0s: true
+
 required:
   - reg
   - reg-names
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +2 -0
index efaab5f82b47..a23d2cfb86c4 100644
@@ -118,6 +118,8 @@ properties:
     description: GPIO controlled connection to WAKE# signal
     maxItems: 1
 
+  aspm-no-l0s: true
+
 required:
   - compatible
   - reg
Signature · 1 line
2.43.0
#4 lore raw

PATCH v3 4/10 PCI: qcom: Add support for disabling ASPM L0s in devicetree

In reply to Johan Hovold

Commit 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops") started enabling ASPM unconditionally when the hardware claims to support it. This triggers Correctable Errors for some PCIe devices on machines like the Lenovo ThinkPad X13s, which could indicate an incomplete driver ASPM implementation or that the hardware does in fact not support L0s.

Add support for disabling ASPM L0s in the devicetree when it is not supported on a particular machine and controller.

Note that only the 1.9.0 ops enable ASPM currently.

Fixes 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops")
---
 drivers/pci/controller/dwc/pcie-qcom.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/pci/controller/dwc/pcie-qcom.c +20 -0
index 09d485df34b9..0fb5dc06d2ef 100644
@@ -273,6 +273,25 @@ static int qcom_pcie_start_link(struct dw_pcie *pci)
 	return 0;
 }
 
+static void qcom_pcie_clear_aspm_l0s(struct dw_pcie *pci)
+{
+	u16 offset;
+	u32 val;
+
+	if (!of_property_read_bool(pci->dev->of_node, "aspm-no-l0s"))
+		return;
+
+	offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
+
+	dw_pcie_dbi_ro_wr_en(pci);
+
+	val = readl(pci->dbi_base + offset + PCI_EXP_LNKCAP);
+	val &= ~PCI_EXP_LNKCAP_ASPM_L0S;
+	writel(val, pci->dbi_base + offset + PCI_EXP_LNKCAP);
+
+	dw_pcie_dbi_ro_wr_dis(pci);
+}
+
 static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
 {
 	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
@@ -962,6 +981,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 
 static int qcom_pcie_post_init_2_7_0(struct qcom_pcie *pcie)
 {
+	qcom_pcie_clear_aspm_l0s(pcie->pci);
 	qcom_pcie_clear_hpc(pcie->pci);
 
 	return 0;
Signature · 1 line
2.43.0
#5 lore raw

PATCH v3 5/10 arm64: dts: qcom: sc8280xp: add missing PCIe minimum OPP

In reply to Johan Hovold

Add the missing PCIe CX performance level votes to avoid relying on other drivers (e.g. USB or UFS) to maintain the nominal performance level required for Gen3 speeds.

Fixes 813e83157001 ("arm64: dts: qcom: sc8280xp/sa8540p: add PCIe2-4 nodes")
---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +5 -0
index c8e84c53935c..424d143ee26a 100644
@@ -1780,6 +1780,7 @@ pcie4: pcie@1c00000 {
 			reset-names = "pci";
 
 			power-domains = <&gcc PCIE_4_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
 
 			phys = <&pcie4_phy>;
 			phy-names = "pciephy";
@@ -1878,6 +1879,7 @@ pcie3b: pcie@1c08000 {
 			reset-names = "pci";
 
 			power-domains = <&gcc PCIE_3B_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
 
 			phys = <&pcie3b_phy>;
 			phy-names = "pciephy";
@@ -1976,6 +1978,7 @@ pcie3a: pcie@1c10000 {
 			reset-names = "pci";
 
 			power-domains = <&gcc PCIE_3A_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
 
 			phys = <&pcie3a_phy>;
 			phy-names = "pciephy";
@@ -2077,6 +2080,7 @@ pcie2b: pcie@1c18000 {
 			reset-names = "pci";
 
 			power-domains = <&gcc PCIE_2B_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
 
 			phys = <&pcie2b_phy>;
 			phy-names = "pciephy";
@@ -2175,6 +2179,7 @@ pcie2a: pcie@1c20000 {
 			reset-names = "pci";
 
 			power-domains = <&gcc PCIE_2A_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
 
 			phys = <&pcie2a_phy>;
 			phy-names = "pciephy";
Signature · 1 line
2.43.0
#6 lore raw

PATCH v3 6/10 arm64: dts: qcom: sc8280xp-crd: disable ASPM L0s for NVMe

In reply to Johan Hovold

Enabling ASPM L0s on the CRD results in a large amount of Correctable Errors (Timeout) when accessing the NVMe controller so disable it for now.

Fixes 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops")
---
 arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +2 -0
index 41215567b3ae..7e94a68d5d9f 100644
@@ -525,6 +525,8 @@ keyboard@68 {
 };
 
 &pcie2a {
+	aspm-no-l0s;
+
 	perst-gpios = <&tlmm 143 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
 
Signature · 1 line
2.43.0
#7 lore raw

PATCH v3 7/10 arm64: dts: qcom: sc8280xp-crd: disable ASPM L0s for modem and Wi-Fi

In reply to Johan Hovold

There are indications that ASPM L0s is not working very well on this machine so disable it also for the modem and Wi-Fi controllers for now.

This specifically avoids having the modem and Wi-Fi controllers bounce in an out of L0s when not used (the modem still bounces in and out of L1) as well as intermittent Correctable errors on the Wi-Fi link when not used.

Fixes 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops")
---
 arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +3 -0
index 7e94a68d5d9f..8fc0380f65a0 100644
@@ -546,6 +546,8 @@ &pcie2a_phy {
 };
 
 &pcie3a {
+	aspm-no-l0s;
+
 	perst-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
 
@@ -566,6 +568,7 @@ &pcie3a_phy {
 
 &pcie4 {
 	max-link-speed = <2>;
+	aspm-no-l0s;
 
 	perst-gpios = <&tlmm 141 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 139 GPIO_ACTIVE_LOW>;
Signature · 1 line
2.43.0
#8 lore raw

PATCH v3 8/10 arm64: dts: qcom: sc8280xp-x13s: disable ASPM L0s for Wi-Fi

In reply to Johan Hovold

Enabling ASPM L0s on the Lenovo Thinkpad X13s results in Correctable Errors (BadTLP, Timeout) when accessing the Wi-Fi controller so disable it for now.

Fixes 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops")
---
 arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +1 -0
index eb8a16aa233e..9567b82db9a5 100644
@@ -734,6 +734,7 @@ &pcie3a_phy {
 
 &pcie4 {
 	max-link-speed = <2>;
+	aspm-no-l0s;
 
 	perst-gpios = <&tlmm 141 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 139 GPIO_ACTIVE_LOW>;
Signature · 1 line
2.43.0
#9 lore raw

PATCH v3 9/10 arm64: dts: qcom: sc8280xp-x13s: disable ASPM L0s for NVMe and modem

In reply to Johan Hovold

There are indications that ASPM L0s is not working very well on this machine so disable it also for the NVMe and modem controllers for now.

Note that this is done as a precaution based on problems with the Wi-Fi on the X13s as well as the NVMe, modem and Wi-Fi on the sc8280xp-crd reference design (the NVMe controller on my X13s does not support L0s and the machine lacks a modem).

Fixes 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops")
---
 arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +4 -0
index 9567b82db9a5..057e4d9d3c0f 100644
@@ -695,6 +695,8 @@ keyboard@68 {
 };
 
 &pcie2a {
+	aspm-no-l0s;
+
 	perst-gpios = <&tlmm 143 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
 
@@ -714,6 +716,8 @@ &pcie2a_phy {
 };
 
 &pcie3a {
+	aspm-no-l0s;
+
 	perst-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
 
Signature · 1 line
2.43.0
#10 lore raw

PATCH v3 10/10 arm64: dts: qcom: sc8280xp: enable GICv3 ITS for PCIe

In reply to Johan Hovold

The DWC PCIe controller can be used with its internal MSI controller or with an external one such as the GICv3 Interrupt Translation Service (ITS).

Add the msi-map properties needed to use the GIC ITS. This will also make Linux switch to the ITS implementation, which allows for assigning affinity to individual MSIs.

Note that using the GIC ITS on SC8280XP will cause Advanced Error Reporting (AER) interrupts to be received on errors unlike when using the internal MSI controller. This will specifically lead to notifications about Correctable Errors being logged for the Wi-Fi controller on the Lenovo ThinkPad X13s when ASPM L0s is enabled.

---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +11 -1
index 424d143ee26a..4708ba28c4d5 100644
@@ -1737,6 +1737,8 @@ pcie4: pcie@1c00000 {
 			linux,pci-domain = <6>;
 			num-lanes = <1>;
 
+			msi-map = <0x0 &its 0xe0000 0x10000>;
+
 			interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>,
@@ -1838,6 +1840,8 @@ pcie3b: pcie@1c08000 {
 			linux,pci-domain = <5>;
 			num-lanes = <2>;
 
+			msi-map = <0x0 &its 0xd0000 0x10000>;
+
 			interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
@@ -1937,6 +1941,8 @@ pcie3a: pcie@1c10000 {
 			linux,pci-domain = <4>;
 			num-lanes = <4>;
 
+			msi-map = <0x0 &its 0xc0000 0x10000>;
+
 			interrupts = <GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH>,
@@ -2039,6 +2045,8 @@ pcie2b: pcie@1c18000 {
 			linux,pci-domain = <3>;
 			num-lanes = <2>;
 
+			msi-map = <0x0 &its 0xb0000 0x10000>;
+
 			interrupts = <GIC_SPI 306 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH>,
@@ -2138,6 +2146,8 @@ pcie2a: pcie@1c20000 {
 			linux,pci-domain = <2>;
 			num-lanes = <4>;
 
+			msi-map = <0x0 &its 0xa0000 0x10000>;
+
 			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 523 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 524 IRQ_TYPE_LEVEL_HIGH>,
@@ -4342,7 +4352,7 @@ intc: interrupt-controller@17a00000 {
 			#size-cells = <2>;
 			ranges;
 
-			msi-controller@17a40000 {
+			its: msi-controller@17a40000 {
 				compatible = "arm,gic-v3-its";
 				reg = <0 0x17a40000 0 0x20000>;
 				msi-controller;
Signature · 1 line
2.43.0
#11 lore raw
In reply to Johan Hovold
Quoted 37 lines · Johan Hovold

This series addresses a few problems with the sc8280xp PCIe implementation.

The DWC PCIe controller can either use its internal MSI controller or an external one such as the GICv3 ITS. Enabling the latter allows for assigning affinity to individual interrupts, but results in a large amount of Correctable Errors being logged on both the Lenovo ThinkPad X13s and the sc8280xp-crd reference design.

It turns out that these errors are always generated, but for some yet to be determined reason, the AER interrupts are never received when using the internal MSI controller, which makes the link errors harder to notice.

On the X13s, there is a large number of errors generated when bringing up the link on boot. This is related to the fact that UEFI firmware has already enabled the Wi-Fi PCIe link at Gen2 speed and restarting the link at Gen3 generates a massive amount of errors until the Wi-Fi firmware is restarted. This has now also been shown to cause the Wi-Fi to sometimes not start at all on boot for some users.

A recent commit enabling ASPM on certain Qualcomm platforms introduced further errors when using the Wi-Fi on the X13s as well as when accessing the NVMe on the CRD. The exact reason for this has not yet been identified, but disabling ASPM L0s makes the errors go away. This could suggest that either the current ASPM implementation is incomplete or that L0s is not supported with these devices.

Note that the X13s and CRD use the same Wi-Fi controller, but the errors are only generated on the X13s. The NVMe controller on my X13s does not support L0s so there are no issues there, unlike on the CRD which uses a different controller. The modem on the CRD does not generate any errors, but both the NVMe and modem keeps bouncing in and out of L0s/L1 also when not used, which could indicate that there are bigger problems with the ASPM implementation. I don't have a modem on my X13s so I have not been able to test whether L0s causes any trouble there.

Quoted 8 lines

Enabling AER error reporting on sc8280xp could similarly also reveal existing problems with the related sa8295p and sa8540p platforms as they share the base dtsi.

After discussing this with Bjorn Andersson at Qualcomm we have decided to go ahead and disable L0s for all controllers on the CRD and the X13s.

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

- Mani

Quoted 59 lines

Note that disabling ASPM L0s for the X13s Wi-Fi does not seem to have a significant impact on the power consumption (and there are indications that this applies generally for L0s on these platforms).

***

As we are now at 6.8-rc7, I've rebased this series on the Qualcomm PCIe binding rework in linux-next so that the whole series can be merged for 6.9 (the 'aspm-no-l0s' support and devicetree fixes are all marked for stable backport anyway).

The DT bindings and PCI patch are expected to go through the PCI tree, while Bjorn A takes the devicetree updates through the Qualcomm tree.

Johan

Changes in v3
- drop the two wifi link speed patches which have been picked up for
6.8
- rebase on binding rework in linux-next and add the properties also to
the new qcom,pcie-common.yaml
- https://lore.kernel.org/linux-pci/[email protected]/
- fix an 'L0s' typo in one commit message

Changes in v2
- drop RFC from ASPM patches and add stable tags
- reorder patches and move ITS patch last
- fix s/GB/MB/ typo in Gen2 speed commit messages
- fix an incorrect Fixes tag
- amend commit message X13 wifi link speed patch after user confirmation that this fixes the wifi startup issue
- disable L0s also for modem and wifi on CRD
- disable L0s also for nvme and modem on X13s

Johan Hovold (10):
dt-bindings: PCI: qcom: Allow 'required-opps'
dt-bindings: PCI: qcom: Do not require 'msi-map-mask'
dt-bindings: PCI: qcom: Allow 'aspm-no-l0s'
PCI: qcom: Add support for disabling ASPM L0s in devicetree
arm64: dts: qcom: sc8280xp: add missing PCIe minimum OPP
arm64: dts: qcom: sc8280xp-crd: disable ASPM L0s for NVMe
arm64: dts: qcom: sc8280xp-crd: disable ASPM L0s for modem and Wi-Fi
arm64: dts: qcom: sc8280xp-x13s: disable ASPM L0s for Wi-Fi
arm64: dts: qcom: sc8280xp-x13s: disable ASPM L0s for NVMe and modem
arm64: dts: qcom: sc8280xp: enable GICv3 ITS for PCIe

 .../bindings/pci/qcom,pcie-common.yaml        |  6 +++++-
 .../devicetree/bindings/pci/qcom,pcie.yaml    |  6 +++++-
 arch/arm64/boot/dts/qcom/sc8280xp-crd.dts     |  5 +++++
 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    |  5 +++++
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi        | 17 +++++++++++++++-
 drivers/pci/controller/dwc/pcie-qcom.c        | 20 +++++++++++++++++++
 6 files changed, 56 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#12 lore raw
Quoted 19 lines · Manivannan Sadhasivam
Quoted 18 lines · Johan Hovold

This series addresses a few problems with the sc8280xp PCIe implementation.

The DWC PCIe controller can either use its internal MSI controller or an external one such as the GICv3 ITS. Enabling the latter allows for assigning affinity to individual interrupts, but results in a large amount of Correctable Errors being logged on both the Lenovo ThinkPad X13s and the sc8280xp-crd reference design.

It turns out that these errors are always generated, but for some yet to be determined reason, the AER interrupts are never received when using the internal MSI controller, which makes the link errors harder to notice.

Enabling AER error reporting on sc8280xp could similarly also reveal existing problems with the related sa8295p and sa8540p platforms as they share the base dtsi.

Quoted 7 lines
Quoted 3 lines

After discussing this with Bjorn Andersson at Qualcomm we have decided to go ahead and disable L0s for all controllers on the CRD and the X13s.

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Quoted 4 lines
Quoted 4 lines

As we are now at 6.8-rc7, I've rebased this series on the Qualcomm PCIe binding rework in linux-next so that the whole series can be merged for 6.9 (the 'aspm-no-l0s' support and devicetree fixes are all marked for stable backport anyway).

I'll respin the series. Looks like we've already missed the chance to enable ITS in 6.9 anyway.

Johan

#13 lore raw
Quoted 24 lines · Johan Hovold
Quoted 22 lines · Manivannan Sadhasivam
Quoted 21 lines · Johan Hovold

This series addresses a few problems with the sc8280xp PCIe implementation.

The DWC PCIe controller can either use its internal MSI controller or an external one such as the GICv3 ITS. Enabling the latter allows for assigning affinity to individual interrupts, but results in a large amount of Correctable Errors being logged on both the Lenovo ThinkPad X13s and the sc8280xp-crd reference design.

It turns out that these errors are always generated, but for some yet to be determined reason, the AER interrupts are never received when using the internal MSI controller, which makes the link errors harder to notice.

Enabling AER error reporting on sc8280xp could similarly also reveal existing problems with the related sa8295p and sa8540p platforms as they share the base dtsi.

After discussing this with Bjorn Andersson at Qualcomm we have decided to go ahead and disable L0s for all controllers on the CRD and the X13s.

Quoted 8 lines
Quoted 3 lines

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Hmm. I checked further and got the info that there is no change in the IP, but the PHY sequence is not tuned correctly for L0s (as I suspected earlier). So there will be AERs when L0s is enabled on any controller instance. And there will be no updated PHY sequence in the future also for this chipset.

So yeah, let's disable it in the driver instead.

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

As we are now at 6.8-rc7, I've rebased this series on the Qualcomm PCIe binding rework in linux-next so that the whole series can be merged for 6.9 (the 'aspm-no-l0s' support and devicetree fixes are all marked for stable backport anyway).

I'll respin the series. Looks like we've already missed the chance to enable ITS in 6.9 anyway.

Sounds good, thanks!

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#14 lore raw
Quoted 35 lines · Manivannan Sadhasivam
Quoted 24 lines · Johan Hovold
Quoted 22 lines · Manivannan Sadhasivam
Quoted 21 lines · Johan Hovold

This series addresses a few problems with the sc8280xp PCIe implementation.

The DWC PCIe controller can either use its internal MSI controller or an external one such as the GICv3 ITS. Enabling the latter allows for assigning affinity to individual interrupts, but results in a large amount of Correctable Errors being logged on both the Lenovo ThinkPad X13s and the sc8280xp-crd reference design.

It turns out that these errors are always generated, but for some yet to be determined reason, the AER interrupts are never received when using the internal MSI controller, which makes the link errors harder to notice.

Enabling AER error reporting on sc8280xp could similarly also reveal existing problems with the related sa8295p and sa8540p platforms as they share the base dtsi.

After discussing this with Bjorn Andersson at Qualcomm we have decided to go ahead and disable L0s for all controllers on the CRD and the X13s.

Quoted 8 lines
Quoted 3 lines

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Quoted 4 lines

Hmm. I checked further and got the info that there is no change in the IP, but the PHY sequence is not tuned correctly for L0s (as I suspected earlier). So there will be AERs when L0s is enabled on any controller instance. And there will be no updated PHY sequence in the future also for this chipset.

Why? If it is a bug in the PHY driver, it should be fixed there instead of adding workarounds.

Quoted 19 lines

So yeah, let's disable it in the driver instead.

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

As we are now at 6.8-rc7, I've rebased this series on the Qualcomm PCIe binding rework in linux-next so that the whole series can be merged for 6.9 (the 'aspm-no-l0s' support and devicetree fixes are all marked for stable backport anyway).

I'll respin the series. Looks like we've already missed the chance to enable ITS in 6.9 anyway.

Sounds good, thanks!

- Mani

--
மணிவண்ணன் சதாசிவம்

Signature · 2 lines
With best wishes
Dmitry
#15 lore raw
Quoted 13 lines · Dmitry Baryshkov
Quoted 10 lines · Manivannan Sadhasivam
Quoted 9 lines · Johan Hovold
Quoted 3 lines · Manivannan Sadhasivam

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Quoted 7 lines
Quoted 4 lines

Hmm. I checked further and got the info that there is no change in the IP, but the PHY sequence is not tuned correctly for L0s (as I suspected earlier). So there will be AERs when L0s is enabled on any controller instance. And there will be no updated PHY sequence in the future also for this chipset.

Why? If it is a bug in the PHY driver, it should be fixed there instead of adding workarounds.

ASPM L0s is currently broken on these platforms and, as far as I understand, both under Windows and Linux. Since Qualcomm hasn't been able to come up with the necessary PHY init sequences for these platforms yet, I doubt they will suddenly appear in the near future.

So we need to disable L0s for now. If an updated PHY init sequence later appears, we can always enable it again.

Quoted 1 line
Quoted 1 line

So yeah, let's disable it in the driver instead.

Johan

#16 lore raw
Quoted 20 lines · Johan Hovold
Quoted 18 lines · Dmitry Baryshkov
Quoted 15 lines · Manivannan Sadhasivam
Quoted 9 lines · Johan Hovold
Quoted 3 lines · Manivannan Sadhasivam

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Hmm. I checked further and got the info that there is no change in the IP, but the PHY sequence is not tuned correctly for L0s (as I suspected earlier). So there will be AERs when L0s is enabled on any controller instance. And there will be no updated PHY sequence in the future also for this chipset.

Quoted 7 lines
Quoted 2 lines

Why? If it is a bug in the PHY driver, it should be fixed there instead of adding workarounds.

ASPM L0s is currently broken on these platforms and, as far as I understand, both under Windows and Linux. Since Qualcomm hasn't been able to come up with the necessary PHY init sequences for these platforms yet, I doubt they will suddenly appear in the near future.

I see. Ok, I retract my comment.

Quoted 7 lines

So we need to disable L0s for now. If an updated PHY init sequence later appears, we can always enable it again.

Quoted 1 line
Quoted 1 line

So yeah, let's disable it in the driver instead.

Johan

Signature · 2 lines
With best wishes
Dmitry
#17 lore raw
In reply to Johan Hovold
Quoted 22 lines · Johan Hovold
Quoted 13 lines · Dmitry Baryshkov
Quoted 10 lines · Manivannan Sadhasivam
Quoted 9 lines · Johan Hovold
Quoted 3 lines · Manivannan Sadhasivam

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Quoted 7 lines
Quoted 4 lines

Hmm. I checked further and got the info that there is no change in the IP, but the PHY sequence is not tuned correctly for L0s (as I suspected earlier). So there will be AERs when L0s is enabled on any controller instance. And there will be no updated PHY sequence in the future also for this chipset.

Why? If it is a bug in the PHY driver, it should be fixed there instead of adding workarounds.

Quoted 8 lines

ASPM L0s is currently broken on these platforms and, as far as I understand, both under Windows and Linux. Since Qualcomm hasn't been able to come up with the necessary PHY init sequences for these platforms yet, I doubt they will suddenly appear in the near future.

So we need to disable L0s for now. If an updated PHY init sequence later appears, we can always enable it again.

It could be the same case for all 'non-mobile' chipsets (automotive, compute, modem). So instead of using the compatible, please add a flag and set that for all non-mobile SoCs. Like the ones starting with SAxxx, SCxxx, SDxxx.

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#18 lore raw
Quoted 23 lines · Manivannan Sadhasivam
Quoted 22 lines · Johan Hovold
Quoted 8 lines · Dmitry Baryshkov
Quoted 5 lines · Manivannan Sadhasivam
Quoted 3 lines · Johan Hovold

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Quoted 7 lines
Quoted 4 lines

Hmm. I checked further and got the info that there is no change in the IP, but the PHY sequence is not tuned correctly for L0s (as I suspected earlier). So there will be AERs when L0s is enabled on any controller instance. And there will be no updated PHY sequence in the future also for this chipset.

Why? If it is a bug in the PHY driver, it should be fixed there instead of adding workarounds.

ASPM L0s is currently broken on these platforms and, as far as I understand, both under Windows and Linux. Since Qualcomm hasn't been able to come up with the necessary PHY init sequences for these platforms yet, I doubt they will suddenly appear in the near future.

Quoted 6 lines
Quoted 2 lines

So we need to disable L0s for now. If an updated PHY init sequence later appears, we can always enable it again.

It could be the same case for all 'non-mobile' chipsets (automotive, compute, modem). So instead of using the compatible, please add a flag and set that for all non-mobile SoCs. Like the ones starting with SAxxx, SCxxx, SDxxx.

I've already updated the series and was just about to post it. Disabling for further platforms would also require matching on the compatible string and we can easily do that in a follow-up patch once we have some confirmation that it is needed.

Johan

#19 lore raw
In reply to Dmitry Baryshkov
Quoted 37 lines · Dmitry Baryshkov
Quoted 35 lines · Manivannan Sadhasivam
Quoted 32 lines · Johan Hovold
Quoted 19 lines · Manivannan Sadhasivam
Quoted 18 lines · Johan Hovold

This series addresses a few problems with the sc8280xp PCIe implementation.

The DWC PCIe controller can either use its internal MSI controller or an external one such as the GICv3 ITS. Enabling the latter allows for assigning affinity to individual interrupts, but results in a large amount of Correctable Errors being logged on both the Lenovo ThinkPad X13s and the sc8280xp-crd reference design.

It turns out that these errors are always generated, but for some yet to be determined reason, the AER interrupts are never received when using the internal MSI controller, which makes the link errors harder to notice.

Enabling AER error reporting on sc8280xp could similarly also reveal existing problems with the related sa8295p and sa8540p platforms as they share the base dtsi.

Quoted 7 lines
Quoted 3 lines

After discussing this with Bjorn Andersson at Qualcomm we have decided to go ahead and disable L0s for all controllers on the CRD and the X13s.

Just received confirmation from Qcom that L0s is not supported for any of the PCIe instances in sc8280xp (and its derivatives). Please move the property to SoC dtsi.

Ok, thanks for confirming. But then the devicetree property is not the right way to handle this, and we should disable L0s based on the compatible string instead.

Quoted 8 lines
Quoted 4 lines

Hmm. I checked further and got the info that there is no change in the IP, but the PHY sequence is not tuned correctly for L0s (as I suspected earlier). So there will be AERs when L0s is enabled on any controller instance. And there will be no updated PHY sequence in the future also for this chipset.

Why? If it is a bug in the PHY driver, it should be fixed there instead of adding workarounds.

Fixing the L0s support requires the expertise of the PHY team and they will only do if there is any real demand (like in the case of mobile chipsets). For compute chipsets, they didn't do because most of the NVMe devices out there in the market only support L1 and L1ss.

So we have to live with this limitation for now.

- Mani

Quoted 24 lines
Quoted 19 lines

So yeah, let's disable it in the driver instead.

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

As we are now at 6.8-rc7, I've rebased this series on the Qualcomm PCIe binding rework in linux-next so that the whole series can be merged for 6.9 (the 'aspm-no-l0s' support and devicetree fixes are all marked for stable backport anyway).

I'll respin the series. Looks like we've already missed the chance to enable ITS in 6.9 anyway.

Sounds good, thanks!

- Mani

--
மணிவண்ணன் சதாசிவம்

Signature · 2 lines
With best wishes
Dmitry
Signature · 1 line
மணிவண்ணன் சதாசிவம்