diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 811019902ada..6855933ab372 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "../pci.h" #include "pciehp.h" @@ -310,9 +311,11 @@ static int pciehp_enable_slot(struct slot *slot) struct controller *ctrl = slot->ctrl; int ret; + pm_runtime_get_sync(&ctrl->pcie->port->dev); ret = __pciehp_enable_slot(slot); if (ret && ATTN_BUTTN(ctrl)) pciehp_green_led_off(slot); /* may be blinking */ + pm_runtime_put(&ctrl->pcie->port->dev); mutex_lock(&slot->lock); slot->state = ret ? OFF_STATE : ON_STATE; @@ -341,9 +344,12 @@ static int __pciehp_disable_slot(struct slot *p_slot) static int pciehp_disable_slot(struct slot *slot) { + struct controller *ctrl = slot->ctrl; int ret; + pm_runtime_get_sync(&ctrl->pcie->port->dev); ret = __pciehp_disable_slot(slot); + pm_runtime_put(&ctrl->pcie->port->dev); mutex_lock(&slot->lock); slot->state = OFF_STATE;