[PATCH] PCI address getting truncated to 32-bits

Jake Moilanen moilanen at austin.ibm.com
Fri Mar 4 09:02:08 EST 2005


On Thu, 3 Mar 2005 13:40:34 -0600
Jake Moilanen <moilanen at austin.ibm.com> wrote:

> While looking at another problem, I ran across this.  It looks like we
> are truncated our pci addresses coming out of "assigned-addresses" to
> 32-bits.

Probably need it for of_finish_dynamic_node() too.  

Signed-off-by: Jake Moilanen <moilanen at austin.ibm.com>
 

---


diff -puN arch/ppc64/kernel/prom.c~offb_dsi arch/ppc64/kernel/prom.c
--- linux-2.6.11/arch/ppc64/kernel/prom.c~offb_dsi      Thu Mar  3 10:23:22 2005
+++ linux-2.6.11-moilanen/arch/ppc64/kernel/prom.c      Thu Mar  3 16:09:02 2005
@@ -333,7 +333,8 @@ static unsigned long __init interpret_pc
                while ((l -= sizeof(struct pci_reg_property)) >= 0) {
                        if (!measure_only) {
                                adr[i].space = pci_addrs[i].addr.a_hi;
-                               adr[i].address = pci_addrs[i].addr.a_lo;
+                               adr[i].address = ((unsigned long)pci_addrs[i].addr.a_mid << 32)
+                                       | pci_addrs[i].addr.a_lo;
                                adr[i].size = pci_addrs[i].size_lo;
                        }
                        ++i;
@@ -1712,7 +1713,8 @@ static int of_finish_dynamic_node(struct
                        }
                        while ((l -= sizeof(struct pci_reg_property)) >= 0) {
                                adr[i].space = pci_addrs[i].addr.a_hi;
-                               adr[i].address = pci_addrs[i].addr.a_lo;
+                               adr[i].address = ((unsigned long)pci_addrs[i].addr.a_mid << 32)
+                                       | pci_addrs[i].addr.a_lo;
                                adr[i].size = pci_addrs[i].size_lo;
                                ++i;
                        }



More information about the Linuxppc64-dev mailing list