Skip to contentSkip to conversation

dm: pci: Optimize pci_uclass_post_bind()

PATCH Superseded Bin Meng 2 participants 2 messages Aug 23, 2015 – Aug 24, 2015 PCI

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH v3 1/4 dm: pci: Optimize pci_uclass_post_bind()

If there is no pci device listed in the device tree, don't bother scanning the device tree.

---
Simon, I see the following v2 patches were applied, but don't see you replied the patch thread to mention it's been applied.
- x86: fsp: Call fsp_init_phase_pci() in pci_uclass_post_probe()
- fdtdec: Fix possible infinite loop in fdtdec_get_pci_vendev()
- dm: pci: Save devfn without bus number in pci_uclass_child_post_bind()

I assume these patches look good, so I don't include those patches in the v3 series. Let me know if there is any issue.

Changes in v3 respin:
- Fix typo of 'tree'

Changes in v3:
- Rebase on u-boot-x86/master
- Drop v2 patches which were already applied

 drivers/pci/pci-uclass.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/pci/pci-uclass.c +7 -0
index 2d12344..b25298f 100644
@@ -632,6 +632,13 @@ error:
 static int pci_uclass_post_bind(struct udevice *bus)
 {
 	/*
+	 * If there is no pci device listed in the device tree,
+	 * don't bother scanning the device tree.
+	 */
+	if (bus->of_offset == -1)
+		return 0;
+
+	/*
 	 * Scan the device tree for devices. This does not probe the PCI bus,
 	 * as this is not permitted while binding. It just finds devices
 	 * mentioned in the device tree.
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v3 1/4 dm: pci: Optimize pci_uclass_post_bind()

Hi Bin,

Quoted 13 lines · Bin Meng

If there is no pci device listed in the device tree, don't bother scanning the device tree.

---
Simon, I see the following v2 patches were applied, but don't see you replied the patch thread to mention it's been applied.
- x86: fsp: Call fsp_init_phase_pci() in pci_uclass_post_probe()
- fdtdec: Fix possible infinite loop in fdtdec_get_pci_vendev()
- dm: pci: Save devfn without bus number in pci_uclass_child_post_bind()

Quoted 2 lines

I assume these patches look good, so I don't include those patches in the v3 series. Let me know if there is any issue.

They are fine, thanks.

Quoted 16 lines

Changes in v3 respin:
- Fix typo of 'tree'

Changes in v3:
- Rebase on u-boot-x86/master
- Drop v2 patches which were already applied

drivers/pci/pci-uclass.c | 7 +++++++

1 file changed, 7 insertions(+)
drivers/pci/pci-uclass.c +0 -0
index 2d12344..b25298f 100644

drivers/pci/pci-uclass.c error: · line 639

Quoted 8 lines
drivers/pci/pci-uclass.c +5 -0
@@ -632,6 +632,13 @@ error:
 static int pci_uclass_post_bind(struct udevice *bus)
 {
 /*
+ * If there is no pci device listed in the device tree,
+ * don't bother scanning the device tree.
+ */
+ if (bus->of_offset == -1)
+ return 0;

Since this is a special case for PCI I think it is best that this check goes here instead of dm_scan_fdt_node().

Quoted 8 lines
drivers/pci/pci-uclass.c +2 -1
+
+ /*
 * Scan the device tree for devices. This does not probe the PCI bus,
 * as this is not permitted while binding. It just finds devices
 * mentioned in the device tree.
--

1.8.2.1

Regards,
Simon