From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 10/10] powerpc/pci: Cosmetic cleanups of pci-common.c
Date: Tue, 28 Oct 2008 16:48:56 +1100 [thread overview]
Message-ID: <20081028054957.2735EDE015@ozlabs.org> (raw)
In-Reply-To: <1225172895.217185.958686212130.qpush@grosgo>
This does a few costmetic cleanups, moving a couple of things
around but without actually changing what the code does.
(There is a minor change in ordering of operations in
pcibios_setup_bus_devices but it should have no impact).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/pci-common.c | 77 ++++++++++++++++++---------------------
1 file changed, 36 insertions(+), 41 deletions(-)
--- linux-work.orig/arch/powerpc/kernel/pci-common.c 2008-10-28 16:39:53.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci-common.c 2008-10-28 16:39:54.000000000 +1100
@@ -202,25 +202,6 @@ char __devinit *pcibios_setup(char *str)
return str;
}
-static void __devinit pcibios_setup_new_device(struct pci_dev *dev)
-{
- struct dev_archdata *sd = &dev->dev.archdata;
-
- sd->of_node = pci_device_to_OF_node(dev);
-
- pr_debug("PCI: device %s OF node: %s\n", pci_name(dev),
- sd->of_node ? sd->of_node->full_name : "<none>");
-
- sd->dma_ops = pci_dma_ops;
-#ifdef CONFIG_PPC32
- sd->dma_data = (void *)PCI_DRAM_OFFSET;
-#endif
- set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
-
- if (ppc_md.pci_dma_dev_setup)
- ppc_md.pci_dma_dev_setup(dev);
-}
-
/*
* Reads the interrupt pin to determine if interrupt is use by card.
* If the interrupt is used, then gets the interrupt line from the
@@ -1076,33 +1057,14 @@ static void __devinit pcibios_fixup_brid
}
}
-void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
-{
- struct pci_dev *dev;
-
- pr_debug("PCI: Fixup bus %d (%s)\n",
- bus->number, bus->self ? pci_name(bus->self) : "PHB");
-
- /* Setup DMA for all PCI devices on that bus */
- list_for_each_entry(dev, &bus->devices, bus_list)
- pcibios_setup_new_device(dev);
-
- /* Read default IRQs and fixup if necessary */
- list_for_each_entry(dev, &bus->devices, bus_list) {
- pci_read_irq_line(dev);
- if (ppc_md.pci_irq_fixup)
- ppc_md.pci_irq_fixup(dev);
- }
-}
-
void __devinit pcibios_setup_bus_self(struct pci_bus *bus)
{
- /* Fix up the bus resources */
+ /* Fix up the bus resources for P2P bridges */
if (bus->self != NULL)
pcibios_fixup_bridge(bus);
/* Platform specific bus fixups. This is currently only used
- * by fsl_pci and I'm hoping getting rid of it at some point
+ * by fsl_pci and I'm hoping to get rid of it at some point
*/
if (ppc_md.pcibios_fixup_bus)
ppc_md.pcibios_fixup_bus(bus);
@@ -1112,10 +1074,43 @@ void __devinit pcibios_setup_bus_self(st
ppc_md.pci_dma_bus_setup(bus);
}
+void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
+{
+ struct pci_dev *dev;
+
+ pr_debug("PCI: Fixup bus devices %d (%s)\n",
+ bus->number, bus->self ? pci_name(bus->self) : "PHB");
+
+ list_for_each_entry(dev, &bus->devices, bus_list) {
+ struct dev_archdata *sd = &dev->dev.archdata;
+
+ /* Setup OF node pointer in archdata */
+ sd->of_node = pci_device_to_OF_node(dev);
+
+ /* Fixup NUMA node as it may not be setup yet by the generic
+ * code and is needed by the DMA init
+ */
+ set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
+
+ /* Hook up default DMA ops */
+ sd->dma_ops = pci_dma_ops;
+ sd->dma_data = (void *)PCI_DRAM_OFFSET;
+
+ /* Additional platform DMA/iommu setup */
+ if (ppc_md.pci_dma_dev_setup)
+ ppc_md.pci_dma_dev_setup(dev);
+
+ /* Read default IRQs and fixup if necessary */
+ pci_read_irq_line(dev);
+ if (ppc_md.pci_irq_fixup)
+ ppc_md.pci_irq_fixup(dev);
+ }
+}
+
void __devinit pcibios_fixup_bus(struct pci_bus *bus)
{
/* When called from the generic PCI probe, read PCI<->PCI bridge
- * bases. This isn't called when generating the PCI tree from
+ * bases. This is -not- called when generating the PCI tree from
* the OF device-tree.
*/
if (bus->self != NULL)
next prev parent reply other threads:[~2008-10-28 5:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-28 5:48 [PATCH 0/10] powerpc/pci: Fix PCI Hotplug Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 1/10] powerpc/pci: Properly allocate bus resources for hotplug PHBs Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 2/10] powerpc/pci: Cleanup debug printk's Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 3/10] powerpc/pci: Use commont PHB resource hookup Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 4/10] powerpc/pci: Remove pcibios_do_bus_setup() Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 5/10] powerpc/pci: Split pcibios_fixup_bus() into bus setup and devices setup Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 6/10] powerpc/eeh: Make EEH device add/remove more robust Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 7/10] powerpc/pci: Make pcibios_allocate_bus_resources " Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 8/10] powerpc/pci: Fix unmapping of IO space on 64-bit Benjamin Herrenschmidt
2008-10-28 5:48 ` [PATCH 9/10] powerpc/pci: Fix various pseries PCI Hotplug issues Benjamin Herrenschmidt
2008-11-05 11:34 ` Paul Mackerras
2008-11-05 20:30 ` Benjamin Herrenschmidt
2008-10-28 5:48 ` Benjamin Herrenschmidt [this message]
2008-10-28 5:54 ` [PATCH 0/10] powerpc/pci: Fix PCI Hotplug Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081028054957.2735EDE015@ozlabs.org \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).