Skip to contentSkip to conversation

PCI Express patches for 2.4.27-pre3

PATCH Andi Kleen 2 participants 4 messages May 24, 2004 – May 25, 2004 8 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#2 lore raw

arch/x86_64/kernel/mmconfig.c

Quoted 13 lines · Greg KH

obj-y += pci-pc.o pci-irq.o
diff -Nru a/arch/x86_64/kernel/mmconfig.c b/arch/x86_64/kernel/mmconfig.c

arch/x86_64/kernel/mmconfig.c new file +7 -0
 
 
+static inline void pci_exp_set_dev_base(int bus, int devfn)
+{
+	u32 dev_base = pci_mmcfg_base_addr | (bus << 20) | (devfn << 12);
+	if (dev_base != mmcfg_last_accessed_device) {
+		mmcfg_last_accessed_device = dev_base;
+		set_fixmap(FIX_PCIE_MCFG, dev_base);
+	}

Please no dynamic fixmap crap on x86-64. Do it like 2.6 does - ioremap() the complete mmconfig aperture once and just just reference it directly.

Then you can also get rid of the spinlocks in the actual access functions, since everything will be stateless.

-Andi

#3 lore raw

I'll let the original authors of this patch answer the question as to why they did not implement it in this manner.

Dely?

thanks,

greg k-h

Quoted 28 lines · Andi Kleen

arch/x86_64/kernel/mmconfig.c

Quoted 13 lines · Greg KH

obj-y += pci-pc.o pci-irq.o
diff -Nru a/arch/x86_64/kernel/mmconfig.c b/arch/x86_64/kernel/mmconfig.c

arch/x86_64/kernel/mmconfig.c new file +7 -0
 
 
+static inline void pci_exp_set_dev_base(int bus, int devfn)
+{
+	u32 dev_base = pci_mmcfg_base_addr | (bus << 20) | (devfn << 12);
+	if (dev_base != mmcfg_last_accessed_device) {
+		mmcfg_last_accessed_device = dev_base;
+		set_fixmap(FIX_PCIE_MCFG, dev_base);
+	}

Please no dynamic fixmap crap on x86-64. Do it like 2.6 does - ioremap() the complete mmconfig aperture once and just just reference it directly.

Then you can also get rid of the spinlocks in the actual access functions, since everything will be stateless.

(quoted diff) +0 -2
-Andi
 
-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#8 lore raw
Quoted 7 lines · Marcelo Tosatti

major? the MMConfig support is minimal as I can see?

Quoted 2 lines
Quoted 2 lines

Marcelo, feel free to tell me otherwise if you do not want this in the 2.4 tree.

Is this code necessary for PCI-Express devices/busses to work properly?

No, it is completely optional right now.

Also we found that it sometimes triggers bugs that are not happening with old style config space accesses.

-Andi

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#11 lore raw
Quoted 4 lines · Marcelo Tosatti

Yeap, I would prefer not to apply them at this time. For one, Arjan told me privately it can break XFree86 which accesses the PCI config space directly. Right?

Erm,no. In fact it could even fix XFree86 for that, because the way they do it currently in user space is racy and the kernel doing it differently would fix that race. But I would still recommend to not apply it, since it is somewhat risky e.g. for triggering
new hardware bugs and it is not really needed and would dilute the message of freeze %) XFree86 should be fixed in user space to use the proper access methods provided by the kernel (/proc/sys etc.)

-Andi