]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
pciehp: move msleep after power off
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Tue, 27 May 2008 10:06:22 +0000 (19:06 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 27 May 2008 22:43:33 +0000 (15:43 -0700)
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>
drivers/pci/hotplug/pciehp_ctrl.c
drivers/pci/hotplug/pciehp_hpc.c

index 7ad8a7dbc1a48108833ab97a972ce1cbcb9cb10b..96a5d55a49835e43caadb3b2b0cd52210fd2fce9 100644 (file)
@@ -174,6 +174,13 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
                }
        }
 
+       /*
+        * After turning power off, we must wait for at least 1 second
+        * before taking any action that relies on power having been
+        * removed from the slot/adapter.
+        */
+       msleep(1000);
+
        if (PWR_LED(ctrl))
                pslot->hpc_ops->green_led_off(pslot);
 
@@ -277,6 +284,13 @@ static int remove_board(struct slot *p_slot)
                }
        }
 
+       /*
+        * After turning power off, we must wait for at least 1 second
+        * before taking any action that relies on power having been
+        * removed from the slot/adapter.
+        */
+       msleep(1000);
+
        if (PWR_LED(ctrl))
                /* turn off Green LED */
                p_slot->hpc_ops->green_led_off(p_slot);
index eb631af9473865d4929c6b19cec4617f6bb4213e..79f104963166bdce55420df4005966df49e0dcc6 100644 (file)
@@ -754,13 +754,6 @@ static int hpc_power_off_slot(struct slot * slot)
        }
        dbg("%s: SLOTCTRL %x write cmd %x\n",
            __func__, ctrl->cap_base + SLOTCTRL, slot_cmd);
-
-       /*
-        * After turning power off, we must wait for at least 1 second
-        * before taking any action that relies on power having been
-        * removed from the slot/adapter.
-        */
-       msleep(1000);
  out:
        if (changed)
                pcie_unmask_bad_dllp(ctrl);