if (!pcibios_assign_all_busses()) in parent fixup

Kristen Carlson Accardi kristen.c.accardi at intel.com
Tue Apr 17 13:29:20 EDT 2007


On Fri, 13 Apr 2007 18:57:28 -0700
Pete Zaitcev <zaitcev at redhat.com> wrote:

> Hi, Dominik:
> 
> Hope you're the right person to ask. I am wondering if this check is
> really necessary:
> 
> static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
> {
> 	struct pci_bus *parent = child->parent;
> 
> 	/* Attempts to fix that up are really dangerous unless
> 	   we're going to re-assign all bus numbers. */
> 	if (!pcibios_assign_all_busses())
> 		return;
> ......
> 
> The problem is, Jay (on cc:) apparently has a laptop where a fixup is
> necessary, and he would like to run it without pci=assign_buses
> (have I got it right?).
> 
> This is what happens normally (actually, a current backport from
> mainline to our 2.6.9 codebase, but same logic):
> 
> [root at postoak]# lspci -v | grep sub
> 	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
> 	Bus: primary=00, secondary=0a, subordinate=0a, sec-latency=32
> 	Bus: primary=0a, secondary=0b, subordinate=0e, sec-latency=176
> 
> Obviously the second subordinate 0x0a is too small. With the check
> removed, Cardbus works:
> 
> [root at pinoak]# lspci -v |grep sub
>        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>        Bus: primary=00, secondary=0a, subordinate=0e, sec-latency=32
>        Bus: primary=0a, secondary=0b, subordinate=0e, sec-latency=176
> 
> I thought about this, and perhaps Jay is right. If we see such a blatant
> problem, there's no other way but force the subordinate number, right?
> 
> -- Pete
> 
> P.S. I'm adding Kristen because apparently she was poking at bus
> numbers last.
> 

I have to agree that it's dangerous to fixup the subordinate number
if you aren't assigning all others - otherwise the bios may have assigned
some number within the secondary->subordinate range to some other bus,
which will really foul things up.  What would really be great would be if
you could detect such a problem and then determine that you need to assign
all the bus numbers manually and redo *everything*.  Not sure if that's 
possible though.  I think the real problem is the assumption that we can
just have 4 bus numbers under a cardbus bridge without assigning all bus
numbers ourselves- maybe we should be smarter about how we figure out how 
many we can have.



More information about the linux-pcmcia mailing list