History

powerpc/pci: Add calls to set_pcie_port_type() and set_pcie_hotplug_bridge()

We are missing these when building the pci_dev from scratch off the Open Firmware device-tree

Benjamin Herrenschmidt committed 16 years ago

Commit bb209c81 parent b04da8b3 files · +8 −2Browse files

Unified · Split

3 files
  1. arch/powerpc/kernel/pci_of_scan.c +2 −0
  2. drivers/pci/probe.c +2 −2
  3. include/linux/pci.h +4 −0
arch/powerpc/kernel/pci_of_scan.c+2−0
@@ -140,6 +140,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, · 139 unmodified lines
140140 dev->devfn = devfn;
141141 dev->multifunction = 0; /* maybe a lie? */
142142 dev->needs_freset = 0; /* pcie fundamental reset required */
143+ set_pcie_port_type(dev);
143144
144145 dev->vendor = get_int_prop(node, "vendor-id", 0xffff);
145146 dev->device = get_int_prop(node, "device-id", 0xffff);
@@ -164,6 +165,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, · 18 unmodified lines
164165 /* a PCI-PCI bridge */
165166 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
166167 dev->rom_base_reg = PCI_ROM_ADDRESS1;
168+ set_pcie_hotplug_bridge(dev);
167169 } else if (!strcmp(type, "cardbus")) {
168170 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
169171 } else {
drivers/pci/probe.c+2−2
@@ -681,7 +681,7 @@ static void pci_read_irq(struct pci_dev *dev) · 680 unmodified lines
681681 dev->irq = irq;
682682 }
683683
684−static void set_pcie_port_type(struct pci_dev *pdev)
684+void set_pcie_port_type(struct pci_dev *pdev)
685685 {
686686 int pos;
687687 u16 reg16;
@@ -695,7 +695,7 @@ static void set_pcie_port_type(struct pci_dev *pdev) · 7 unmodified lines
695695 pdev->pcie_type = (reg16 & PCI_EXP_FLAGS_TYPE) >> 4;
696696 }
697697
698−static void set_pcie_hotplug_bridge(struct pci_dev *pdev)
698+void set_pcie_hotplug_bridge(struct pci_dev *pdev)
699699 {
700700 int pos;
701701 u16 reg16;
include/linux/pci.h+4−0
@@ -756,6 +756,10 @@ pci_power_t pci_target_state(struct pci_dev *dev); · 755 unmodified lines
756756 int pci_prepare_to_sleep(struct pci_dev *dev);
757757 int pci_back_from_sleep(struct pci_dev *dev);
758758
759+/* For use by arch with custom probe code */
760+void set_pcie_port_type(struct pci_dev *pdev);
761+void set_pcie_hotplug_bridge(struct pci_dev *pdev);
762+
759763 /* Functions for PCI Hotplug drivers to use */
760764 int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
761765 #ifdef CONFIG_HOTPLUG