Re: PCI Express support for 2.4 kernel

Andi Kleen
2003-12-16T17:44:25Z

Vladimir Kondratiev <vladimir.kondratiev@intel.com> writes:

> #define PCI_PROBE_CONF1 0x0002
> #define PCI_PROBE_CONF2 0x0004
> +
> +#ifdef CONFIG_PCI_EXPRESS
> +#define PCI_PROBE_EXP 0x0008
> +#endif

Drop the #ifdef here.

> +#ifdef CONFIG_PCI_EXPRESS
> +#include <asm/fixmap.h>
> +#endif

Same here.

> +static inline void pci_exp_set_dev_base(int bus, int dev, int fn)
> +{
> + u32 dev_base = (bus << 20) | (dev << 15) | (fn << 12);
> + if (dev_base != pcie_last_accessed_device) {
> + pcie_last_accessed_device = dev_base;
> + set_fixmap_nocache(FIX_PCIE_CONFIG, rrbar_phys | dev_base);
> + }

When you use one fix map per CPU you can avoid the lock. All that would
be needed would be a local_irq_disable()/enable() then. While normally
config space accesses should not be performance critical sometimes
they are done frequently to work around hardware bugs.

I still think it would be better to cache mappings and use a hash table
though ...

-Andi