Skip to content

Commit de468b7

Browse files
committed
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
2 parents b1801bf + d6112f8 commit de468b7

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

arch/arm64/kernel/pci.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,15 @@ static void pci_acpi_generic_release_info(struct acpi_pci_root_info *ci)
165165
/* Interface called from ACPI code to setup PCI host controller */
166166
struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
167167
{
168-
int node = acpi_get_node(root->device->handle);
169168
struct acpi_pci_generic_root_info *ri;
170169
struct pci_bus *bus, *child;
171170
struct acpi_pci_root_ops *root_ops;
172171

173-
ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node);
172+
ri = kzalloc(sizeof(*ri), GFP_KERNEL);
174173
if (!ri)
175174
return NULL;
176175

177-
root_ops = kzalloc_node(sizeof(*root_ops), GFP_KERNEL, node);
176+
root_ops = kzalloc(sizeof(*root_ops), GFP_KERNEL);
178177
if (!root_ops) {
179178
kfree(ri);
180179
return NULL;

arch/x86/pci/acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
356356
} else {
357357
struct pci_root_info *info;
358358

359-
info = kzalloc_node(sizeof(*info), GFP_KERNEL, node);
359+
info = kzalloc(sizeof(*info), GFP_KERNEL);
360360
if (!info)
361361
dev_err(&root->device->dev,
362362
"pci_bus %04x:%02x: ignored (out of memory)\n",

drivers/pci/pci-acpi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,15 @@ static void pci_acpi_setup(struct device *dev)
751751
{
752752
struct pci_dev *pci_dev = to_pci_dev(dev);
753753
struct acpi_device *adev = ACPI_COMPANION(dev);
754+
int node;
754755

755756
if (!adev)
756757
return;
757758

759+
node = acpi_get_node(adev->handle);
760+
if (node != NUMA_NO_NODE)
761+
set_dev_node(dev, node);
762+
758763
pci_acpi_optimize_delay(pci_dev, adev->handle);
759764

760765
pci_acpi_add_pm_notifier(adev, pci_dev);

drivers/pci/pci.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)
999999
* because have already delayed for the bridge.
10001000
*/
10011001
if (dev->runtime_d3cold) {
1002-
if (dev->d3cold_delay)
1002+
if (dev->d3cold_delay && !dev->imm_ready)
10031003
msleep(dev->d3cold_delay);
10041004
/*
10051005
* When powering on a bridge from D3cold, the
@@ -2644,6 +2644,7 @@ EXPORT_SYMBOL_GPL(pci_d3cold_disable);
26442644
void pci_pm_init(struct pci_dev *dev)
26452645
{
26462646
int pm;
2647+
u16 status;
26472648
u16 pmc;
26482649

26492650
pm_runtime_forbid(&dev->dev);
@@ -2706,6 +2707,10 @@ void pci_pm_init(struct pci_dev *dev)
27062707
/* Disable the PME# generation functionality */
27072708
pci_pme_active(dev, false);
27082709
}
2710+
2711+
pci_read_config_word(dev, PCI_STATUS, &status);
2712+
if (status & PCI_STATUS_IMM_READY)
2713+
dev->imm_ready = 1;
27092714
}
27102715

27112716
static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop)
@@ -4376,6 +4381,9 @@ int pcie_flr(struct pci_dev *dev)
43764381

43774382
pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
43784383

4384+
if (dev->imm_ready)
4385+
return 0;
4386+
43794387
/*
43804388
* Per PCIe r4.0, sec 6.6.2, a device must complete an FLR within
43814389
* 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)
44174425

44184426
pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
44194427

4428+
if (dev->imm_ready)
4429+
return 0;
4430+
44204431
/*
44214432
* Per Advanced Capabilities for Conventional PCI ECN, 13 April 2006,
44224433
* updated 27 July 2006; a device must complete an FLR within

include/linux/pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ struct pci_dev {
325325
pci_power_t current_state; /* Current operating state. In ACPI,
326326
this is D0-D3, D0 being fully
327327
functional, and D3 being off. */
328+
unsigned int imm_ready:1; /* Supports Immediate Readiness */
328329
u8 pm_cap; /* PM capability offset */
329330
unsigned int pme_support:5; /* Bitmask of states from which PME#
330331
can be generated */

include/uapi/linux/pci_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
5353

5454
#define PCI_STATUS 0x06 /* 16 bits */
55+
#define PCI_STATUS_IMM_READY 0x01 /* Immediate Readiness */
5556
#define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */
5657
#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
5758
#define PCI_STATUS_66MHZ 0x20 /* Support 66 MHz PCI 2.1 bus */

0 commit comments

Comments
 (0)