linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
@ 2023-02-13 14:49 Manivannan Sadhasivam
  2023-02-13 21:01 ` Bjorn Helgaas
  2023-02-13 21:07 ` Krzysztof Wilczyński
  0 siblings, 2 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2023-02-13 14:49 UTC (permalink / raw)
  To: bhelgaas
  Cc: linux-pci, linux-kernel, linux-arm-msm, steev, Manivannan Sadhasivam

The Qualcomm PCI bridge device (Device ID 0x010e) found in chipsets such as
SC8280XP used in Lenovo Thinkpad X13s, does not set the Command Completed
bit unless writes to the Slot Command register change "Control" bits.

This results in timeouts like below during boot and resume from suspend:

    pcieport 0002:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
    ...
    pcieport 0002:00:00.0: pciehp: Timeout on hotplug command 0x13f1 (issued 107724 msec ago)

Add the device to the Command Completed quirk to mark commands "completed"
immediately unless they change the "Control" bits.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---

Bjorn, during the review of a similar patch adding the quirk for device id
0x0110, you asked me whether we should mark all Qcom bridge devices as
quirky like Intel bridges. I tried asking this question to Qualcomm but
found no answer yet. So I just went with adding one more entry.

 drivers/pci/hotplug/pciehp_hpc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 10e9670eea0b..f8c70115b691 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -1088,6 +1088,8 @@ static void quirk_cmd_compl(struct pci_dev *pdev)
 }
 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
 			      PCI_CLASS_BRIDGE_PCI, 8, quirk_cmd_compl);
+DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_QCOM, 0x010e,
+			      PCI_CLASS_BRIDGE_PCI, 8, quirk_cmd_compl);
 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_QCOM, 0x0110,
 			      PCI_CLASS_BRIDGE_PCI, 8, quirk_cmd_compl);
 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_QCOM, 0x0400,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
  2023-02-13 14:49 [PATCH] PCI: pciehp: Add Qualcomm quirk for Command Completed erratum Manivannan Sadhasivam
@ 2023-02-13 21:01 ` Bjorn Helgaas
  2023-02-13 21:07 ` Krzysztof Wilczyński
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2023-02-13 21:01 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: bhelgaas, linux-pci, linux-kernel, linux-arm-msm, steev

On Mon, Feb 13, 2023 at 08:19:22PM +0530, Manivannan Sadhasivam wrote:
> The Qualcomm PCI bridge device (Device ID 0x010e) found in chipsets such as
> SC8280XP used in Lenovo Thinkpad X13s, does not set the Command Completed
> bit unless writes to the Slot Command register change "Control" bits.
> 
> This results in timeouts like below during boot and resume from suspend:
> 
>     pcieport 0002:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
>     ...
>     pcieport 0002:00:00.0: pciehp: Timeout on hotplug command 0x13f1 (issued 107724 msec ago)
> 
> Add the device to the Command Completed quirk to mark commands "completed"
> immediately unless they change the "Control" bits.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Applied to pci/hotplug for v6.3, thanks!

> ---
> 
> Bjorn, during the review of a similar patch adding the quirk for device id
> 0x0110, you asked me whether we should mark all Qcom bridge devices as
> quirky like Intel bridges. I tried asking this question to Qualcomm but
> found no answer yet. So I just went with adding one more entry.
> 
>  drivers/pci/hotplug/pciehp_hpc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
> index 10e9670eea0b..f8c70115b691 100644
> --- a/drivers/pci/hotplug/pciehp_hpc.c
> +++ b/drivers/pci/hotplug/pciehp_hpc.c
> @@ -1088,6 +1088,8 @@ static void quirk_cmd_compl(struct pci_dev *pdev)
>  }
>  DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
>  			      PCI_CLASS_BRIDGE_PCI, 8, quirk_cmd_compl);
> +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_QCOM, 0x010e,
> +			      PCI_CLASS_BRIDGE_PCI, 8, quirk_cmd_compl);
>  DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_QCOM, 0x0110,
>  			      PCI_CLASS_BRIDGE_PCI, 8, quirk_cmd_compl);
>  DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_QCOM, 0x0400,
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
  2023-02-13 14:49 [PATCH] PCI: pciehp: Add Qualcomm quirk for Command Completed erratum Manivannan Sadhasivam
  2023-02-13 21:01 ` Bjorn Helgaas
@ 2023-02-13 21:07 ` Krzysztof Wilczyński
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2023-02-13 21:07 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: bhelgaas, linux-pci, linux-kernel, linux-arm-msm, steev

Hello,

> The Qualcomm PCI bridge device (Device ID 0x010e) found in chipsets such as
> SC8280XP used in Lenovo Thinkpad X13s, does not set the Command Completed
> bit unless writes to the Slot Command register change "Control" bits.
> 
> This results in timeouts like below during boot and resume from suspend:
> 
>     pcieport 0002:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
>     ...
>     pcieport 0002:00:00.0: pciehp: Timeout on hotplug command 0x13f1 (issued 107724 msec ago)
> 
> Add the device to the Command Completed quirk to mark commands "completed"
> immediately unless they change the "Control" bits.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Applied to pci/hotplug, thank you!

[1/1] PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
      https://git.kernel.org/pci/pci/c/dc4e71ddbe8e

	Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-13 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13 14:49 [PATCH] PCI: pciehp: Add Qualcomm quirk for Command Completed erratum Manivannan Sadhasivam
2023-02-13 21:01 ` Bjorn Helgaas
2023-02-13 21:07 ` Krzysztof Wilczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).