diff options
author | Lukas Wunner <lukas@wunner.de> | 2016-05-04 17:58:11 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-05-04 17:58:11 -0400 |
commit | f8415222837b651902661f12f5760169690f6696 (patch) | |
tree | 342dc4bcd979af58f5bb5d9f76a63c1771f6084f /drivers/pci | |
parent | 4d88d5a7bf92e31215543b955b8883dcf6f66c1f (diff) |
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: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie/portdrv_core.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 88122dc2e1b1..847f4fdca50c 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -254,7 +254,6 @@ static void cleanup_service_irqs(struct pci_dev *dev) | |||
254 | static int get_port_device_capability(struct pci_dev *dev) | 254 | static int get_port_device_capability(struct pci_dev *dev) |
255 | { | 255 | { |
256 | int services = 0; | 256 | int services = 0; |
257 | u32 reg32; | ||
258 | int cap_mask = 0; | 257 | int cap_mask = 0; |
259 | int err; | 258 | int err; |
260 | 259 | ||
@@ -273,19 +272,14 @@ static int get_port_device_capability(struct pci_dev *dev) | |||
273 | } | 272 | } |
274 | 273 | ||
275 | /* Hot-Plug Capable */ | 274 | /* Hot-Plug Capable */ |
276 | if ((cap_mask & PCIE_PORT_SERVICE_HP) && | 275 | if ((cap_mask & PCIE_PORT_SERVICE_HP) && dev->is_hotplug_bridge) { |
277 | pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT) { | 276 | services |= PCIE_PORT_SERVICE_HP; |
278 | pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, ®32); | 277 | /* |
279 | if (reg32 & PCI_EXP_SLTCAP_HPC) { | 278 | * Disable hot-plug interrupts in case they have been enabled |
280 | services |= PCIE_PORT_SERVICE_HP; | 279 | * by the BIOS and the hot-plug service driver is not loaded. |
281 | /* | 280 | */ |
282 | * Disable hot-plug interrupts in case they have been | 281 | pcie_capability_clear_word(dev, PCI_EXP_SLTCTL, |
283 | * enabled by the BIOS and the hot-plug service driver | 282 | PCI_EXP_SLTCTL_CCIE | PCI_EXP_SLTCTL_HPIE); |
284 | * is not loaded. | ||
285 | */ | ||
286 | pcie_capability_clear_word(dev, PCI_EXP_SLTCTL, | ||
287 | PCI_EXP_SLTCTL_CCIE | PCI_EXP_SLTCTL_HPIE); | ||
288 | } | ||
289 | } | 283 | } |
290 | /* AER capable */ | 284 | /* AER capable */ |
291 | if ((cap_mask & PCIE_PORT_SERVICE_AER) | 285 | if ((cap_mask & PCIE_PORT_SERVICE_AER) |