fix: pci: enabled usage of pci_config_table usage for each device
patch 03992ac2c974ae3e169219ba0ccdd94a8ce0146a removed the usage of pci_config_Table.
This caused unsuccessful runs of pciauto_config_device on already detected devices,
which caused the device to be not functional.
This fix restores the usage of pci_config_Table.
Instead of running pciauto_config_device for each device, first scan table for the device (pci_find_config)
And if device was already detected, run config_device.
** Tested with PCIe 8613 AIC bridge using E1000 NIC **
Change-Id: I3fedf56f9f29a621aa39a1b22e58e264e0c54b03
Signed-off-by: Omri Itach <omrii@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/5647
Reviewed-by: Yehuda Yitschak <yehuday@marvell.com>
Tested-by: Star_Automation <star@marvell.com>
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
old mode 100644
new mode 100755
index d864f13..3182c4d
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -627,9 +627,7 @@
unsigned int sub_bus, found_multi = 0;
unsigned short vendor, device, class;
unsigned char header_type;
-#ifndef CONFIG_PCI_PNP
struct pci_config_table *cfg;
-#endif
pci_dev_t dev;
#ifdef CONFIG_PCI_SCAN_SHOW
static int indent = 0;
@@ -677,16 +675,18 @@
}
#endif
-#ifdef CONFIG_PCI_PNP
- sub_bus = max(pciauto_config_device(hose, dev), sub_bus);
-#else
cfg = pci_find_config(hose, class, vendor, device,
PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev));
if (cfg) {
cfg->config_device(hose, dev, cfg);
sub_bus = max(sub_bus, hose->current_busno);
- }
+#ifdef CONFIG_PCI_PNP
+ } else {
+ int n = pciauto_config_device(hose, dev);
+
+ sub_bus = max(sub_bus, n);
#endif
+ }
#ifdef CONFIG_PCI_SCAN_SHOW
indent--;