aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2018-01-31 11:10:31 -0500
committerBjorn Helgaas <helgaas@kernel.org>2018-01-31 11:10:31 -0500
commit85d24b3fc22265d51aa6e8c9e73552750089fa49 (patch)
treee44b751f729130362e22a2f57b22e8360d46614f
parent5be31686cf4752443e669f48843eed036c69f999 (diff)
parent493fb50e958c1c6deef7feff0b8c3855def78d75 (diff)
Merge branch 'pci/hotplug' into next
* pci/hotplug: PCI: pciehp: Assume NoCompl+ for Thunderbolt ports PCI: hotplug: Drop checking of PCI_BRIDGE_CONTROL in *_unconfigure_device()
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c7
-rw-r--r--drivers/pci/hotplug/pciehp_pci.c12
-rw-r--r--drivers/pci/hotplug/shpchp_pci.c12
3 files changed, 7 insertions, 24 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 7bab0606f1a9..a89d8b990228 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -848,6 +848,13 @@ struct controller *pcie_init(struct pcie_device *dev)
848 if (pdev->hotplug_user_indicators) 848 if (pdev->hotplug_user_indicators)
849 slot_cap &= ~(PCI_EXP_SLTCAP_AIP | PCI_EXP_SLTCAP_PIP); 849 slot_cap &= ~(PCI_EXP_SLTCAP_AIP | PCI_EXP_SLTCAP_PIP);
850 850
851 /*
852 * We assume no Thunderbolt controllers support Command Complete events,
853 * but some controllers falsely claim they do.
854 */
855 if (pdev->is_thunderbolt)
856 slot_cap |= PCI_EXP_SLTCAP_NCCS;
857
851 ctrl->slot_cap = slot_cap; 858 ctrl->slot_cap = slot_cap;
852 mutex_init(&ctrl->ctrl_lock); 859 mutex_init(&ctrl->ctrl_lock);
853 init_waitqueue_head(&ctrl->queue); 860 init_waitqueue_head(&ctrl->queue);
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 2a1ca020cf5a..acc360d1a1fb 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -79,7 +79,6 @@ int pciehp_configure_device(struct slot *p_slot)
79int pciehp_unconfigure_device(struct slot *p_slot) 79int pciehp_unconfigure_device(struct slot *p_slot)
80{ 80{
81 int rc = 0; 81 int rc = 0;
82 u8 bctl = 0;
83 u8 presence = 0; 82 u8 presence = 0;
84 struct pci_dev *dev, *temp; 83 struct pci_dev *dev, *temp;
85 struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate; 84 struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate;
@@ -101,17 +100,6 @@ int pciehp_unconfigure_device(struct slot *p_slot)
101 list_for_each_entry_safe_reverse(dev, temp, &parent->devices, 100 list_for_each_entry_safe_reverse(dev, temp, &parent->devices,
102 bus_list) { 101 bus_list) {
103 pci_dev_get(dev); 102 pci_dev_get(dev);
104 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && presence) {
105 pci_read_config_byte(dev, PCI_BRIDGE_CONTROL, &bctl);
106 if (bctl & PCI_BRIDGE_CTL_VGA) {
107 ctrl_err(ctrl,
108 "Cannot remove display device %s\n",
109 pci_name(dev));
110 pci_dev_put(dev);
111 rc = -EINVAL;
112 break;
113 }
114 }
115 if (!presence) { 103 if (!presence) {
116 pci_dev_set_disconnected(dev, NULL); 104 pci_dev_set_disconnected(dev, NULL);
117 if (pci_has_subordinate(dev)) 105 if (pci_has_subordinate(dev))
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index ea63db58b4b1..79f1682c858e 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -78,7 +78,6 @@ int shpchp_configure_device(struct slot *p_slot)
78int shpchp_unconfigure_device(struct slot *p_slot) 78int shpchp_unconfigure_device(struct slot *p_slot)
79{ 79{
80 int rc = 0; 80 int rc = 0;
81 u8 bctl = 0;
82 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; 81 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
83 struct pci_dev *dev, *temp; 82 struct pci_dev *dev, *temp;
84 struct controller *ctrl = p_slot->ctrl; 83 struct controller *ctrl = p_slot->ctrl;
@@ -93,17 +92,6 @@ int shpchp_unconfigure_device(struct slot *p_slot)
93 continue; 92 continue;
94 93
95 pci_dev_get(dev); 94 pci_dev_get(dev);
96 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
97 pci_read_config_byte(dev, PCI_BRIDGE_CONTROL, &bctl);
98 if (bctl & PCI_BRIDGE_CTL_VGA) {
99 ctrl_err(ctrl,
100 "Cannot remove display device %s\n",
101 pci_name(dev));
102 pci_dev_put(dev);
103 rc = -EINVAL;
104 break;
105 }
106 }
107 pci_stop_and_remove_bus_device(dev); 95 pci_stop_and_remove_bus_device(dev);
108 pci_dev_put(dev); 96 pci_dev_put(dev);
109 } 97 }