Skip to contentSkip to conversation

PCI: mvebu: change delay after reset to the PCIe spec mandated 100ms

PATCH New Lucas Stach 3 participants 4 messages Jan 16, 2017 – Jan 31, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: mvebu: change delay after reset to the PCIe spec mandated 100ms

The current default of 20ms cause some devices, which are slow to initialize, to not show up during the bus scanning. Change this to the PCIe spec mandated 100ms and document this in the DT binding.

Quoted 1 line

From PCIe base spec rev 3.0, chapter "6.6.1. Conventional Reset":

"To allow components to perform internal initialization, system software must wait a specified minimum period following the end of a Conventional Reset of one or more devices before it is permitted to issue Configuration Requests to those devices.

With a Downstream Port that does not support Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms before sending a Configuration Request to the device immediately below that Port."

---
 Documentation/devicetree/bindings/pci/mvebu-pci.txt | 3 ++-
 drivers/pci/host/pci-mvebu.c                        | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pci/mvebu-pci.txt +2 -1
index 08c716b2c6b6..2de6f65ecfb1 100644
@@ -78,7 +78,8 @@ and the following optional properties:
   multiple lanes. If this property is not found, we assume that the
   value is 0.
 - reset-gpios: optional gpio to PERST#
-- reset-delay-us: delay in us to wait after reset de-assertion
+- reset-delay-us: delay in us to wait after reset de-assertion, if not
+  specified will default to 100ms, as required by the PCIe specification.
 
 Example:
 
drivers/pci/host/pci-mvebu.c +1 -1
index 45a89d969700..0c9dd47ce74d 100644
@@ -1162,7 +1162,7 @@ static int mvebu_pcie_powerup(struct mvebu_pcie_port *port)
 		return ret;
 
 	if (port->reset_gpio) {
-		u32 reset_udelay = 20000;
+		u32 reset_udelay = 100000;
 
 		of_property_read_u32(port->dn, "reset-delay-us",
 				     &reset_udelay);
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 PCI: mvebu: change delay after reset to the PCIe spec mandated 100ms

Hi Lucas,

Quoted 15 lines · Lucas Stach

The current default of 20ms cause some devices, which are slow to initialize, to not show up during the bus scanning. Change this to the PCIe spec mandated 100ms and document this in the DT binding.

From PCIe base spec rev 3.0, chapter "6.6.1. Conventional Reset":

"To allow components to perform internal initialization, system software must wait a specified minimum period following the end of a Conventional Reset of one or more devices before it is permitted to issue Configuration Requests to those devices.

With a Downstream Port that does not support Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms before sending a Configuration Request to the device immediately below that Port."

Quoted 5 lines
---
 Documentation/devicetree/bindings/pci/mvebu-pci.txt | 3 ++-
 drivers/pci/host/pci-mvebu.c                        | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

thx,

Jason.

#2 lore raw

PATCH 1/1 PCI: mvebu: change delay after reset to the PCIe spec mandated 100ms

In reply to Lucas Stach
Quoted 40 lines · Lucas Stach

The current default of 20ms cause some devices, which are slow to initialize, to not show up during the bus scanning. Change this to the PCIe spec mandated 100ms and document this in the DT binding.

From PCIe base spec rev 3.0, chapter "6.6.1. Conventional Reset":

"To allow components to perform internal initialization, system software must wait a specified minimum period following the end of a Conventional Reset of one or more devices before it is permitted to issue Configuration Requests to those devices.

With a Downstream Port that does not support Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms before sending a Configuration Request to the device immediately below that Port."

---
 Documentation/devicetree/bindings/pci/mvebu-pci.txt | 3 ++-
 drivers/pci/host/pci-mvebu.c                        | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pci/mvebu-pci.txt +2 -1
index 08c716b2c6b6..2de6f65ecfb1 100644
@@ -78,7 +78,8 @@ and the following optional properties:
   multiple lanes. If this property is not found, we assume that the
   value is 0.
 - reset-gpios: optional gpio to PERST#
-- reset-delay-us: delay in us to wait after reset de-assertion
+- reset-delay-us: delay in us to wait after reset de-assertion, if not
+  specified will default to 100ms, as required by the PCIe specification.
 
 Example:
 
drivers/pci/host/pci-mvebu.c +0 -0
index 45a89d969700..0c9dd47ce74d 100644

drivers/pci/host/pci-mvebu.c static int mvebu_pcie_powerup(struct mvebu_pcie_port *port) · line 1165

Quoted 5 lines
drivers/pci/host/pci-mvebu.c +1 -1
@@ -1162,7 +1162,7 @@ static int mvebu_pcie_powerup(struct mvebu_pcie_port *port)
 		return ret;
 
 	if (port->reset_gpio) {
-		u32 reset_udelay = 20000;
+		u32 reset_udelay = 100000;

Can we use "PCI_PM_D3COLD_WAIT * 1000" for the initial value to connect it with other similar cases?

Quoted 11 lines
drivers/pci/host/pci-mvebu.c +0 -0
 		of_property_read_u32(port->dn, "reset-delay-us",
 				     &reset_udelay);
Signature · 7 lines
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw

PATCH 1/1 PCI: mvebu: change delay after reset to the PCIe spec mandated 100ms

Am Montag, den 30.01.2017, 14:47 -0600 schrieb Bjorn Helgaas:

Quoted 43 lines · Lucas Stach
Quoted 42 lines

The current default of 20ms cause some devices, which are slow to initialize, to not show up during the bus scanning. Change this to the PCIe spec mandated 100ms and document this in the DT binding.

From PCIe base spec rev 3.0, chapter "6.6.1. Conventional Reset":

"To allow components to perform internal initialization, system software must wait a specified minimum period following the end of a Conventional Reset of one or more devices before it is permitted to issue Configuration Requests to those devices.

With a Downstream Port that does not support Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms before sending a Configuration Request to the device immediately below that Port."

---
 Documentation/devicetree/bindings/pci/mvebu-pci.txt | 3 ++-
 drivers/pci/host/pci-mvebu.c                        | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pci/mvebu-pci.txt +2 -1
index 08c716b2c6b6..2de6f65ecfb1 100644
@@ -78,7 +78,8 @@ and the following optional properties:
   multiple lanes. If this property is not found, we assume that the
   value is 0.
 - reset-gpios: optional gpio to PERST#
-- reset-delay-us: delay in us to wait after reset de-assertion
+- reset-delay-us: delay in us to wait after reset de-assertion, if not
+  specified will default to 100ms, as required by the PCIe specification.
 
 Example:
 
drivers/pci/host/pci-mvebu.c +0 -0
index 45a89d969700..0c9dd47ce74d 100644
@@ -1162,7 +1162,7 @@ static int mvebu_pcie_powerup(struct mvebu_pcie_port *port)
 		return ret;
 
Quoted 6 lines

drivers/pci/host/pci-mvebu.c static int mvebu_pcie_powerup(struct mvebu_pcie_port *port) · line 1165

Quoted 3 lines
drivers/pci/host/pci-mvebu.c +1 -1
 	if (port->reset_gpio) {
-		u32 reset_udelay = 20000;
+		u32 reset_udelay = 100000;

Can we use "PCI_PM_D3COLD_WAIT * 1000" for the initial value to connect it with other similar cases?

Sure, I didn't know there is a define for this. Will send an updated patch.

Regards,
Lucas