summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/pciehp_hpc.c
diff options
context:
space:
mode:
authorRajat Jain <rajatxjain@gmail.com>2014-02-18 18:53:19 -0800
committerBjorn Helgaas <bhelgaas@google.com>2014-02-19 15:04:14 -0700
commit2b3940b60626ac4932fa048cc74f2a872cc4bfb4 (patch)
tree290a5e787a7946d6b685bcf98f3017ffe970db01 /drivers/pci/hotplug/pciehp_hpc.c
parent50277c8b06d56f2345e1a0693db46db29fc6d063 (diff)
PCI: pciehp: Remove a non-existent card, regardless of "surprise" capability
In case a card is physically yanked out, it should immediately be removed, regardless of the "surprise" capability bit. Thus: - Always handle the physical removal - regardless of the "surprise" bit. - Don't use "surprise" capability when making decisions about enabling presence detect notifications. - Reword the comments to indicate the intent. Signed-off-by: Rajat Jain <rajatxjain@gmail.com> Signed-off-by: Rajat Jain <rajatjain@juniper.net> Signed-off-by: Guenter Roeck <groeck@juniper.net> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index da4b0204b4f7..d7d058fa19a4 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -619,9 +619,10 @@ static void pcie_disable_notification(struct controller *ctrl)
/*
* pciehp has a 1:1 bus:slot relationship so we ultimately want a secondary
- * bus reset of the bridge, but if the slot supports surprise removal (or
- * link state change based hotplug), we need to disable presence detection
- * (or link state notifications) around the bus reset and clear any spurious
+ * bus reset of the bridge, but at the same time we want to ensure that it is
+ * not seen as a hot-unplug, followed by the hot-plug of the device. Thus,
+ * disable link state notification and presence detection change notification
+ * momentarily, if we see that they could interfere. Also, clear any spurious
* events after.
*/
int pciehp_reset_slot(struct slot *slot, int probe)
@@ -633,7 +634,7 @@ int pciehp_reset_slot(struct slot *slot, int probe)
if (probe)
return 0;
- if (HP_SUPR_RM(ctrl) && !ATTN_BUTTN(ctrl)) {
+ if (!ATTN_BUTTN(ctrl)) {
ctrl_mask |= PCI_EXP_SLTCTL_PDCE;
stat_mask |= PCI_EXP_SLTSTA_PDC;
}