stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS
@ 2025-08-31 20:20 Marek Vasut
  2025-08-31 20:20 ` [PATCH 2/2] PCI: dwc: Ensure that dw_pcie_wait_for_link() waits 100 ms after link up Marek Vasut
  2025-09-01 13:40 ` [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2025-08-31 20:20 UTC (permalink / raw)
  To: stable; +Cc: Niklas Cassel, Bjorn Helgaas, Manivannan Sadhasivam

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 817f989700fddefa56e5e443e7d138018ca6709d ]

Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS.

Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Cc: <stable@vger.kernel.org> # 6.12.x
---
 drivers/pci/controller/plda/pcie-starfive.c | 2 +-
 drivers/pci/pci.h                           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/plda/pcie-starfive.c b/drivers/pci/controller/plda/pcie-starfive.c
index 0564fdce47c2a..0a0b5a7d84d7e 100644
--- a/drivers/pci/controller/plda/pcie-starfive.c
+++ b/drivers/pci/controller/plda/pcie-starfive.c
@@ -368,7 +368,7 @@ static int starfive_pcie_host_init(struct plda_pcie_rp *plda)
 	 * of 100ms following exit from a conventional reset before
 	 * sending a configuration request to the device.
 	 */
-	msleep(PCIE_RESET_CONFIG_DEVICE_WAIT_MS);
+	msleep(PCIE_RESET_CONFIG_WAIT_MS);
 
 	if (starfive_pcie_host_wait_for_link(pcie))
 		dev_info(dev, "port link down\n");
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index b65868e709517..c951f861a69b2 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -57,7 +57,7 @@
  *    completes before sending a Configuration Request to the device
  *    immediately below that Port."
  */
-#define PCIE_RESET_CONFIG_DEVICE_WAIT_MS	100
+#define PCIE_RESET_CONFIG_WAIT_MS	100
 
 /* Message Routing (r[2:0]); PCIe r6.0, sec 2.2.8 */
 #define PCIE_MSG_TYPE_R_RC	0
-- 
2.50.1


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

* [PATCH 2/2] PCI: dwc: Ensure that dw_pcie_wait_for_link() waits 100 ms after link up
  2025-08-31 20:20 [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS Marek Vasut
@ 2025-08-31 20:20 ` Marek Vasut
  2025-09-01 13:40 ` [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2025-08-31 20:20 UTC (permalink / raw)
  To: stable
  Cc: Niklas Cassel, Manivannan Sadhasivam, Damien Le Moal,
	Wilfred Mallawa

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 80dc18a0cba8dea42614f021b20a04354b213d86 ]

As per PCIe r6.0, sec 6.6.1, a Downstream Port that supports Link speeds
greater than 5.0 GT/s, software must wait a minimum of 100 ms after Link
training completes before sending a Configuration Request.

Add this delay in dw_pcie_wait_for_link(), after the link is reported as
up. The delay will only be performed in the success case where the link
came up.

DWC glue drivers that have a link up IRQ (drivers that set
use_linkup_irq = true) do not call dw_pcie_wait_for_link(), instead they
perform this delay in their threaded link up IRQ handler.

Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Cc: <stable@vger.kernel.org> # 6.12.x
---
 drivers/pci/controller/dwc/pcie-designware.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index d40afe74ddd1a..f9473b8160778 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -655,6 +655,14 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
 		return -ETIMEDOUT;
 	}
 
+	/*
+	 * As per PCIe r6.0, sec 6.6.1, a Downstream Port that supports Link
+	 * speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms
+	 * after Link training completes before sending a Configuration Request.
+	 */
+	if (pci->max_link_speed > 2)
+		msleep(PCIE_RESET_CONFIG_WAIT_MS);
+
 	offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
 	val = dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKSTA);
 
-- 
2.50.1


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

* Re: [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS
  2025-08-31 20:20 [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS Marek Vasut
  2025-08-31 20:20 ` [PATCH 2/2] PCI: dwc: Ensure that dw_pcie_wait_for_link() waits 100 ms after link up Marek Vasut
@ 2025-09-01 13:40 ` Greg KH
  2025-09-01 23:22   ` Marek Vasut
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2025-09-01 13:40 UTC (permalink / raw)
  To: Marek Vasut; +Cc: stable, Niklas Cassel, Bjorn Helgaas, Manivannan Sadhasivam

On Sun, Aug 31, 2025 at 10:20:48PM +0200, Marek Vasut wrote:
> From: Niklas Cassel <cassel@kernel.org>
> 
> [ Upstream commit 817f989700fddefa56e5e443e7d138018ca6709d ]
> 
> Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS.
> 
> Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
> Cc: <stable@vger.kernel.org> # 6.12.x
> ---

You did not sign off on these patches :(


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

* Re: [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS
  2025-09-01 13:40 ` [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS Greg KH
@ 2025-09-01 23:22   ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2025-09-01 23:22 UTC (permalink / raw)
  To: Greg KH, Marek Vasut
  Cc: stable, Niklas Cassel, Bjorn Helgaas, Manivannan Sadhasivam

On 9/1/25 3:40 PM, Greg KH wrote:
> On Sun, Aug 31, 2025 at 10:20:48PM +0200, Marek Vasut wrote:
>> From: Niklas Cassel <cassel@kernel.org>
>>
>> [ Upstream commit 817f989700fddefa56e5e443e7d138018ca6709d ]
>>
>> Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS.
>>
>> Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
>> Signed-off-by: Niklas Cassel <cassel@kernel.org>
>> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
>> Cc: <stable@vger.kernel.org> # 6.12.x
>> ---
> 
> You did not sign off on these patches :(
I hope the V2 is better now.

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

end of thread, other threads:[~2025-09-01 23:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-31 20:20 [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS Marek Vasut
2025-08-31 20:20 ` [PATCH 2/2] PCI: dwc: Ensure that dw_pcie_wait_for_link() waits 100 ms after link up Marek Vasut
2025-09-01 13:40 ` [PATCH 1/2] PCI: Rename PCIE_RESET_CONFIG_DEVICE_WAIT_MS to PCIE_RESET_CONFIG_WAIT_MS Greg KH
2025-09-01 23:22   ` Marek Vasut

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).