Re: PCI Express support for 2.4 kernel

Jeff Garzik
2003-12-17T06:55:57Z

Linus Torvalds wrote:
> So if this will only matter for PCI-X drivers and not for discovery etc, I
> wonder if it wouldn't make sense to have this as a totally separate
> function? Instead of trying to make the existing "pci_config_xxxx()"
> stuff work with PCI-X, wouldn't it be nicer to have the driver just map
> its config space on probe?

Not a bad idea... After posting yesterday on this thread, I had the
thought: Just like PCI has readl() and sbus has sbus_readl(), why not
pciex_cfg_readl() ?

Any PCI-Ex drivers would obviously _know_ they are PCI Ex, and they
could communicate that by virtue of simply using new functions. Older
drivers for older hardware would use the old API and not care...
Further, PCI-Ex operations are already basically readl/writel anyway, so
going through the forest of pci_cfg_ops pointers and such would just add
needless layering.

> You could do it with just ioremap(), but you'd really want to abstract it
> out a bit, and have a "[un]map_pcix_config()" function?

Why not just work within the existing API?
pci_{enable,disable}_device() seems fairly appropriate, as that's a
quite clear signal of the bounds within which the driver must work.

pci_enable_device() is already defined as "the PCI device's resources
may not be available before <this> point."

Jeff