Re: PCI Express support for 2.4 kernel
From: Andi Kleen
Date: Tue Dec 16 2003 - 12:45:18 EST
Vladimir Kondratiev <vladimir.kondratiev@xxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/