Skip to content

Commit c7b4fee

Browse files
kkaneshigejbarnes993
authored andcommitted
PCI hotplug: pciehp: remove unnecessary wait after turning power off
The pciehp driver waits for 1000 msec after turning power off to make sure the power has been completely removed. But this 1000 msec wait is not needed if a slot doesn't implement power control because software cannot control the power. Power will be automatically removed at adapter removal time on such a slot Tested-by: "Phil Endecott" <phil_pibbu_endecott@chezphil.org> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
1 parent 9eff02e commit c7b4fee

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

‎drivers/pci/hotplug/pciehp_ctrl.c‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,14 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
178178
"Issue of Slot Power Off command failed\n");
179179
return;
180180
}
181+
/*
182+
* After turning power off, we must wait for at least 1 second
183+
* before taking any action that relies on power having been
184+
* removed from the slot/adapter.
185+
*/
186+
msleep(1000);
181187
}
182188

183-
/*
184-
* After turning power off, we must wait for at least 1 second
185-
* before taking any action that relies on power having been
186-
* removed from the slot/adapter.
187-
*/
188-
msleep(1000);
189-
190189
if (PWR_LED(ctrl))
191190
pslot->hpc_ops->green_led_off(pslot);
192191

@@ -286,15 +285,14 @@ static int remove_board(struct slot *p_slot)
286285
"Issue of Slot Disable command failed\n");
287286
return retval;
288287
}
288+
/*
289+
* After turning power off, we must wait for at least 1 second
290+
* before taking any action that relies on power having been
291+
* removed from the slot/adapter.
292+
*/
293+
msleep(1000);
289294
}
290295

291-
/*
292-
* After turning power off, we must wait for at least 1 second
293-
* before taking any action that relies on power having been
294-
* removed from the slot/adapter.
295-
*/
296-
msleep(1000);
297-
298296
if (PWR_LED(ctrl))
299297
/* turn off Green LED */
300298
p_slot->hpc_ops->green_led_off(p_slot);

0 commit comments

Comments
 (0)