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()
This commit is contained in:
commit
85d24b3fc2
|
@ -848,6 +848,13 @@ struct controller *pcie_init(struct pcie_device *dev)
|
||||||
if (pdev->hotplug_user_indicators)
|
if (pdev->hotplug_user_indicators)
|
||||||
slot_cap &= ~(PCI_EXP_SLTCAP_AIP | PCI_EXP_SLTCAP_PIP);
|
slot_cap &= ~(PCI_EXP_SLTCAP_AIP | PCI_EXP_SLTCAP_PIP);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We assume no Thunderbolt controllers support Command Complete events,
|
||||||
|
* but some controllers falsely claim they do.
|
||||||
|
*/
|
||||||
|
if (pdev->is_thunderbolt)
|
||||||
|
slot_cap |= PCI_EXP_SLTCAP_NCCS;
|
||||||
|
|
||||||
ctrl->slot_cap = slot_cap;
|
ctrl->slot_cap = slot_cap;
|
||||||
mutex_init(&ctrl->ctrl_lock);
|
mutex_init(&ctrl->ctrl_lock);
|
||||||
init_waitqueue_head(&ctrl->queue);
|
init_waitqueue_head(&ctrl->queue);
|
||||||
|
|
|
@ -79,7 +79,6 @@ int pciehp_configure_device(struct slot *p_slot)
|
||||||
int pciehp_unconfigure_device(struct slot *p_slot)
|
int pciehp_unconfigure_device(struct slot *p_slot)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
u8 bctl = 0;
|
|
||||||
u8 presence = 0;
|
u8 presence = 0;
|
||||||
struct pci_dev *dev, *temp;
|
struct pci_dev *dev, *temp;
|
||||||
struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate;
|
struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate;
|
||||||
|
@ -101,17 +100,6 @@ int pciehp_unconfigure_device(struct slot *p_slot)
|
||||||
list_for_each_entry_safe_reverse(dev, temp, &parent->devices,
|
list_for_each_entry_safe_reverse(dev, temp, &parent->devices,
|
||||||
bus_list) {
|
bus_list) {
|
||||||
pci_dev_get(dev);
|
pci_dev_get(dev);
|
||||||
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && presence) {
|
|
||||||
pci_read_config_byte(dev, PCI_BRIDGE_CONTROL, &bctl);
|
|
||||||
if (bctl & PCI_BRIDGE_CTL_VGA) {
|
|
||||||
ctrl_err(ctrl,
|
|
||||||
"Cannot remove display device %s\n",
|
|
||||||
pci_name(dev));
|
|
||||||
pci_dev_put(dev);
|
|
||||||
rc = -EINVAL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!presence) {
|
if (!presence) {
|
||||||
pci_dev_set_disconnected(dev, NULL);
|
pci_dev_set_disconnected(dev, NULL);
|
||||||
if (pci_has_subordinate(dev))
|
if (pci_has_subordinate(dev))
|
||||||
|
|
|
@ -78,7 +78,6 @@ int shpchp_configure_device(struct slot *p_slot)
|
||||||
int shpchp_unconfigure_device(struct slot *p_slot)
|
int shpchp_unconfigure_device(struct slot *p_slot)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
u8 bctl = 0;
|
|
||||||
struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
|
struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
|
||||||
struct pci_dev *dev, *temp;
|
struct pci_dev *dev, *temp;
|
||||||
struct controller *ctrl = p_slot->ctrl;
|
struct controller *ctrl = p_slot->ctrl;
|
||||||
|
@ -93,17 +92,6 @@ int shpchp_unconfigure_device(struct slot *p_slot)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pci_dev_get(dev);
|
pci_dev_get(dev);
|
||||||
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
|
|
||||||
pci_read_config_byte(dev, PCI_BRIDGE_CONTROL, &bctl);
|
|
||||||
if (bctl & PCI_BRIDGE_CTL_VGA) {
|
|
||||||
ctrl_err(ctrl,
|
|
||||||
"Cannot remove display device %s\n",
|
|
||||||
pci_name(dev));
|
|
||||||
pci_dev_put(dev);
|
|
||||||
rc = -EINVAL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pci_stop_and_remove_bus_device(dev);
|
pci_stop_and_remove_bus_device(dev);
|
||||||
pci_dev_put(dev);
|
pci_dev_put(dev);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue