aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2008-05-27 06:06:22 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-05-27 18:43:33 -0400
commit0711c70ec0e9d2c002b1e9b5fb9f21e49d77f4fd (patch)
tree3660b129fe485637baf164e7092b630e5ad3cd19 /drivers
parent6592e02ae4bd7b277230aa0c5821588a13b9d8e3 (diff)
pciehp: move msleep after power off
According to the PCI Express specification, we must wait for at least 1 second after turning power off before taking any action that relies on power having been removed from the slot/adapter. For this, current pciehp wait for 1 second after issuing the power off command in hpc_power_off_slot() function. But waiting for 1 second in hpc_power_off_slot() can make pciehp probing slow-down because pciehp probe code calls hpc_power_off_slot() if the slot is not occupied just in case. We don't need to wait for 1 second at the pciehp probe time because there is no action on that empty slot. So move 1 second wait from hpc_power_off_slot() to the caller of hpc_power_off_slot(). Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c14
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c7
2 files changed, 14 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 7ad8a7dbc1a4..96a5d55a4983 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -174,6 +174,13 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
174 } 174 }
175 } 175 }
176 176
177 /*
178 * After turning power off, we must wait for at least 1 second
179 * before taking any action that relies on power having been
180 * removed from the slot/adapter.
181 */
182 msleep(1000);
183
177 if (PWR_LED(ctrl)) 184 if (PWR_LED(ctrl))
178 pslot->hpc_ops->green_led_off(pslot); 185 pslot->hpc_ops->green_led_off(pslot);
179 186
@@ -277,6 +284,13 @@ static int remove_board(struct slot *p_slot)
277 } 284 }
278 } 285 }
279 286
287 /*
288 * After turning power off, we must wait for at least 1 second
289 * before taking any action that relies on power having been
290 * removed from the slot/adapter.
291 */
292 msleep(1000);
293
280 if (PWR_LED(ctrl)) 294 if (PWR_LED(ctrl))
281 /* turn off Green LED */ 295 /* turn off Green LED */
282 p_slot->hpc_ops->green_led_off(p_slot); 296 p_slot->hpc_ops->green_led_off(p_slot);
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index eb631af94738..79f104963166 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -754,13 +754,6 @@ static int hpc_power_off_slot(struct slot * slot)
754 } 754 }
755 dbg("%s: SLOTCTRL %x write cmd %x\n", 755 dbg("%s: SLOTCTRL %x write cmd %x\n",
756 __func__, ctrl->cap_base + SLOTCTRL, slot_cmd); 756 __func__, ctrl->cap_base + SLOTCTRL, slot_cmd);
757
758 /*
759 * After turning power off, we must wait for at least 1 second
760 * before taking any action that relies on power having been
761 * removed from the slot/adapter.
762 */
763 msleep(1000);
764 out: 757 out:
765 if (changed) 758 if (changed)
766 pcie_unmask_bad_dllp(ctrl); 759 pcie_unmask_bad_dllp(ctrl);