Skip to content

Commit

Permalink
PCI/portdrv: Don't create hotplug slots unless port supports hotplug
Browse files Browse the repository at this point in the history
Commit 2dcfaf8 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: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Jiang Liu <jiang.liu@huawei.com>
  • Loading branch information
Taku Izumi authored and Bjorn Helgaas committed Nov 5, 2012
1 parent 3cba8ee commit ff8e59b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pci/pcie/portdrv_core.c
Original file line number Diff line number Diff line change
@@ -272,7 +272,8 @@ static int get_port_device_capability(struct pci_dev *dev)
}

/* 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);
if (reg32 & PCI_EXP_SLTCAP_HPC) {
services |= PCIE_PORT_SERVICE_HP;

0 comments on commit ff8e59b

Please sign in to comment.