Merge branch 'pci/pm' into next
* pci/pm: x86/platform/intel-mid: Constify mid_pci_platform_pm PCI: pciehp: Add runtime PM support for PCIe hotplug ports ACPI / hotplug / PCI: Make device_is_managed_by_native_pciehp() public ACPI / hotplug / PCI: Use cached copy of PCI_EXP_SLTCAP_HPC bit PCI: Unfold conditions to block runtime PM on PCIe ports PCI: Consolidate conditions to allow runtime PM on PCIe ports PCI: Activate runtime PM on a PCIe port only if it can suspend PCI: Speed up algorithm in pci_bridge_d3_update() PCI: Autosense device removal in pci_bridge_d3_update() PCI: Don't acquire ref on parent in pci_bridge_d3_update() USB: UHCI: report non-PME wakeup signalling for Intel hardware PCI: Check for PME in targeted sleep state
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/pci.h>
|
||||
#include "../pci.h"
|
||||
#include "pciehp.h"
|
||||
@@ -98,6 +99,7 @@ static int board_added(struct slot *p_slot)
|
||||
pciehp_green_led_blink(p_slot);
|
||||
|
||||
/* Check link training status */
|
||||
pm_runtime_get_sync(&ctrl->pcie->port->dev);
|
||||
retval = pciehp_check_link_status(ctrl);
|
||||
if (retval) {
|
||||
ctrl_err(ctrl, "Failed to check link status\n");
|
||||
@@ -118,12 +120,14 @@ static int board_added(struct slot *p_slot)
|
||||
if (retval != -EEXIST)
|
||||
goto err_exit;
|
||||
}
|
||||
pm_runtime_put(&ctrl->pcie->port->dev);
|
||||
|
||||
pciehp_green_led_on(p_slot);
|
||||
pciehp_set_attention_status(p_slot, 0);
|
||||
return 0;
|
||||
|
||||
err_exit:
|
||||
pm_runtime_put(&ctrl->pcie->port->dev);
|
||||
set_slot_off(ctrl, p_slot);
|
||||
return retval;
|
||||
}
|
||||
@@ -137,7 +141,9 @@ static int remove_board(struct slot *p_slot)
|
||||
int retval;
|
||||
struct controller *ctrl = p_slot->ctrl;
|
||||
|
||||
pm_runtime_get_sync(&ctrl->pcie->port->dev);
|
||||
retval = pciehp_unconfigure_device(p_slot);
|
||||
pm_runtime_put(&ctrl->pcie->port->dev);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
|
Reference in New Issue
Block a user