PCI: Add PCIE_CONFIG_REQUEST_WAIT_MS waiting time value
PATCH 1/1 PCI: Add PCIE_CONFIG_REQUEST_WAIT_MS waiting time value
Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes).
As described in the conventional reset rules of PCI specifications, there are two different use cases of the value:
- With a downstream port that supports link speeds <= 5.0 GT/s, the waiting is following exit from a conventional reset.
- With a downstream port that supports link speeds > 5.0 GT/s, the waiting is after link training completes.
--- drivers/pci/pci.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/pci/pci.h +7 -0
@@ -22,6 +22,13 @@*/ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 +/* +* PCIe r6.0, sec 6.6.1, <Conventional Reset> +* Requires a minimum waiting of 100ms before sending a configuration +* request to the device. +*/ +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 +extern const unsigned char pcie_link_speed[];extern bool pci_early_dump;
Signature · 1 line
2.25.1
Quoted 3 lines · Kevin Xie
Add the
PCIE_CONFIG_REQUEST_WAIT_MSmarco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes).
s/marco/macro/
List the first event before the second one, i.e., the delay is from exit from reset to the config request.
Quoted 8 lines
As described in the conventional reset rules of PCI specifications, there are two different use cases of the value:
- With a downstream port that supports link speeds <= 5.0 GT/s, the waiting is following exit from a conventional reset.
- With a downstream port that supports link speeds > 5.0 GT/s, the waiting is after link training completes.
Include the spec citation here as well as in the comment below.
I assume there are follow-on patches that actually use this? Can we make this the first patch in a series so we know we don't have an unused macro lying around?
Quoted 27 lines
Signed-off-by Kevin Xie <[email protected]>Reviewed-by Mason Huo <[email protected]>--- drivers/pci/pci.h | 7 +++++++ 1 file changed, 7 insertions(+)drivers/pci/pci.h +7
-0@@ -22,6 +22,13 @@*/ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 +/* +* PCIe r6.0, sec 6.6.1, <Conventional Reset> +* Requires a minimum waiting of 100ms before sending a configuration +* request to the device. +*/ +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 +extern const unsigned char pcie_link_speed[];extern bool pci_early_dump;Signature · 1 line
2.25.1
Quoted 10 lines · Bjorn Helgaas
Quoted 3 lines · Kevin Xie
Add the
PCIE_CONFIG_REQUEST_WAIT_MSmarco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes).s/marco/macro/
List the first event before the second one, i.e., the delay is from exit from reset to the config request.
OK,I will use "from A to B" instead of "between A and B".
Quoted 11 lines
Quoted 8 lines
As described in the conventional reset rules of PCI specifications, there are two different use cases of the value:
- With a downstream port that supports link speeds <= 5.0 GT/s, the waiting is following exit from a conventional reset.
- With a downstream port that supports link speeds > 5.0 GT/s, the waiting is after link training completes.
Include the spec citation here as well as in the comment below.
OK, I will include the spec citation here.
Quoted 4 lines
I assume there are follow-on patches that actually use this? Can we make this the first patch in a series so we know we don't have an unused macro lying around?
Yes, we will use the marco in the next version of our PCIe controller patches. Here is the link of current version patch series:
https://lore.kernel.org/lkml/[email protected]/T/#u
Do you mean that I should put this patch back to the above series as one of the separate patches?
Thanks for your review.
Quoted 27 lines
Quoted 27 lines
Signed-off-by Kevin Xie <[email protected]>Reviewed-by Mason Huo <[email protected]>--- drivers/pci/pci.h | 7 +++++++ 1 file changed, 7 insertions(+)drivers/pci/pci.h +7
-0@@ -22,6 +22,13 @@*/ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 +/* +* PCIe r6.0, sec 6.6.1, <Conventional Reset> +* Requires a minimum waiting of 100ms before sending a configuration +* request to the device. +*/ +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 +extern const unsigned char pcie_link_speed[];extern bool pci_early_dump;Signature · 1 line
2.25.1
Quoted 6 lines · Kevin Xie
Quoted 5 lines · Bjorn Helgaas
Quoted 3 lines · Kevin Xie
Add the
PCIE_CONFIG_REQUEST_WAIT_MSmarco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes).
Quoted 6 lines
Quoted 4 lines
s/marco/macro/
List the first event before the second one, i.e., the delay is from exit from reset to the config request.
OK,I will use "from A to B" instead of "between A and B".
That's not my point.
My point was you said "between B (config request) and A (exit from reset)". "A" happens first, so it should be mentioned first.
Quoted 10 lines
Quoted 3 lines
I assume there are follow-on patches that actually use this? Can we make this the first patch in a series so we know we don't have an unused macro lying around?
Yes, we will use the marco in the next version of our PCIe controller patches. Here is the link of current version patch series:
https://lore.kernel.org/lkml/[email protected]/T/#uDo you mean that I should put this patch back to the above series as one of the separate patches?
Yes, please. Handling them as a group is less overhead and helps avoid merge issues (if they're all in a series there's no possibility that the user gets merged before the macro itself).
Bjorn
Quoted 12 lines · Bjorn Helgaas
Quoted 11 lines · Kevin Xie
Quoted 9 lines · Bjorn Helgaas
Quoted 3 lines · Kevin Xie
Add the
PCIE_CONFIG_REQUEST_WAIT_MSmarco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes).s/marco/macro/
List the first event before the second one, i.e., the delay is from exit from reset to the config request.
Quoted 7 lines
Quoted 1 line
OK,I will use "from A to B" instead of "between A and B".
That's not my point.
My point was you said "between B (config request) and A (exit from reset)". "A" happens first, so it should be mentioned first.
Got it.
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
I assume there are follow-on patches that actually use this? Can we make this the first patch in a series so we know we don't have an unused macro lying around?
Yes, we will use the marco in the next version of our PCIe controller patches. Here is the link of current version patch series:
https://lore.kernel.org/lkml/[email protected]/T/#u
Quoted 7 lines
Quoted 2 lines
Do you mean that I should put this patch back to the above series as one of the separate patches?
Yes, please. Handling them as a group is less overhead and helps avoid merge issues (if they're all in a series there's no possibility that the user gets merged before the macro itself).
OK, I will put the patch back with these changes.
Quoted 1 line
Bjorn
Quoted 24 lines · Kevin Xie
Add the
PCIE_CONFIG_REQUEST_WAIT_MSmarco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes).As described in the conventional reset rules of PCI specifications, there are two different use cases of the value:
- With a downstream port that supports link speeds <= 5.0 GT/s, the waiting is following exit from a conventional reset.
- With a downstream port that supports link speeds > 5.0 GT/s, the waiting is after link training completes.
Signed-off-by Kevin Xie <[email protected]>Reviewed-by Mason Huo <[email protected]>--- drivers/pci/pci.h | 7 +++++++ 1 file changed, 7 insertions(+)drivers/pci/pci.h +0
-0
drivers/pci/pci.h line 30
Quoted 9 lines
drivers/pci/pci.h +6
-0@@ -22,6 +22,13 @@*/ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 +/* +* PCIe r6.0, sec 6.6.1, <Conventional Reset> +* Requires a minimum waiting of 100ms before sending a configuration +* request to the device. +*/ +#define PCIE_CONFIG_REQUEST_WAIT_MS 100
Oh, and I think this name should include something about "reset" because that's the common scenario and that's the spec section where the value is mentioned.
Quoted 28 lines · Bjorn Helgaas
Quoted 27 lines · Kevin Xie
Add the
PCIE_CONFIG_REQUEST_WAIT_MSmarco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes).As described in the conventional reset rules of PCI specifications, there are two different use cases of the value:
- With a downstream port that supports link speeds <= 5.0 GT/s, the waiting is following exit from a conventional reset.
- With a downstream port that supports link speeds > 5.0 GT/s, the waiting is after link training completes.
Signed-off-by Kevin Xie <[email protected]>Reviewed-by Mason Huo <[email protected]>--- drivers/pci/pci.h | 7 +++++++ 1 file changed, 7 insertions(+)drivers/pci/pci.h +0
-0@@ -22,6 +22,13 @@*/ #define PCIE_PME_TO_L2_TIMEOUT_US 10000
Quoted 10 lines
drivers/pci/pci.h line 30
Quoted 6 lines
drivers/pci/pci.h +6
-0+/* +* PCIe r6.0, sec 6.6.1, <Conventional Reset> +* Requires a minimum waiting of 100ms before sending a configuration +* request to the device. +*/ +#define PCIE_CONFIG_REQUEST_WAIT_MS 100Oh, and I think this name should include something about "reset" because that's the common scenario and that's the spec section where the value is mentioned.
Agree, how about PCIE_RESET_CONFIG_DEVICE_WAIT_MS?