aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_hpc.c
diff options
context:
space:
mode:
authorThomas Schaefer <thomas.schaefer@kontron.com>2005-12-08 14:55:57 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-09 15:13:18 -0500
commitc7ab337f91b59f71a30c3ab71e3bdfff41671977 (patch)
tree187fdbee2a796814d00dfe097dc470b4087b658f /drivers/pci/hotplug/pciehp_hpc.c
parent9d265124d051c2cf6716639239609d83f736dcdb (diff)
[PATCH] pciehp: handle sticky power-fault status
This patch disables power fault, MRL sensor and presence detection interrupts when a PCIe slot is powered-off and enables those interrupts when it is powered-on again. This is necessary to prevent the associated events from causing an endless cycle of interrupts due to the power-fault bit, which stays set till power is restored to the slot. Signed-off-by: Thomas Schaefer <thomas.schaefer@kontron.com> Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c19
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