Commit f8415222 authored by Lukas Wunner's avatar Lukas Wunner Committed by Bjorn Helgaas

PCI: Use cached copy of PCI_EXP_SLTCAP_HPC bit

We cache the PCI_EXP_SLTCAP_HPC bit in pci_dev->is_hotplug_bridge on device
probe, so there's no need to read it again on allocation of port service
devices.

No functional change intended.
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 4d88d5a7
...@@ -254,7 +254,6 @@ static void cleanup_service_irqs(struct pci_dev *dev) ...@@ -254,7 +254,6 @@ static void cleanup_service_irqs(struct pci_dev *dev)
static int get_port_device_capability(struct pci_dev *dev) static int get_port_device_capability(struct pci_dev *dev)
{ {
int services = 0; int services = 0;
u32 reg32;
int cap_mask = 0; int cap_mask = 0;
int err; int err;
...@@ -273,19 +272,14 @@ static int get_port_device_capability(struct pci_dev *dev) ...@@ -273,19 +272,14 @@ 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->is_hotplug_bridge) {
pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT) { services |= PCIE_PORT_SERVICE_HP;
pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32); /*
if (reg32 & PCI_EXP_SLTCAP_HPC) { * Disable hot-plug interrupts in case they have been enabled
services |= PCIE_PORT_SERVICE_HP; * by the BIOS and the hot-plug service driver is not loaded.
/* */
* Disable hot-plug interrupts in case they have been pcie_capability_clear_word(dev, PCI_EXP_SLTCTL,
* enabled by the BIOS and the hot-plug service driver PCI_EXP_SLTCTL_CCIE | PCI_EXP_SLTCTL_HPIE);
* is not loaded.
*/
pcie_capability_clear_word(dev, PCI_EXP_SLTCTL,
PCI_EXP_SLTCTL_CCIE | PCI_EXP_SLTCTL_HPIE);
}
} }
/* AER capable */ /* AER capable */
if ((cap_mask & PCIE_PORT_SERVICE_AER) if ((cap_mask & PCIE_PORT_SERVICE_AER)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment