aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorJon Mason <mason@myri.com>2011-10-14 15:56:13 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-10-27 15:45:42 -0400
commitd387a8d66670371e6be3b6d6bde2e38b8cade076 (patch)
tree988a0d0898779694f4299886d7b72607a5b4fdea /drivers/pci
parent086ac11f6435c9dc2fe5025fc8ea3a1dbca273d6 (diff)
PCI: Workaround for Intel MPS errata
Intel 5000 and 5100 series memory controllers have a known issue if read completion coalescing is enabled and the PCI-E Maximum Payload Size is set to 256B. To work around this issue, disable read completion coalescing in the memory controller and root complexes. Unfortunately, it must always be disabled, even if no 256B MPS devices are present, due to the possibility of one being hotplugged. Links to erratas: http://www.intel.com/content/dam/doc/specification-update/5000-chipset-memory-controller-hub-specification-update.pdf http://www.intel.com/content/dam/doc/specification-update/5100-memory-controller-hub-chipset-specification-update.pdf Thanks to Jesse Brandeburg and Ben Hutchings for providing insight into the problem. Tested-and-Reported-by: Avi Kivity <avi@redhat.com> Signed-off-by: Jon Mason <mason@myri.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/quirks.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e5aadf357ae7..dca58b9ba8c6 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2836,6 +2836,75 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE,
2836DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE, 2836DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE,
2837 PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256); 2837 PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256);
2838 2838
2839/* Intel 5000 and 5100 Memory controllers have an errata with read completion
2840 * coalescing (which is enabled by default on some BIOSes) and MPS of 256B.
2841 * Since there is no way of knowing what the PCIE MPS on each fabric will be
2842 * until all of the devices are discovered and buses walked, read completion
2843 * coalescing must be disabled. Unfortunately, it cannot be re-enabled because
2844 * it is possible to hotplug a device with MPS of 256B.
2845 */
2846static void __devinit quirk_intel_mc_errata(struct pci_dev *dev)
2847{
2848 int err;
2849 u16 rcc;
2850
2851 if (pcie_bus_config == PCIE_BUS_TUNE_OFF)
2852 return;
2853
2854 /* Intel errata specifies bits to change but does not say what they are.
2855 * Keeping them magical until such time as the registers and values can
2856 * be explained.
2857 */
2858 err = pci_read_config_word(dev, 0x48, &rcc);
2859 if (err) {
2860 dev_err(&dev->dev, "Error attempting to read the read "
2861 "completion coalescing register.\n");
2862 return;
2863 }
2864
2865 if (!(rcc & (1 << 10)))
2866 return;
2867
2868 rcc &= ~(1 << 10);
2869
2870 err = pci_write_config_word(dev, 0x48, rcc);
2871 if (err) {
2872 dev_err(&dev->dev, "Error attempting to write the read "
2873 "completion coalescing register.\n");
2874 return;
2875 }
2876
2877 pr_info_once("Read completion coalescing disabled due to hardware "
2878 "errata relating to 256B MPS.\n");
2879}
2880/* Intel 5000 series memory controllers and ports 2-7 */
2881DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25c0, quirk_intel_mc_errata);
2882DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25d0, quirk_intel_mc_errata);
2883DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25d4, quirk_intel_mc_errata);
2884DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25d8, quirk_intel_mc_errata);
2885DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_mc_errata);
2886DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_mc_errata);
2887DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_mc_errata);
2888DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_mc_errata);
2889DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_mc_errata);
2890DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_mc_errata);
2891DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_mc_errata);
2892DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_mc_errata);
2893DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_mc_errata);
2894DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_mc_errata);
2895/* Intel 5100 series memory controllers and ports 2-7 */
2896DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65c0, quirk_intel_mc_errata);
2897DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65e2, quirk_intel_mc_errata);
2898DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65e3, quirk_intel_mc_errata);
2899DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65e4, quirk_intel_mc_errata);
2900DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65e5, quirk_intel_mc_errata);
2901DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65e6, quirk_intel_mc_errata);
2902DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65e7, quirk_intel_mc_errata);
2903DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f7, quirk_intel_mc_errata);
2904DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f8, quirk_intel_mc_errata);
2905DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata);
2906DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata);
2907
2839static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, 2908static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
2840 struct pci_fixup *end) 2909 struct pci_fixup *end)
2841{ 2910{