(Re)assignment of PCI BARs

From: Beng Tan
Date: Thu Aug 27 2009 - 07:49:38 EST


I have an issue relating to allocation of PCI resources in the kernel.
My brief question is ... how do I get the kernel to reassign PCI
resources (if that's not already automatic) and/or is it possible to
explicitly reassign a single BAR of a PCI device?

However, my understanding may be incomplete and this question may not
make sense to those who know the kernel better. So, here's some

-- Start background --

I've connected an external PCI Express card to my laptop, but I am
having PCI resource allocation issues.

I have a PE2L (see http://www.hwtools.net/Adapter/PE2L.html)
connecting my laptop's Express Card slot to a Gigabyte ATI Radeon HD
4550. I got the idea from a DIY Vidock thread (see
http://forum.notebookreview.com/showthread.php?t=397667), and the PE2L
is apparently the same as a ViDock2 (see

My laptop is a Dell 640m (with integrated Intel graphics), and I'm
trying to find a way to hook up 2 external monitors without having to
buy a new system. Hence the external graphics card idea.

-- End background --

The symptom I'm seeing is that the card has BAR 0 unassigned ...

Region 0: Memory at <unassigned> (64-bit, prefetchable) [disabled]

and indeed, the kernel reports this through dmesg ...

[ 6.147093] PCI: Failed to allocate mem resource
#0:10000000@e0000000 for 0000:0d:00.0

Full logs are available at:

Doesn't the kernel reassign PCI resources if the BIOS doesnt do a good
enough job? Or is that not the case in my old kernel (2.6.24)?

Is it possible to force a reassignment of the impacted BAR? For
example, I wrote a small module which wrote to the device's PCI
configuration registers to explcitly reassign BAR 0 to 0xc00000000
(and also bit bashed the connecting bridge to do the same) but ... I'm
not sure if I'm doing it correctly.

I believe the hardware is working fine. X was able to find out about a
monitor attached to the device, but that is all.

And, for reference, you can see someone else's lspci output of the
same card in the first post of

So, any thoughts for things I can try to diagnose this? Should I try
compiling and running a bleeding edge kernel?

Thank you. Any help is much appreciated.

Beng Tan

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/