PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Mon, 19 Jun 2023 15:04:03 +0000 (20:34 +0530)
committerLorenzo Pieralisi <lpieralisi@kernel.org>
Tue, 20 Jun 2023 10:12:44 +0000 (12:12 +0200)
commita54db86ddc153484e36266aa2da458a3d9ba0d64
tree8e6571d3e5df679975126f10bbe09fb98b017bde
parent200b8f85f2021362adcc8efb575652a2aa44c099
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/20230619150408.8468-5-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/pci/controller/dwc/pcie-qcom.c