I noticed someone rewrote the low-level PCI access functions for Alpha
in 2.1.116. Few comments:
- Can anyone from the Alpha people (preferably author of the
patch) replace cli()'s in the low-level code by a IRQ-safe spinlock?
(pcibios_{read,write}_config_{byte,word,dword} can be called from
inteerrupts). It might be even better to handle the spinlocks
in generic pcibios_* functions as we do in the i386 implementation
-- this adds only a little speed overhead and simplifies the real
low-level functions.
- I also don't see any need for calling lock_kernel() in PCI config space access
syscalls as they just call the low-level functions and they do their own
locking.
- Register reading functions do check for alignment correctly, but their
write counterparts don't. These functions for different chipsets seem to
differ only in mk_conf_addr() and conf_{read,write}() -- wouldn't it be better
to have them only once in some header file or generate them by macros as we're
used to do in the i386 code?
- You can do all the bridge reconfiguration in pcibios_fixup_bus() without
needing to traverse the bus tree yourselves in hose_scan_bridges() and
friends. If the only thing you need is to force pci_scan_bus() to assign
the bus numbers even if they have been already assigned, it will be
probably cleaner to just add a parameter to pci_scan_bus() controlling
whether bus numbers set by the firmware are honoured or not instead
of doing all this magic.
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 "It's God. No, not Richard Stallman, not Linus Torvalds, but God."- 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.altern.org/andrebalsa/doc/lkml-faq.html