|
@@ -26,6 +26,8 @@
|
|
#include <linux/interrupt.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/time.h>
|
|
#include <linux/time.h>
|
|
|
|
|
|
|
|
+#include "../pci.h"
|
|
|
|
+
|
|
/* Global variables */
|
|
/* Global variables */
|
|
bool pciehp_debug;
|
|
bool pciehp_debug;
|
|
bool pciehp_poll_mode;
|
|
bool pciehp_poll_mode;
|
|
@@ -126,8 +128,11 @@ static void cleanup_slot(struct controller *ctrl)
|
|
static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
|
|
static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
|
|
{
|
|
{
|
|
struct slot *slot = hotplug_slot->private;
|
|
struct slot *slot = hotplug_slot->private;
|
|
|
|
+ struct pci_dev *pdev = slot->ctrl->pcie->port;
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_get(pdev);
|
|
pciehp_set_attention_status(slot, status);
|
|
pciehp_set_attention_status(slot, status);
|
|
|
|
+ pci_config_pm_runtime_put(pdev);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -150,8 +155,11 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
|
|
static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
|
|
static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
|
|
{
|
|
{
|
|
struct slot *slot = hotplug_slot->private;
|
|
struct slot *slot = hotplug_slot->private;
|
|
|
|
+ struct pci_dev *pdev = slot->ctrl->pcie->port;
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_get(pdev);
|
|
pciehp_get_power_status(slot, value);
|
|
pciehp_get_power_status(slot, value);
|
|
|
|
+ pci_config_pm_runtime_put(pdev);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -166,16 +174,22 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
|
|
static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
|
|
static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
|
|
{
|
|
{
|
|
struct slot *slot = hotplug_slot->private;
|
|
struct slot *slot = hotplug_slot->private;
|
|
|
|
+ struct pci_dev *pdev = slot->ctrl->pcie->port;
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_get(pdev);
|
|
pciehp_get_latch_status(slot, value);
|
|
pciehp_get_latch_status(slot, value);
|
|
|
|
+ pci_config_pm_runtime_put(pdev);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
|
|
static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
|
|
{
|
|
{
|
|
struct slot *slot = hotplug_slot->private;
|
|
struct slot *slot = hotplug_slot->private;
|
|
|
|
+ struct pci_dev *pdev = slot->ctrl->pcie->port;
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_get(pdev);
|
|
pciehp_get_adapter_status(slot, value);
|
|
pciehp_get_adapter_status(slot, value);
|
|
|
|
+ pci_config_pm_runtime_put(pdev);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|