--- /dev/null
+From 69874ec233871a62e1bc8c89e643993af93a8630 Mon Sep 17 00:00:00 2001
+From: Simon Horman <simon.horman@netronome.com>
+Date: Fri, 11 Dec 2015 11:30:11 +0900
+Subject: PCI: Add Netronome NFP4000 PF device ID
+
+From: Simon Horman <simon.horman@netronome.com>
+
+commit 69874ec233871a62e1bc8c89e643993af93a8630 upstream.
+
+Add the device ID for the PF of the NFP4000. The device ID for the VF,
+0x6003, is already present as PCI_DEVICE_ID_NETRONOME_NFP6000_VF.
+
+Signed-off-by: Simon Horman <simon.horman@netronome.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/pci_ids.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -2476,6 +2476,7 @@
+ #define PCI_VENDOR_ID_NETRONOME 0x19ee
+ #define PCI_DEVICE_ID_NETRONOME_NFP3200 0x3200
+ #define PCI_DEVICE_ID_NETRONOME_NFP3240 0x3240
++#define PCI_DEVICE_ID_NETRONOME_NFP4000 0x4000
+ #define PCI_DEVICE_ID_NETRONOME_NFP6000 0x6000
+ #define PCI_DEVICE_ID_NETRONOME_NFP6000_VF 0x6003
+
--- /dev/null
+From a755e169031dac9ebaed03302c4921687c271d62 Mon Sep 17 00:00:00 2001
+From: "Jason S. McMullan" <jason.mcmullan@netronome.com>
+Date: Wed, 30 Sep 2015 15:35:06 +0900
+Subject: PCI: Add Netronome vendor and device IDs
+
+From: Jason S. McMullan <jason.mcmullan@netronome.com>
+
+commit a755e169031dac9ebaed03302c4921687c271d62 upstream.
+
+Device IDs for the Netronome NFP3200, NFP3240, NFP6000, and NFP6000 SR-IOV
+devices.
+
+Signed-off-by: Jason S. McMullan <jason.mcmullan@netronome.com>
+[simon: edited changelog]
+Signed-off-by: Simon Horman <simon.horman@netronome.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/pci_ids.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -2473,6 +2473,12 @@
+ #define PCI_DEVICE_ID_KORENIX_JETCARDF2 0x1700
+ #define PCI_DEVICE_ID_KORENIX_JETCARDF3 0x17ff
+
++#define PCI_VENDOR_ID_NETRONOME 0x19ee
++#define PCI_DEVICE_ID_NETRONOME_NFP3200 0x3200
++#define PCI_DEVICE_ID_NETRONOME_NFP3240 0x3240
++#define PCI_DEVICE_ID_NETRONOME_NFP6000 0x6000
++#define PCI_DEVICE_ID_NETRONOME_NFP6000_VF 0x6003
++
+ #define PCI_VENDOR_ID_QMI 0x1a32
+
+ #define PCI_VENDOR_ID_AZWAVE 0x1a3b
--- /dev/null
+From c2e771b02792d222cbcd9617fe71482a64f52647 Mon Sep 17 00:00:00 2001
+From: Simon Horman <simon.horman@netronome.com>
+Date: Fri, 11 Dec 2015 11:30:12 +0900
+Subject: PCI: Limit config space size for Netronome NFP4000
+
+From: Simon Horman <simon.horman@netronome.com>
+
+commit c2e771b02792d222cbcd9617fe71482a64f52647 upstream.
+
+Like the NFP6000, the NFP4000 as an erratum where reading/writing to PCI
+config space addresses above 0x600 can cause the NFP to generate PCIe
+completion timeouts.
+
+Limit the NFP4000's PF's config space size to 0x600 bytes as is already
+done for the NFP6000.
+
+The NFP4000's VF is 0x6004 (PCI_DEVICE_ID_NETRONOME_NFP6000_VF), the same
+device ID as the NFP6000's VF. Thus, its config space is already limited
+by the existing use of quirk_nfp6000().
+
+Signed-off-by: Simon Horman <simon.horman@netronome.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pci/quirks.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -296,6 +296,7 @@ static void quirk_nfp6000(struct pci_dev
+ {
+ dev->cfg_size = 0x600;
+ }
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP4000, quirk_nfp6000);
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000, quirk_nfp6000);
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000_VF, quirk_nfp6000);
+
--- /dev/null
+From 9f33a2ae59f24452c1076749deb615bccd435ca9 Mon Sep 17 00:00:00 2001
+From: "Jason S. McMullan" <jason.mcmullan@netronome.com>
+Date: Wed, 30 Sep 2015 15:35:07 +0900
+Subject: PCI: Limit config space size for Netronome NFP6000 family
+
+From: Jason S. McMullan <jason.mcmullan@netronome.com>
+
+commit 9f33a2ae59f24452c1076749deb615bccd435ca9 upstream.
+
+The NFP6000 has an erratum where reading/writing to PCI config space
+addresses above 0x600 can cause the NFP to generate PCIe completion
+timeouts.
+
+Limit the NFP6000's config space size to 0x600 bytes.
+
+Signed-off-by: Jason S. McMullan <jason.mcmullan@netronome.com>
+[simon: edited changelog]
+Signed-off-by: Simon Horman <simon.horman@netronome.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pci/quirks.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -288,6 +288,17 @@ static void quirk_citrine(struct pci_dev
+ }
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, quirk_citrine);
+
++/*
++ * This chip can cause bus lockups if config addresses above 0x600
++ * are read or written.
++ */
++static void quirk_nfp6000(struct pci_dev *dev)
++{
++ dev->cfg_size = 0x600;
++}
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000, quirk_nfp6000);
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000_VF, quirk_nfp6000);
++
+ /* On IBM Crocodile ipr SAS adapters, expand BAR to system page size */
+ static void quirk_extend_bar_to_page(struct pci_dev *dev)
+ {
--- /dev/null
+From c20aecf6963d1273d8f6d61c042b4845441ca592 Mon Sep 17 00:00:00 2001
+From: "Jason S. McMullan" <jason.mcmullan@netronome.com>
+Date: Wed, 30 Sep 2015 15:35:05 +0900
+Subject: PCI: Support PCIe devices with short cfg_size
+
+From: Jason S. McMullan <jason.mcmullan@netronome.com>
+
+commit c20aecf6963d1273d8f6d61c042b4845441ca592 upstream.
+
+If a device quirk modifies the pci_dev->cfg_size to be less than
+PCI_CFG_SPACE_EXP_SIZE (4096), but greater than PCI_CFG_SPACE_SIZE (256),
+the PCI sysfs interface truncates the readable size to PCI_CFG_SPACE_SIZE.
+
+Allow sysfs access to config space up to cfg_size, even if the device
+doesn't support the entire 4096-byte PCIe config space.
+
+Note that pci_read_config() and pci_write_config() limit access to
+dev->cfg_size even though pcie_config_attr contains 4096 (the maximum
+size).
+
+Signed-off-by: Jason S. McMullan <jason.mcmullan@netronome.com>
+[simon: edited changelog]
+Signed-off-by: Simon Horman <simon.horman@netronome.com>
+[bhelgaas: more changelog edits]
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pci/pci-sysfs.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+--- a/drivers/pci/pci-sysfs.c
++++ b/drivers/pci/pci-sysfs.c
+@@ -1349,10 +1349,10 @@ int __must_check pci_create_sysfs_dev_fi
+ if (!sysfs_initialized)
+ return -EACCES;
+
+- if (pdev->cfg_size < PCI_CFG_SPACE_EXP_SIZE)
+- retval = sysfs_create_bin_file(&pdev->dev.kobj, &pci_config_attr);
+- else
++ if (pdev->cfg_size > PCI_CFG_SPACE_SIZE)
+ retval = sysfs_create_bin_file(&pdev->dev.kobj, &pcie_config_attr);
++ else
++ retval = sysfs_create_bin_file(&pdev->dev.kobj, &pci_config_attr);
+ if (retval)
+ goto err;
+
+@@ -1409,10 +1409,10 @@ err_rom_file:
+ err_resource_files:
+ pci_remove_resource_files(pdev);
+ err_config_file:
+- if (pdev->cfg_size < PCI_CFG_SPACE_EXP_SIZE)
+- sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
+- else
++ if (pdev->cfg_size > PCI_CFG_SPACE_SIZE)
+ sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr);
++ else
++ sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
+ err:
+ return retval;
+ }
+@@ -1446,10 +1446,10 @@ void pci_remove_sysfs_dev_files(struct p
+
+ pci_remove_capabilities_sysfs(pdev);
+
+- if (pdev->cfg_size < PCI_CFG_SPACE_EXP_SIZE)
+- sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
+- else
++ if (pdev->cfg_size > PCI_CFG_SPACE_SIZE)
+ sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr);
++ else
++ sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
+
+ pci_remove_resource_files(pdev);
+
x86-mm-disable-preemption-during-cr3-read-write.patch
arm64-define-at_vector_size_arch-for-arch_dlinfo.patch
parisc-fix-order-of-erefused-define-in-errno.h.patch
+pci-support-pcie-devices-with-short-cfg_size.patch
+pci-add-netronome-vendor-and-device-ids.patch
+pci-limit-config-space-size-for-netronome-nfp6000-family.patch
+pci-add-netronome-nfp4000-pf-device-id.patch
+pci-limit-config-space-size-for-netronome-nfp4000.patch