[ale] PCI kernel drivers and IO remapping

Alex Carver agcarver+ale at acarver.net
Fri Apr 5 15:33:21 EDT 2013


Anyone familiar with IO remapping for PCI hardware?

My office mate at work has a scientific data collector card in an Ubuntu 
machine.  At some point recently, the kernel (and most likely libraries) 
updated which broke an ioremap_nocache function.  In the code, it attempts:

device->ioaddr = ( unsigned long )ioremap_nocache( memaddr, REGS_SIZE );

But this returns zero instead of an IO address.

He booted an older kernel (3.0.0.12), recompiled the driver and the 
detection works again.  Neither one of us understands what changed in 
the kernel or related code.  The driver code has not changed so it's 
something to do with the kernel.





The output messages are below.  The first block is the problematic 
kernel, the second block is the rolled-back kernel with successful 
detection.

Bad detection:
[    8.040080] (astropci_init): +-------------------------------+
[    8.040082] (astropci_init): |   ASTROPCI - Initialization   |
[    8.040083] (astropci_init): +-------------------------------+
[    8.040109] (astropci_probe): looking for ARC PCI boards ...
[    8.040120] astropci 0000:06:00.0: PCI INT A -> GSI 16 (level, low) 
-> IRQ 16
[    8.040124] (astropci_probe): memaddr: f9df0000
[    8.040137] Modules linked in: astropci(O+) psmouse serio_raw shpchp 
ppdev dcdbas soundcore x38_edac snd_page_alloc edac_core parport_pc 
mac_hid lp parport usbhid hid firewire_ohci firewire_core crc_itu_t tg3
[    8.040180]  [<f84f8201>] ? astropci_probe+0xdb/0x257 [astropci]
[    8.040187]  [<f84f8201>] ? astropci_probe+0xdb/0x257 [astropci]
[    8.040190]  [<f84f8201>] astropci_probe+0xdb/0x257 [astropci]
[    8.040229]  [<f84671ae>] astropci_init+0x1ae/0x1000 [astropci]
[    8.040246] (astropci_probe): device->ioaddr: 0(astropci_probe): 
IOremap failed for device 0000:06:00.0,         region 0x9C @ 0xF9DF0000
[    8.040249] (astropci_probe): finished looking for ARC PCI boards



Good detection:
[  162.065395] (astropci_init): +-------------------------------+
[  162.065397] (astropci_init): |   ASTROPCI - Initialization   |
[  162.065399] (astropci_init): +-------------------------------+
[  162.065433] (astropci_probe): looking for ARC PCI boards ...
[  162.065444] astropci 0000:06:00.0: PCI INT A -> GSI 16 (level, low) 
-> IRQ 16
[  162.065445] (astropci_probe): successfully enabled device 
(astropci_probe): successfully requested regions
[  162.065450] (astropci_probe): memaddr: f9df0000(astropci_probe): 
assigned device->ioaddr
[  162.065460] (astropci_probe): device->ioaddr: f82fe000
[  162.065461] (astropci_probe): whooop
[  162.065463] (astropci_probe): ISR name: astropci0 device num: 0
[  162.065470] (astropci_probe): Successfully probed device 0, 
irqDevNum: 1, has_irq: 1, irq 16, func 0
[  162.065923] (astropci_probe): finished looking for ARC PCI boards


More information about the Ale mailing list