diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2018-10-20 12:45:28 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-10-20 12:45:28 -0400 |
commit | de468b755464426c276df2daf1e54bcd64186020 (patch) | |
tree | 85d70498798e2112fad41d5b0e5e29a520d6bed6 | |
parent | b1801bf05964321d79fbbeae96c8ab09da2e2e49 (diff) | |
parent | d6112f8def514e019658bcc9b57d53acdb71ca3f (diff) |
Merge branch 'pci/enumeration'
- Remove x86 and arm64 node-local allocation for host bridge structures
(Punit Agrawal)
- Pay attention to device-specific _PXM node values (Jonathan Cameron)
- Support new Immediate Readiness bit (Felipe Balbi)
* pci/enumeration:
PCI: Add support for Immediate Readiness
ACPI/PCI: Pay attention to device-specific _PXM node values
x86/PCI: Remove node-local allocation when initialising host controller
arm64: PCI: Remove node-local allocations when initialising host controller
-rw-r--r-- | arch/arm64/kernel/pci.c | 5 | ||||
-rw-r--r-- | arch/x86/pci/acpi.c | 2 | ||||
-rw-r--r-- | drivers/pci/pci-acpi.c | 5 | ||||
-rw-r--r-- | drivers/pci/pci.c | 13 | ||||
-rw-r--r-- | include/linux/pci.h | 1 | ||||
-rw-r--r-- | include/uapi/linux/pci_regs.h | 1 |
6 files changed, 22 insertions, 5 deletions
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 0e2ea1c78542..bb85e2f4603f 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c | |||
@@ -165,16 +165,15 @@ static void pci_acpi_generic_release_info(struct acpi_pci_root_info *ci) | |||
165 | /* Interface called from ACPI code to setup PCI host controller */ | 165 | /* Interface called from ACPI code to setup PCI host controller */ |
166 | struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) | 166 | struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) |
167 | { | 167 | { |
168 | int node = acpi_get_node(root->device->handle); | ||
169 | struct acpi_pci_generic_root_info *ri; | 168 | struct acpi_pci_generic_root_info *ri; |
170 | struct pci_bus *bus, *child; | 169 | struct pci_bus *bus, *child; |
171 | struct acpi_pci_root_ops *root_ops; | 170 | struct acpi_pci_root_ops *root_ops; |
172 | 171 | ||
173 | ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node); | 172 | ri = kzalloc(sizeof(*ri), GFP_KERNEL); |
174 | if (!ri) | 173 | if (!ri) |
175 | return NULL; | 174 | return NULL; |
176 | 175 | ||
177 | root_ops = kzalloc_node(sizeof(*root_ops), GFP_KERNEL, node); | 176 | root_ops = kzalloc(sizeof(*root_ops), GFP_KERNEL); |
178 | if (!root_ops) { | 177 | if (!root_ops) { |
179 | kfree(ri); | 178 | kfree(ri); |
180 | return NULL; | 179 | return NULL; |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 5559dcaddd5e..948656069cdd 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -356,7 +356,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) | |||
356 | } else { | 356 | } else { |
357 | struct pci_root_info *info; | 357 | struct pci_root_info *info; |
358 | 358 | ||
359 | info = kzalloc_node(sizeof(*info), GFP_KERNEL, node); | 359 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
360 | if (!info) | 360 | if (!info) |
361 | dev_err(&root->device->dev, | 361 | dev_err(&root->device->dev, |
362 | "pci_bus %04x:%02x: ignored (out of memory)\n", | 362 | "pci_bus %04x:%02x: ignored (out of memory)\n", |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index c2ab57705043..8f75ba068d45 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -751,10 +751,15 @@ static void pci_acpi_setup(struct device *dev) | |||
751 | { | 751 | { |
752 | struct pci_dev *pci_dev = to_pci_dev(dev); | 752 | struct pci_dev *pci_dev = to_pci_dev(dev); |
753 | struct acpi_device *adev = ACPI_COMPANION(dev); | 753 | struct acpi_device *adev = ACPI_COMPANION(dev); |
754 | int node; | ||
754 | 755 | ||
755 | if (!adev) | 756 | if (!adev) |
756 | return; | 757 | return; |
757 | 758 | ||
759 | node = acpi_get_node(adev->handle); | ||
760 | if (node != NUMA_NO_NODE) | ||
761 | set_dev_node(dev, node); | ||
762 | |||
758 | pci_acpi_optimize_delay(pci_dev, adev->handle); | 763 | pci_acpi_optimize_delay(pci_dev, adev->handle); |
759 | 764 | ||
760 | pci_acpi_add_pm_notifier(adev, pci_dev); | 765 | pci_acpi_add_pm_notifier(adev, pci_dev); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1835f3a7aa8d..ee7c2f4eef9b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -999,7 +999,7 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state) | |||
999 | * because have already delayed for the bridge. | 999 | * because have already delayed for the bridge. |
1000 | */ | 1000 | */ |
1001 | if (dev->runtime_d3cold) { | 1001 | if (dev->runtime_d3cold) { |
1002 | if (dev->d3cold_delay) | 1002 | if (dev->d3cold_delay && !dev->imm_ready) |
1003 | msleep(dev->d3cold_delay); | 1003 | msleep(dev->d3cold_delay); |
1004 | /* | 1004 | /* |
1005 | * When powering on a bridge from D3cold, the | 1005 | * When powering on a bridge from D3cold, the |
@@ -2644,6 +2644,7 @@ EXPORT_SYMBOL_GPL(pci_d3cold_disable); | |||
2644 | void pci_pm_init(struct pci_dev *dev) | 2644 | void pci_pm_init(struct pci_dev *dev) |
2645 | { | 2645 | { |
2646 | int pm; | 2646 | int pm; |
2647 | u16 status; | ||
2647 | u16 pmc; | 2648 | u16 pmc; |
2648 | 2649 | ||
2649 | pm_runtime_forbid(&dev->dev); | 2650 | pm_runtime_forbid(&dev->dev); |
@@ -2706,6 +2707,10 @@ void pci_pm_init(struct pci_dev *dev) | |||
2706 | /* Disable the PME# generation functionality */ | 2707 | /* Disable the PME# generation functionality */ |
2707 | pci_pme_active(dev, false); | 2708 | pci_pme_active(dev, false); |
2708 | } | 2709 | } |
2710 | |||
2711 | pci_read_config_word(dev, PCI_STATUS, &status); | ||
2712 | if (status & PCI_STATUS_IMM_READY) | ||
2713 | dev->imm_ready = 1; | ||
2709 | } | 2714 | } |
2710 | 2715 | ||
2711 | static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop) | 2716 | static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop) |
@@ -4376,6 +4381,9 @@ int pcie_flr(struct pci_dev *dev) | |||
4376 | 4381 | ||
4377 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); | 4382 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); |
4378 | 4383 | ||
4384 | if (dev->imm_ready) | ||
4385 | return 0; | ||
4386 | |||
4379 | /* | 4387 | /* |
4380 | * Per PCIe r4.0, sec 6.6.2, a device must complete an FLR within | 4388 | * Per PCIe r4.0, sec 6.6.2, a device must complete an FLR within |
4381 | * 100ms, but may silently discard requests while the FLR is in | 4389 | * 100ms, but may silently discard requests while the FLR is in |
@@ -4417,6 +4425,9 @@ static int pci_af_flr(struct pci_dev *dev, int probe) | |||
4417 | 4425 | ||
4418 | pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); | 4426 | pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); |
4419 | 4427 | ||
4428 | if (dev->imm_ready) | ||
4429 | return 0; | ||
4430 | |||
4420 | /* | 4431 | /* |
4421 | * Per Advanced Capabilities for Conventional PCI ECN, 13 April 2006, | 4432 | * Per Advanced Capabilities for Conventional PCI ECN, 13 April 2006, |
4422 | * updated 27 July 2006; a device must complete an FLR within | 4433 | * updated 27 July 2006; a device must complete an FLR within |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 6925828f9f25..60da5d7d4310 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -325,6 +325,7 @@ struct pci_dev { | |||
325 | pci_power_t current_state; /* Current operating state. In ACPI, | 325 | pci_power_t current_state; /* Current operating state. In ACPI, |
326 | this is D0-D3, D0 being fully | 326 | this is D0-D3, D0 being fully |
327 | functional, and D3 being off. */ | 327 | functional, and D3 being off. */ |
328 | unsigned int imm_ready:1; /* Supports Immediate Readiness */ | ||
328 | u8 pm_cap; /* PM capability offset */ | 329 | u8 pm_cap; /* PM capability offset */ |
329 | unsigned int pme_support:5; /* Bitmask of states from which PME# | 330 | unsigned int pme_support:5; /* Bitmask of states from which PME# |
330 | can be generated */ | 331 | can be generated */ |
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index ee556ccc93f4..e1e9888c85e6 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
@@ -52,6 +52,7 @@ | |||
52 | #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ | 52 | #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ |
53 | 53 | ||
54 | #define PCI_STATUS 0x06 /* 16 bits */ | 54 | #define PCI_STATUS 0x06 /* 16 bits */ |
55 | #define PCI_STATUS_IMM_READY 0x01 /* Immediate Readiness */ | ||
55 | #define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */ | 56 | #define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */ |
56 | #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ | 57 | #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ |
57 | #define PCI_STATUS_66MHZ 0x20 /* Support 66 MHz PCI 2.1 bus */ | 58 | #define PCI_STATUS_66MHZ 0x20 /* Support 66 MHz PCI 2.1 bus */ |