Access to PCI Expansion ROMs on PPC
Robin H. Johnson
robbat2 at gentoo.org
Sun Nov 25 22:15:35 EST 2007
On Sat, Nov 24, 2007 at 09:13:40PM -0500, Jon Smirl wrote:
> The ROM is mapped in drivers/pci/rom.c
>
> You could add some printks and see if there is an error and if the ROM
> is accessible
>
> rom = ioremap(start, *size);
> if (!rom) {
> /* restore enable if ioremap fails */
> if (!(res->flags & (IORESOURCE_ROM_ENABLE |
> IORESOURCE_ROM_SHADOW |
> IORESOURCE_ROM_COPY)))
> pci_disable_rom(pdev);
> return NULL;
> }
I started in there from that, and ended up in pci-sysfs.c...
The ROM memcpy in drivers/pci/pci-sysfs.c:pci_read_rom() is never running.
Relevant section of my debug output:
[ 306.396743] drivers/pci/pci-sysfs.c:577:pci_read_rom: size=0x0 rom=0xd000080082580000 off=0x0
[ 306.396764] drivers/pci/pci-sysfs.c:579:pci_read_rom: off >= size!
[ 306.396768] drivers/pci/pci-sysfs.c:588pci_read_rom: unmapping
Relevant snippet of my debug patching:
- if (off >= size)
+ printk(KERN_INFO "%s:%d:%s: size=0x%lx rom=0x%lx off=0x%lx\n", __FILE__,__LINE__,__FUNCTION__,size,rom,off);
+ if (off >= size) {
+ printk(KERN_INFO "%s:%d:%s: off >= size!\n", __FILE__,__LINE__,__FUNCTION__);
count = 0;
- else {
+ } else {
So next, why is it failing to decode the ROM size correctly?
pci_get_rom_size(), here I come.
--
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail : robbat2 at gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 321 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20071125/0c1dc3c2/attachment.pgp>
More information about the Linuxppc-dev
mailing list