aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2011-07-10 21:15:45 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-07-22 12:06:41 -0400
commit0cab0841dc1400f633a7e1ac1e448518692f927a (patch)
tree2b4ba002d6d4ee69ad351a2bcf7f9c484f696d2f /drivers/pci
parent9b373ed18f745bddf4288f1ec4a51fe822b8610a (diff)
PCI: pciehp: change wait time for valid configuration access
Naoki Yanagimoto reported that configuration read on some hot-added PCIe device returns invalid value. This patch fixes this problem. According to the PCIe spec, software must wait for at least 1 second to judge if the hot-added device is broken after Data Link Layer State Changed Event. This patch changes pciehp driver to wait for 1 second after the Data Link Layer State Changed Event is detected before initiating a configuration access instead of 100 ms. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Tested-by: Naoki Yanagimoto <yanagimoto@np.css.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c3
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c11
2 files changed, 5 insertions, 9 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 085dbb5fc168..1e9c9aacc3a6 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -213,6 +213,9 @@ static int board_added(struct slot *p_slot)
213 goto err_exit; 213 goto err_exit;
214 } 214 }
215 215
216 /* Wait for 1 second after checking link training status */
217 msleep(1000);
218
216 /* Check for a power fault */ 219 /* Check for a power fault */
217 if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) { 220 if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) {
218 ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(p_slot)); 221 ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(p_slot));
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 50a23da5d24d..96dc4734e4af 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -275,16 +275,9 @@ int pciehp_check_link_status(struct controller *ctrl)
275 * hot-plug capable downstream port. But old controller might 275 * hot-plug capable downstream port. But old controller might
276 * not implement it. In this case, we wait for 1000 ms. 276 * not implement it. In this case, we wait for 1000 ms.
277 */ 277 */
278 if (ctrl->link_active_reporting){ 278 if (ctrl->link_active_reporting)
279 /* Wait for Data Link Layer Link Active bit to be set */
280 pcie_wait_link_active(ctrl); 279 pcie_wait_link_active(ctrl);
281 /* 280 else
282 * We must wait for 100 ms after the Data Link Layer
283 * Link Active bit reads 1b before initiating a
284 * configuration access to the hot added device.
285 */
286 msleep(100);
287 } else
288 msleep(1000); 281 msleep(1000);
289 282
290 retval = pciehp_readw(ctrl, PCI_EXP_LNKSTA, &lnk_status); 283 retval = pciehp_readw(ctrl, PCI_EXP_LNKSTA, &lnk_status);