Skip to content

Commit 613f325

Browse files
inochisaMani-Sadhasivam
authored andcommitted
PCI: sophgo: Disable L0s and L1 on Sophgo 2044 PCIe Root Ports
Sophgo 2044 Root Ports advertise L0 and L1 capabilities without supporting them. Since commit f3ac2ff ("PCI/ASPM: Enable all ClockPM and ASPM states for devicetree platforms") force enabled ASPM on all device tree platforms, the issue became evident and the SG2044 Root Port started breaking. Hence, disable the L0s and L1 capabilities in the LINKCAP register for the SG2044 Root Ports, so that these states won't get enabled. Fixes: 467d9c0 ("PCI: dwc: Add Sophgo SG2044 PCIe controller driver in Root Complex mode") Signed-off-by: Inochi Amaoto <inochiama@gmail.com> [mani: reworded description and corrected fixes tag] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Tested-by: Han Gao <gaohan@iscas.ac.cn> Link: https://patch.msgid.link/20260109040756.731169-1-inochiama@gmail.com
1 parent 8f0b4cc commit 613f325

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

drivers/pci/controller/dwc/pcie-sophgo.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,22 @@ static void sophgo_pcie_msi_enable(struct dw_pcie_rp *pp)
161161
raw_spin_unlock_irqrestore(&pp->lock, flags);
162162
}
163163

164+
static void sophgo_pcie_disable_l0s_l1(struct dw_pcie_rp *pp)
165+
{
166+
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
167+
u32 offset, val;
168+
169+
offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
170+
171+
dw_pcie_dbi_ro_wr_en(pci);
172+
173+
val = dw_pcie_readl_dbi(pci, PCI_EXP_LNKCAP + offset);
174+
val &= ~(PCI_EXP_LNKCAP_ASPM_L0S | PCI_EXP_LNKCAP_ASPM_L1);
175+
dw_pcie_writel_dbi(pci, PCI_EXP_LNKCAP + offset, val);
176+
177+
dw_pcie_dbi_ro_wr_dis(pci);
178+
}
179+
164180
static int sophgo_pcie_host_init(struct dw_pcie_rp *pp)
165181
{
166182
int irq;
@@ -171,6 +187,8 @@ static int sophgo_pcie_host_init(struct dw_pcie_rp *pp)
171187

172188
irq_set_chained_handler_and_data(irq, sophgo_pcie_intx_handler, pp);
173189

190+
sophgo_pcie_disable_l0s_l1(pp);
191+
174192
sophgo_pcie_msi_enable(pp);
175193

176194
return 0;

0 commit comments

Comments
 (0)