Re: [PATCH 2.6.34-rcX] Do not expect PCI devices to return zeroesin PCIe space

From: H. Peter Anvin
Date: Fri May 14 2010 - 14:38:11 EST


On 04/30/2010 07:54 PM, Petr Vandrovec wrote:
> Hello,
> openSUSE11.3 32bit kernels hang when installed to the VMware's VMs because Moorestown
> fixed capabilities detection code enters endless loop on Intel's AGP bridges (with
> device ID=7191). See https://bugzilla.kernel.org/show_bug.cgi?id=15888 for additional
> details. arch/x86/pci/mrst.c was introduced after 2.6.33, so only 2.6.34-rcX are
> affected.
> Thanks,
> Petr Vandrovec

Hi Petr,

Could you check if this patch fixes your problem, and if so let me know
as soon as possible?

Sorry for the delay.

Thanks,

-hpa
diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
index 8bf2fcb..1cdc02c 100644
--- a/arch/x86/pci/mrst.c
+++ b/arch/x86/pci/mrst.c
@@ -247,6 +247,10 @@ static void __devinit pci_fixed_bar_fixup(struct pci_dev *dev)
u32 size;
int i;

+ /* Must have extended configuration space */
+ if (dev->cfg_size < PCIE_CAP_OFFSET + 4)
+ return;
+
/* Fixup the BAR sizes for fixed BAR devices and make them unmoveable */
offset = fixed_bar_cap(dev->bus, dev->devfn);
if (!offset || PCI_DEVFN(2, 0) == dev->devfn ||