pciutils: 64-bit BAR addresses not shown with linux-proc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using lspci from pciutils-3.1.2 on an embedded powerpc
platform.  The platform logic "fixes" up the BAR memory
addresses to show the true 36-bit physical address mapped
to the CPU.

If I use the lspci linux-proc access method (-A linux-proc)
only 32-bits of the memory BAR physical address is displayed,
with the truncation occurring on the right.  Example:

...
Memory at e0030000 (64-bit, non-prefetchable) ?disabledÙ
...

This should be shown as:

...
Memory at 0000000e00300000 (64-bit, non-prefetchable) ?disabledÙ
...

I poked around the lspci source and think I have found the
problem.  In lib/types.h, the definition for PCIADDR_T_FMT
is not large enough to accommodate 64-bit addresses.

I've appended my change below.

This problem is only seen using the linux-proc access method.
linux-sysfs works OK.  I do not know if there are other
implications to this change but it fixes the problem above.

John Burr

--- types.h-orig 2008-11-10 18:11:51.000000000 -0500
+++ types.h-new 2009-03-12 09:19:14.000000000 -0400
@@ -41,7 +41,7 @@ typedef unsigned long long u64;

 #ifdef PCI_HAVE_64BIT_ADDRESS
 typedef u64 pciaddr_t;
-#define PCIADDR_T_FMT "%08" PCI_U64_FMT "x"
+#define PCIADDR_T_FMT "%016" PCI_U64_FMT "x"
 #define PCIADDR_PORT_FMT "%04" PCI_U64_FMT "x"
 #else
 typedef u32 pciaddr_t;
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux