Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff8e59bc authored by Taku Izumi's avatar Taku Izumi Committed by Bjorn Helgaas
Browse files

PCI/portdrv: Don't create hotplug slots unless port supports hotplug



Commit 2dcfaf85 mistakenly dropped the "flags & PCI_EXP_FLAGS_SLOT" test,
so now we create hotplug slots even for PCIe port devices that don't
support hotplug.  This patch fixes this problem.

[bhelgaas: changelog]
Signed-off-by: default avatarTaku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarYinghai Lu <yinghai@kernel.org>
Reviewed-by: default avatarJiang Liu <jiang.liu@huawei.com>
parent 3cba8eed
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -272,7 +272,8 @@ static int get_port_device_capability(struct pci_dev *dev)
	}
	}


	/* Hot-Plug Capable */
	/* Hot-Plug Capable */
	if (cap_mask & PCIE_PORT_SERVICE_HP) {
	if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
	    dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) {
		pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
		pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
		if (reg32 & PCI_EXP_SLTCAP_HPC) {
		if (reg32 & PCI_EXP_SLTCAP_HPC) {
			services |= PCIE_PORT_SERVICE_HP;
			services |= PCIE_PORT_SERVICE_HP;