Skip to content

Commit cd2fe83

Browse files
Mark Lordgregkh
authored andcommitted
PCIE: Make use of the previously split out pcie_init_enable_events() function
Make use of the previously split out pcie_init_enable_events() function to reinitialize the hotplug hardware on resume from suspend, but only when pciehp_force==1. Otherwise behaviour is unmodified. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 08e7a7d commit cd2fe83

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎drivers/pci/hotplug/pciehp.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ extern int pciehp_unconfigure_device(struct slot *p_slot);
162162
extern void pciehp_queue_pushbutton_work(struct work_struct *work);
163163
int pcie_init(struct controller *ctrl, struct pcie_device *dev);
164164
int pciehp_enable_slot(struct slot *p_slot);
165+
int pciehp_disable_slot(struct slot *p_slot);
166+
int pcie_init_hardware(struct controller *ctrl, struct pcie_device *dev);
165167

166168
static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
167169
{

‎drivers/pci/hotplug/pciehp_core.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,24 @@ static int pciehp_suspend (struct pcie_device *dev, pm_message_t state)
514514
static int pciehp_resume (struct pcie_device *dev)
515515
{
516516
printk("%s ENTRY\n", __FUNCTION__);
517+
if (pciehp_force) {
518+
struct pci_dev *pdev = dev->port;
519+
struct controller *ctrl = pci_get_drvdata(pdev);
520+
struct slot *t_slot;
521+
u8 status;
522+
523+
/* reinitialize the chipset's event detection logic */
524+
pcie_init_hardware(ctrl, dev);
525+
526+
t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
527+
528+
/* Check if slot is occupied */
529+
t_slot->hpc_ops->get_adapter_status(t_slot, &status);
530+
if (status)
531+
pciehp_enable_slot(t_slot);
532+
else
533+
pciehp_disable_slot(t_slot);
534+
}
517535
return 0;
518536
}
519537
#endif

‎drivers/pci/hotplug/pciehp_ctrl.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include "pciehp.h"
3838

3939
static void interrupt_event_handler(struct work_struct *work);
40-
static int pciehp_disable_slot(struct slot *p_slot);
4140

4241
static int queue_interrupt_event(struct slot *p_slot, u32 event_type)
4342
{

0 commit comments

Comments
 (0)