diff options
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index ac1e495c314e..77e530321de2 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -787,8 +787,13 @@ static int hpc_power_on_slot(struct slot * slot) | |||
787 | 787 | ||
788 | slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_ON; | 788 | slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_ON; |
789 | 789 | ||
790 | /* Enable detection that we turned off at slot power-off time */ | ||
790 | if (!pciehp_poll_mode) | 791 | if (!pciehp_poll_mode) |
791 | slot_cmd = slot_cmd | HP_INTR_ENABLE; | 792 | slot_cmd = slot_cmd | |
793 | PWR_FAULT_DETECT_ENABLE | | ||
794 | MRL_DETECT_ENABLE | | ||
795 | PRSN_DETECT_ENABLE | | ||
796 | HP_INTR_ENABLE; | ||
792 | 797 | ||
793 | retval = pcie_write_cmd(slot, slot_cmd); | 798 | retval = pcie_write_cmd(slot, slot_cmd); |
794 | 799 | ||
@@ -833,8 +838,18 @@ static int hpc_power_off_slot(struct slot * slot) | |||
833 | 838 | ||
834 | slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_OFF; | 839 | slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_OFF; |
835 | 840 | ||
841 | /* | ||
842 | * If we get MRL or presence detect interrupts now, the isr | ||
843 | * will notice the sticky power-fault bit too and issue power | ||
844 | * indicator change commands. This will lead to an endless loop | ||
845 | * of command completions, since the power-fault bit remains on | ||
846 | * till the slot is powered on again. | ||
847 | */ | ||
836 | if (!pciehp_poll_mode) | 848 | if (!pciehp_poll_mode) |
837 | slot_cmd = slot_cmd | HP_INTR_ENABLE; | 849 | slot_cmd = (slot_cmd & |
850 | ~PWR_FAULT_DETECT_ENABLE & | ||
851 | ~MRL_DETECT_ENABLE & | ||
852 | ~PRSN_DETECT_ENABLE) | HP_INTR_ENABLE; | ||
838 | 853 | ||
839 | retval = pcie_write_cmd(slot, slot_cmd); | 854 | retval = pcie_write_cmd(slot, slot_cmd); |
840 | 855 | ||