Re: Non-page-aligned PCI base address

Martin Mares (mj@atrey.karlin.mff.cuni.cz)
Thu, 26 Nov 1998 11:56:59 +0100


Hello,

> This sort of PCI base address assignement doesn't happen actualy often.

Yes, especially because cards with memory regions smaller than
page size are very rare.

> This was the first case known to me and it happend on kind of exotic
> board. But maybe it could be considered that future x86 mainboards are
> going to have more than 4 PCI slots on multiple buses and therefore such
> 'bug-feature' behaviour.

This probably doesn't depend on number of PCI slots and buses at all.

> The problem solution I'm thinking about could be some re-assignment of PCI
> base addresses during setup of pci_dev, in the similar manner it is donne
> with PCI interrupts:
>
> in pci.c:
>
> 1. check if the base address is page-aligned
> 2. if not, see if is it possible to align it and on success
> write new base addr into base config
> 3. if the address is already used by other region, see if it is
> possible to rearange other devices
>
> Does it make any sense ?

It would be possible, but certainly not before 2.3.

Since this problem affects very small number of cards and therefore
only a few drivers, it will be better to handle it in the drivers --
instead of calling ioremap() directly, use

new_base = (old_base & (PAGE_SIZE-1)) + ioremap(old_base & ~(PAGE_SIZE-1),...);

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"How do I type 'for i in *.dvi do xdvi $i done' in a GUI?"

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