Skip to content

Commit a54db86

Browse files
Mani-SadhasivamLorenzo Pieralisi
authored andcommitted
PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0
SoCs making use of Qcom PCIe controller IPs v2.7.0 and v1.9.0 do not support hotplug functionality. But the hotplug capability bit is set by default in the hardware. This causes the kernel PCI core to register hotplug service for the controller and send hotplug commands to it. But those commands will timeout generating messages as below during boot and suspend/resume. [ 5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago) [ 5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago) [ 7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago) [ 7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago) This not only spams the console output but also induces a delay of a couple of seconds. To fix this issue, let's clear the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence to not advertise the hotplug capability for the controller. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]>
1 parent 200b8f8 commit a54db86

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,20 @@ static int qcom_pcie_start_link(struct dw_pcie *pci)
270270
return 0;
271271
}
272272

273+
static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
274+
{
275+
u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
276+
u32 val;
277+
278+
dw_pcie_dbi_ro_wr_en(pci);
279+
280+
val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
281+
val &= ~PCI_EXP_SLTCAP_HPC;
282+
writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
283+
284+
dw_pcie_dbi_ro_wr_dis(pci);
285+
}
286+
273287
static void qcom_pcie_2_1_0_ltssm_enable(struct qcom_pcie *pcie)
274288
{
275289
u32 val;
@@ -966,6 +980,13 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
966980
return ret;
967981
}
968982

983+
static int qcom_pcie_post_init_2_7_0(struct qcom_pcie *pcie)
984+
{
985+
qcom_pcie_clear_hpc(pcie->pci);
986+
987+
return 0;
988+
}
989+
969990
static void qcom_pcie_deinit_2_7_0(struct qcom_pcie *pcie)
970991
{
971992
struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0;
@@ -1272,6 +1293,7 @@ static const struct qcom_pcie_ops ops_2_3_3 = {
12721293
static const struct qcom_pcie_ops ops_2_7_0 = {
12731294
.get_resources = qcom_pcie_get_resources_2_7_0,
12741295
.init = qcom_pcie_init_2_7_0,
1296+
.post_init = qcom_pcie_post_init_2_7_0,
12751297
.deinit = qcom_pcie_deinit_2_7_0,
12761298
.ltssm_enable = qcom_pcie_2_3_2_ltssm_enable,
12771299
};
@@ -1280,6 +1302,7 @@ static const struct qcom_pcie_ops ops_2_7_0 = {
12801302
static const struct qcom_pcie_ops ops_1_9_0 = {
12811303
.get_resources = qcom_pcie_get_resources_2_7_0,
12821304
.init = qcom_pcie_init_2_7_0,
1305+
.post_init = qcom_pcie_post_init_2_7_0,
12831306
.deinit = qcom_pcie_deinit_2_7_0,
12841307
.ltssm_enable = qcom_pcie_2_3_2_ltssm_enable,
12851308
.config_sid = qcom_pcie_config_sid_1_9_0,

0 commit comments

Comments
 (0)