* [PATCH] powerpc/pci: clean up direct access to sysdata by iseries platform
@ 2009-05-05 12:04 Kumar Gala
2009-05-06 13:13 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2009-05-05 12:04 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Stephen Rothwell
We shouldn't directly access sysdata to get the device node. We should
be calling pci_device_to_OF_node().
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/iseries/pci.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 02a634f..18343c3 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -318,6 +318,7 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
{
struct resource *bar_res = &dev->resource[bar_num];
long bar_size = pci_resource_len(dev, bar_num);
+ struct device_node *dn = pci_device_to_OF_node(dev);
/*
* No space to allocate, quick exit, skip Allocation.
@@ -335,9 +336,9 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
* Allocate the number of table entries needed for BAR.
*/
while (bar_size > 0 ) {
- iomm_table[current_iomm_table_entry] = dev->sysdata;
+ iomm_table[current_iomm_table_entry] = dn;
ds_addr_table[current_iomm_table_entry] =
- iseries_ds_addr(dev->sysdata) | (bar_num << 24);
+ iseries_ds_addr(dn) | (bar_num << 24);
bar_size -= IOMM_TABLE_ENTRY_SIZE;
++current_iomm_table_entry;
}
@@ -410,7 +411,7 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
struct device_node *node;
int i;
- node = find_device_node(bus, pdev->devfn);
+ node = pci_device_to_OF_node(pdev);
pr_debug("PCI: iSeries %s, pdev %p, node %p\n",
pci_name(pdev), pdev, node);
if (!node) {
@@ -441,7 +442,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
}
}
- pdev->sysdata = node;
allocate_device_bars(pdev);
iseries_device_information(pdev, bus, *sub_bus);
iommu_devnode_init_iSeries(pdev, node);
--
1.6.0.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/pci: clean up direct access to sysdata by iseries platform
2009-05-05 12:04 [PATCH] powerpc/pci: clean up direct access to sysdata by iseries platform Kumar Gala
@ 2009-05-06 13:13 ` Stephen Rothwell
2009-05-07 0:52 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2009-05-06 13:13 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 597 bytes --]
Hi Kumar,
On Tue, 5 May 2009 07:04:55 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> We shouldn't directly access sysdata to get the device node. We should
> be calling pci_device_to_OF_node().
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
It looks ok, but all I can say for now is that it doesn not make things
worse. During 2.6.28, the iSeries PCI code was broken. I am working on
a fix and after that I will be able to properly test this patch.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/pci: clean up direct access to sysdata by iseries platform
2009-05-06 13:13 ` Stephen Rothwell
@ 2009-05-07 0:52 ` Stephen Rothwell
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-05-07 0:52 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]
Hi Kumar,
On Wed, 6 May 2009 23:13:38 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Tue, 5 May 2009 07:04:55 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
> >
> > We shouldn't directly access sysdata to get the device node. We should
> > be calling pci_device_to_OF_node().
> >
> > Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>
> It looks ok, but all I can say for now is that it doesn not make things
> worse. During 2.6.28, the iSeries PCI code was broken. I am working on
> a fix and after that I will be able to properly test this patch.
With my fix for the old PCI breakage, I have tested your "pci" tree for
iseries_defconfig. Built and booted with and without CONFIG_PCI.
Tested-by: Stephen Rothwell <sfr@canb.auug.og.au>
Acked-by: Stephen Rothwell <sfr@canb.auug.og.au>
My patch, however, will probably need your attention once Ben takes
it. :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-07 0:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-05 12:04 [PATCH] powerpc/pci: clean up direct access to sysdata by iseries platform Kumar Gala
2009-05-06 13:13 ` Stephen Rothwell
2009-05-07 0:52 ` Stephen Rothwell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.