@@ -64,6 +64,13 @@ struct pci_pme_device {
64
64
65
65
#define PME_TIMEOUT 1000 /* How long between PME checks */
66
66
67
+ /*
68
+ * Following exit from Conventional Reset, devices must be ready within 1 sec
69
+ * (PCIe r6.0 sec 6.6.1). A D3cold to D0 transition implies a Conventional
70
+ * Reset (PCIe r6.0 sec 5.8).
71
+ */
72
+ #define PCI_RESET_WAIT 1000 /* msec */
73
+
67
74
/*
68
75
* Devices may extend the 1 sec period through Request Retry Status
69
76
* completions (PCIe r6.0 sec 2.3.1). The spec does not provide an upper
@@ -2968,13 +2975,13 @@ static const struct dmi_system_id bridge_d3_blacklist[] = {
2968
2975
{
2969
2976
/*
2970
2977
* Downstream device is not accessible after putting a root port
2971
- * into D3cold and back into D0 on Elo i2.
2978
+ * into D3cold and back into D0 on Elo Continental Z2 board
2972
2979
*/
2973
- .ident = "Elo i2 " ,
2980
+ .ident = "Elo Continental Z2 " ,
2974
2981
.matches = {
2975
- DMI_MATCH (DMI_SYS_VENDOR , "Elo Touch Solutions" ),
2976
- DMI_MATCH (DMI_PRODUCT_NAME , "Elo i2 " ),
2977
- DMI_MATCH (DMI_PRODUCT_VERSION , "RevB " ),
2982
+ DMI_MATCH (DMI_BOARD_VENDOR , "Elo Touch Solutions" ),
2983
+ DMI_MATCH (DMI_BOARD_NAME , "Geminilake " ),
2984
+ DMI_MATCH (DMI_BOARD_VERSION , "Continental Z2 " ),
2978
2985
},
2979
2986
},
2980
2987
#endif
@@ -5102,11 +5109,9 @@ int pci_bridge_wait_for_secondary_bus(struct pci_dev *dev, char *reset_type)
5102
5109
*
5103
5110
* However, 100 ms is the minimum and the PCIe spec says the
5104
5111
* software must allow at least 1s before it can determine that the
5105
- * device that did not respond is a broken device. There is
5106
- * evidence that 100 ms is not always enough, for example certain
5107
- * Titan Ridge xHCI controller does not always respond to
5108
- * configuration requests if we only wait for 100 ms (see
5109
- * https://bugzilla.kernel.org/show_bug.cgi?id=203885).
5112
+ * device that did not respond is a broken device. Also device can
5113
+ * take longer than that to respond if it indicates so through Request
5114
+ * Retry Status completions.
5110
5115
*
5111
5116
* Therefore we wait for 100 ms and check for the device presence
5112
5117
* until the timeout expires.
@@ -5115,16 +5120,36 @@ int pci_bridge_wait_for_secondary_bus(struct pci_dev *dev, char *reset_type)
5115
5120
return 0 ;
5116
5121
5117
5122
if (pcie_get_speed_cap (dev ) <= PCIE_SPEED_5_0GT ) {
5123
+ u16 status ;
5124
+
5118
5125
pci_dbg (dev , "waiting %d ms for downstream link\n" , delay );
5119
5126
msleep (delay );
5120
- } else {
5121
- pci_dbg (dev , "waiting %d ms for downstream link, after activation\n" ,
5122
- delay );
5123
- if (!pcie_wait_for_link_delay (dev , true, delay )) {
5124
- /* Did not train, no need to wait any further */
5125
- pci_info (dev , "Data Link Layer Link Active not set in 1000 msec\n" );
5127
+
5128
+ if (!pci_dev_wait (child , reset_type , PCI_RESET_WAIT - delay ))
5129
+ return 0 ;
5130
+
5131
+ /*
5132
+ * If the port supports active link reporting we now check
5133
+ * whether the link is active and if not bail out early with
5134
+ * the assumption that the device is not present anymore.
5135
+ */
5136
+ if (!dev -> link_active_reporting )
5126
5137
return - ENOTTY ;
5127
- }
5138
+
5139
+ pcie_capability_read_word (dev , PCI_EXP_LNKSTA , & status );
5140
+ if (!(status & PCI_EXP_LNKSTA_DLLLA ))
5141
+ return - ENOTTY ;
5142
+
5143
+ return pci_dev_wait (child , reset_type ,
5144
+ PCIE_RESET_READY_POLL_MS - PCI_RESET_WAIT );
5145
+ }
5146
+
5147
+ pci_dbg (dev , "waiting %d ms for downstream link, after activation\n" ,
5148
+ delay );
5149
+ if (!pcie_wait_for_link_delay (dev , true, delay )) {
5150
+ /* Did not train, no need to wait any further */
5151
+ pci_info (dev , "Data Link Layer Link Active not set in 1000 msec\n" );
5152
+ return - ENOTTY ;
5128
5153
}
5129
5154
5130
5155
return pci_dev_wait (child , reset_type ,
0 commit comments