2004-11-10 17:29:21

by Durairaj, Sundarapandian

[permalink] [raw]
Subject: [PATCH] pci-mmconfig fix for 2.6.9

Here I have attached pci mmconfig fix for 2.6.9 kernel.

This will fix the flush error in pci_mmcfg_write.

When pci_mmcfg_write is used to program the PMCSR in the Power
Management Capability structure of PCI config space in the PCI Express
device to a different power state, the dummy readl to flush the previous
write violates the transition delay specified in the PCI power
management spec. Please see PCI Power Management Spec. 1.2 Table 5-6.
For example, while changing the power state of the device through PMCSR
register, a transition delay of 10msec is required before any access can
be made to the device.

Since the configuration write access for PCI Express is non posted,
flushing is not necessary and it will be safe to remove the dummy
readl.

This patch will remove dummy readl function implemented in
"pci_mmcfg_write" and use set_fixmap_nocahe instead of set_fixmap.

Thanks,
Sundar

diff -Naur linux-2.6.9/arch/i386/pci/mmconfig.c
pcie-fix-linux-2.6.9/arch/i386/pci/mmconfig.c
--- linux-2.6.9/arch/i386/pci/mmconfig.c 2004-10-19
03:24:38.000000000 +0530
+++ pcie-fix-linux-2.6.9/arch/i386/pci/mmconfig.c 2004-11-04
11:35:36.029054848 +0530
@@ -30,7 +30,7 @@
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);
+ set_fixmap_nocache(FIX_PCIE_MCFG, dev_base);
}
}

@@ -85,9 +85,6 @@
break;
}

- /* Dummy read to flush PCI write */
- readl(mmcfg_virt_addr);
-
spin_unlock_irqrestore(&pci_config_lock, flags);

return 0;
diff -Naur linux-2.6.9/arch/x86_64/pci/mmconfig.c
pcie-fix-linux-2.6.9/arch/x86_64/pci/mmconfig.c
--- linux-2.6.9/arch/x86_64/pci/mmconfig.c 2004-10-19
03:23:41.000000000 +0530
+++ pcie-fix-linux-2.6.9/arch/x86_64/pci/mmconfig.c 2004-11-04
11:39:21.989703608 +0530
@@ -63,9 +63,6 @@
break;
}

- /* Dummy read to flush PCI write */
- readl(addr);
-
return 0;
}


2004-11-10 17:36:22

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] pci-mmconfig fix for 2.6.9

On Wed, Nov 10, 2004 at 10:56:45PM +0530, Durairaj, Sundarapandian wrote:
> Here I have attached pci mmconfig fix for 2.6.9 kernel.

Your patch is line wrapped, and mime encoded. Two things that prevent
it from being applied :(

Oh, and you forgot a "Signed-off-by:" line.

Care to redo it?

thanks,

greg k-h

2004-11-10 19:22:21

by long

[permalink] [raw]
Subject: Re: [PATCH] pci-mmconfig fix for 2.6.9

On Wed, Nov 10, 2004 at 9:36 Greg KH wrote:
> Your patch is line wrapped, and mime encoded.

On behalf of Sundar, I redo it.
Signed-off-by: Sundarapandian Durairaj

Thanks,
Long
---------------------------------------------------------------
diff -Naur linux-2.6.9/arch/i386/pci/mmconfig.c pcie-fix-linux-2.6.9/arch/i386/pci/mmconfig.c
--- linux-2.6.9/arch/i386/pci/mmconfig.c 2004-10-19 03:24:38.000000000 +0530
+++ pcie-fix-linux-2.6.9/arch/i386/pci/mmconfig.c 2004-11-04 11:35:36.029054848 +0530
@@ -30,7 +30,7 @@
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);
+ set_fixmap_nocache(FIX_PCIE_MCFG, dev_base);
}
}

@@ -85,9 +85,6 @@
break;
}

- /* Dummy read to flush PCI write */
- readl(mmcfg_virt_addr);
-
spin_unlock_irqrestore(&pci_config_lock, flags);

return 0;
diff -Naur linux-2.6.9/arch/x86_64/pci/mmconfig.c pcie-fix-linux-2.6.9/arch/x86_64/pci/mmconfig.c
--- linux-2.6.9/arch/x86_64/pci/mmconfig.c 2004-10-19 03:23:41.000000000 +0530
+++ pcie-fix-linux-2.6.9/arch/x86_64/pci/mmconfig.c 2004-11-04 11:39:21.989703608 +0530
@@ -63,9 +63,6 @@
break;
}

- /* Dummy read to flush PCI write */
- readl(addr);
-
return 0;
}

2004-11-10 19:36:33

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] pci-mmconfig fix for 2.6.9

On Wed, Nov 10, 2004 at 11:38:58AM -0800, long wrote:
> On Wed, Nov 10, 2004 at 9:36 Greg KH wrote:
> > Your patch is line wrapped, and mime encoded.
>
> On behalf of Sundar, I redo it.
> Signed-off-by: Sundarapandian Durairaj

You didn't do it in the proper format :)

Please read Documentation/SubmittingPatches.

Also, I don't think you can add a "Signed-off-by:" on behaf of someone
else, sorry.

And you forgot the full patch information in the body of the message.

We'll get there eventually...

thanks,

greg k-h