From: Greg Kroah-Hartman Date: Fri, 2 Sep 2016 13:36:30 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.14.78~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=444dad3cbac8da16c2b13c36df138fe5f784ecb6;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch mmc-sdhci-acpi-reduce-baytrail-emmc-sd-sdio-hangs.patch nvme-don-t-unmap-controller-registers-on-reset.patch pci-add-netronome-nfp4000-pf-device-id.patch pci-add-netronome-vendor-and-device-ids.patch pci-limit-config-space-size-for-netronome-nfp4000.patch pci-limit-config-space-size-for-netronome-nfp6000-family.patch pci-support-pcie-devices-with-short-cfg_size.patch um-don-t-discard-.text.exit-section.patch --- diff --git a/queue-4.4/acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch b/queue-4.4/acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch new file mode 100644 index 00000000000..3344068c15e --- /dev/null +++ b/queue-4.4/acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch @@ -0,0 +1,46 @@ +From 2324d15447a9db168b1f85e3feac635b1ff8edb8 Mon Sep 17 00:00:00 2001 +From: Hoan Tran +Date: Wed, 25 May 2016 12:09:23 -0700 +Subject: ACPI / CPPC: Prevent cpc_desc_ptr points to the invalid data + +From: Hoan Tran + +commit 2324d15447a9db168b1f85e3feac635b1ff8edb8 upstream. + +When CPPC fails to request a PCC channel, the CPC data is freed +and cpc_desc_ptr points to the invalid data. + +Avoid this issue by moving the cpc_desc_ptr assignment after the PCC +channel request. + +Signed-off-by: Hoan Tran +Acked-by: Ashwin Chaugule +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/cppc_acpi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/acpi/cppc_acpi.c ++++ b/drivers/acpi/cppc_acpi.c +@@ -508,9 +508,6 @@ int acpi_cppc_processor_probe(struct acp + /* Store CPU Logical ID */ + cpc_ptr->cpu_id = pr->id; + +- /* Plug it into this CPUs CPC descriptor. */ +- per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr; +- + /* Parse PSD data for this CPU */ + ret = acpi_get_psd(cpc_ptr, handle); + if (ret) +@@ -523,6 +520,9 @@ int acpi_cppc_processor_probe(struct acp + goto out_free; + } + ++ /* Plug PSD data into this CPUs CPC descriptor. */ ++ per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr; ++ + /* Everything looks okay */ + pr_debug("Parsed CPC struct for CPU: %d\n", pr->id); + diff --git a/queue-4.4/acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch b/queue-4.4/acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch new file mode 100644 index 00000000000..8ff3530615a --- /dev/null +++ b/queue-4.4/acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch @@ -0,0 +1,64 @@ +From 8343c40d3de32ebfe8f48b043964e4ba0e7701f7 Mon Sep 17 00:00:00 2001 +From: Hoan Tran +Date: Fri, 17 Jun 2016 15:16:31 -0700 +Subject: ACPI: CPPC: Return error if _CPC is invalid on a CPU + +From: Hoan Tran + +commit 8343c40d3de32ebfe8f48b043964e4ba0e7701f7 upstream. + +Based on 8.4.7.1 section of ACPI 6.1 specification, if the platform +supports CPPC, the _CPC object must exist under all processor objects. +If cpc_desc_ptr pointer is invalid on any CPUs, acpi_get_psd_map() +should return error and CPPC cpufreq driver can not be registered. + +Signed-off-by: Hoan Tran +Reviewed-by: Prashanth Prakash +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/cppc_acpi.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +--- a/drivers/acpi/cppc_acpi.c ++++ b/drivers/acpi/cppc_acpi.c +@@ -216,8 +216,10 @@ int acpi_get_psd_map(struct cpudata **al + continue; + + cpc_ptr = per_cpu(cpc_desc_ptr, i); +- if (!cpc_ptr) +- continue; ++ if (!cpc_ptr) { ++ retval = -EFAULT; ++ goto err_ret; ++ } + + pdomain = &(cpc_ptr->domain_info); + cpumask_set_cpu(i, pr->shared_cpu_map); +@@ -239,8 +241,10 @@ int acpi_get_psd_map(struct cpudata **al + continue; + + match_cpc_ptr = per_cpu(cpc_desc_ptr, j); +- if (!match_cpc_ptr) +- continue; ++ if (!match_cpc_ptr) { ++ retval = -EFAULT; ++ goto err_ret; ++ } + + match_pdomain = &(match_cpc_ptr->domain_info); + if (match_pdomain->domain != pdomain->domain) +@@ -270,8 +274,10 @@ int acpi_get_psd_map(struct cpudata **al + continue; + + match_cpc_ptr = per_cpu(cpc_desc_ptr, j); +- if (!match_cpc_ptr) +- continue; ++ if (!match_cpc_ptr) { ++ retval = -EFAULT; ++ goto err_ret; ++ } + + match_pdomain = &(match_cpc_ptr->domain_info); + if (match_pdomain->domain != pdomain->domain) diff --git a/queue-4.4/mmc-sdhci-acpi-reduce-baytrail-emmc-sd-sdio-hangs.patch b/queue-4.4/mmc-sdhci-acpi-reduce-baytrail-emmc-sd-sdio-hangs.patch new file mode 100644 index 00000000000..19615c9c938 --- /dev/null +++ b/queue-4.4/mmc-sdhci-acpi-reduce-baytrail-emmc-sd-sdio-hangs.patch @@ -0,0 +1,156 @@ +From 6e1c7d6103fe7031035cec321307c6356809adf4 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Fri, 15 Apr 2016 14:06:57 +0300 +Subject: mmc: sdhci-acpi: Reduce Baytrail eMMC/SD/SDIO hangs + +From: Adrian Hunter + +commit 6e1c7d6103fe7031035cec321307c6356809adf4 upstream. + +Baytrail eMMC/SD/SDIO host controllers have been known to +hang. A change to a hardware setting has been found to +reduce the occurrence of such hangs. This patch ensures +the correct setting. + +This patch applies cleanly to v4.4+. It could go to +earlier kernels also, so I will send backports to the +stable list in due course. + +Signed-off-by: Adrian Hunter +Cc: stable@vger.kernel.org # v4.4+ +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-acpi.c | 81 ++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 82 insertions(+) + +--- a/drivers/mmc/host/Kconfig ++++ b/drivers/mmc/host/Kconfig +@@ -97,6 +97,7 @@ config MMC_RICOH_MMC + config MMC_SDHCI_ACPI + tristate "SDHCI support for ACPI enumerated SDHCI controllers" + depends on MMC_SDHCI && ACPI ++ select IOSF_MBI if X86 + help + This selects support for ACPI enumerated SDHCI controllers, + identified by ACPI Compatibility ID PNP0D40 or specific +--- a/drivers/mmc/host/sdhci-acpi.c ++++ b/drivers/mmc/host/sdhci-acpi.c +@@ -41,6 +41,11 @@ + #include + #include + ++#ifdef CONFIG_X86 ++#include ++#include ++#endif ++ + #include "sdhci.h" + + enum { +@@ -146,6 +151,75 @@ static const struct sdhci_acpi_chip sdhc + .ops = &sdhci_acpi_ops_int, + }; + ++#ifdef CONFIG_X86 ++ ++static bool sdhci_acpi_byt(void) ++{ ++ static const struct x86_cpu_id byt[] = { ++ { X86_VENDOR_INTEL, 6, 0x37 }, ++ {} ++ }; ++ ++ return x86_match_cpu(byt); ++} ++ ++#define BYT_IOSF_SCCEP 0x63 ++#define BYT_IOSF_OCP_NETCTRL0 0x1078 ++#define BYT_IOSF_OCP_TIMEOUT_BASE GENMASK(10, 8) ++ ++static void sdhci_acpi_byt_setting(struct device *dev) ++{ ++ u32 val = 0; ++ ++ if (!sdhci_acpi_byt()) ++ return; ++ ++ if (iosf_mbi_read(BYT_IOSF_SCCEP, 0x06, BYT_IOSF_OCP_NETCTRL0, ++ &val)) { ++ dev_err(dev, "%s read error\n", __func__); ++ return; ++ } ++ ++ if (!(val & BYT_IOSF_OCP_TIMEOUT_BASE)) ++ return; ++ ++ val &= ~BYT_IOSF_OCP_TIMEOUT_BASE; ++ ++ if (iosf_mbi_write(BYT_IOSF_SCCEP, 0x07, BYT_IOSF_OCP_NETCTRL0, ++ val)) { ++ dev_err(dev, "%s write error\n", __func__); ++ return; ++ } ++ ++ dev_dbg(dev, "%s completed\n", __func__); ++} ++ ++static bool sdhci_acpi_byt_defer(struct device *dev) ++{ ++ if (!sdhci_acpi_byt()) ++ return false; ++ ++ if (!iosf_mbi_available()) ++ return true; ++ ++ sdhci_acpi_byt_setting(dev); ++ ++ return false; ++} ++ ++#else ++ ++static inline void sdhci_acpi_byt_setting(struct device *dev) ++{ ++} ++ ++static inline bool sdhci_acpi_byt_defer(struct device *dev) ++{ ++ return false; ++} ++ ++#endif ++ + static int bxt_get_cd(struct mmc_host *mmc) + { + int gpio_cd = mmc_gpio_get_cd(mmc); +@@ -337,6 +411,9 @@ static int sdhci_acpi_probe(struct platf + if (acpi_bus_get_status(device) || !device->status.present) + return -ENODEV; + ++ if (sdhci_acpi_byt_defer(dev)) ++ return -EPROBE_DEFER; ++ + hid = acpi_device_hid(device); + uid = device->pnp.unique_id; + +@@ -460,6 +537,8 @@ static int sdhci_acpi_resume(struct devi + { + struct sdhci_acpi_host *c = dev_get_drvdata(dev); + ++ sdhci_acpi_byt_setting(&c->pdev->dev); ++ + return sdhci_resume_host(c->host); + } + +@@ -483,6 +562,8 @@ static int sdhci_acpi_runtime_resume(str + { + struct sdhci_acpi_host *c = dev_get_drvdata(dev); + ++ sdhci_acpi_byt_setting(&c->pdev->dev); ++ + return sdhci_runtime_resume_host(c->host); + } + diff --git a/queue-4.4/nvme-don-t-unmap-controller-registers-on-reset.patch b/queue-4.4/nvme-don-t-unmap-controller-registers-on-reset.patch new file mode 100644 index 00000000000..27cafb26ad9 --- /dev/null +++ b/queue-4.4/nvme-don-t-unmap-controller-registers-on-reset.patch @@ -0,0 +1,225 @@ +From b00a726a9fd82ddd4c10344e46f0d371e1674303 Mon Sep 17 00:00:00 2001 +From: Keith Busch +Date: Wed, 24 Feb 2016 09:15:52 -0700 +Subject: NVMe: Don't unmap controller registers on reset + +From: Keith Busch + +Commit b00a726a9fd82ddd4c10344e46f0d371e1674303 upstream. + +Unmapping the registers on reset or shutdown is not necessary. Keeping +the mapping simplifies reset handling. + +This was backported to 4.4 stable tree because it prevents a race +between the reset_work and the shutdown hook, that may provoke the Oops +below, in the nvme_wait_ready function. + +The Oops is easily reproducible on systems that will kexec/reboot +immediately after booting, which is actually the common use case for +kexec based bootloaders, like Petitboot. This patch removes the +unnecessary early unmapping of the PCI configuration in the shutdown +hook, allowing a proper handling of the reset work. + +Unable to handle kernel paging request for data at address 0x0000001c +Faulting instruction address: 0xd000000000720b38 +cpu 0x1b: Vector: 300 (Data Access) at [c000007f7a9a38a0] + pc: d000000000720b38: nvme_wait_ready+0x50/0x120 [nvme] + lr: d000000000720b7c: nvme_wait_ready+0x94/0x120 [nvme] + sp: c000007f7a9a3b20 + msr: 9000000000009033 + dar: 1c + dsisr: 40000000 + current = 0xc000007f7a926c80 + paca = 0xc00000000fe85100 softe: 0 irq_happened: 0x01 + pid = 2608, comm = kworker/27:1 +enter ? for help +[c000007f7a9a3bb0] d00000000072572c nvme_setup_io_queues+0xc08/0x1218 [nvme] +[c000007f7a9a3c70] c00000000006bbd8 process_one_work+0x228/0x378 +[c000007f7a9a3d00] c00000000006c050 worker_thread+0x2e0/0x420 +[c000007f7a9a3d80] c00000000007161c kthread+0xfc/0x108 +[c000007f7a9a3e30] c0000000000094b4 ret_from_kernel_thread+0x5c/0xa8 + +Signed-off-by: Keith Busch +Reviewed-by: Johannes Thumshirn +Reviewed-by: Christoph Hellwig +Signed-off-by: Jens Axboe +Signed-off-by: Gabriel Krisman Bertazi + [Backport to v4.4.y] +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvme/host/pci.c | 71 +++++++++++++++++++++++++++++------------------- + 1 file changed, 43 insertions(+), 28 deletions(-) + +--- a/drivers/nvme/host/pci.c ++++ b/drivers/nvme/host/pci.c +@@ -2672,10 +2672,10 @@ static int nvme_dev_add(struct nvme_dev + return 0; + } + +-static int nvme_dev_map(struct nvme_dev *dev) ++static int nvme_pci_enable(struct nvme_dev *dev) + { + u64 cap; +- int bars, result = -ENOMEM; ++ int result = -ENOMEM; + struct pci_dev *pdev = to_pci_dev(dev->dev); + + if (pci_enable_device_mem(pdev)) +@@ -2683,24 +2683,14 @@ static int nvme_dev_map(struct nvme_dev + + dev->entry[0].vector = pdev->irq; + pci_set_master(pdev); +- bars = pci_select_bars(pdev, IORESOURCE_MEM); +- if (!bars) +- goto disable_pci; +- +- if (pci_request_selected_regions(pdev, bars, "nvme")) +- goto disable_pci; + + if (dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64)) && + dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(32))) + goto disable; + +- dev->bar = ioremap(pci_resource_start(pdev, 0), 8192); +- if (!dev->bar) +- goto disable; +- + if (readl(&dev->bar->csts) == -1) { + result = -ENODEV; +- goto unmap; ++ goto disable; + } + + /* +@@ -2710,7 +2700,7 @@ static int nvme_dev_map(struct nvme_dev + if (!pdev->irq) { + result = pci_enable_msix(pdev, dev->entry, 1); + if (result < 0) +- goto unmap; ++ goto disable; + } + + cap = lo_hi_readq(&dev->bar->cap); +@@ -2734,18 +2724,21 @@ static int nvme_dev_map(struct nvme_dev + + return 0; + +- unmap: +- iounmap(dev->bar); +- dev->bar = NULL; + disable: + pci_release_regions(pdev); +- disable_pci: +- pci_disable_device(pdev); ++ + return result; + } + + static void nvme_dev_unmap(struct nvme_dev *dev) + { ++ if (dev->bar) ++ iounmap(dev->bar); ++ pci_release_regions(to_pci_dev(dev->dev)); ++} ++ ++static void nvme_pci_disable(struct nvme_dev *dev) ++{ + struct pci_dev *pdev = to_pci_dev(dev->dev); + + if (pdev->msi_enabled) +@@ -2753,12 +2746,6 @@ static void nvme_dev_unmap(struct nvme_d + else if (pdev->msix_enabled) + pci_disable_msix(pdev); + +- if (dev->bar) { +- iounmap(dev->bar); +- dev->bar = NULL; +- pci_release_regions(pdev); +- } +- + if (pci_is_enabled(pdev)) + pci_disable_device(pdev); + } +@@ -2962,7 +2949,7 @@ static void nvme_dev_shutdown(struct nvm + + nvme_dev_list_remove(dev); + +- if (dev->bar) { ++ if (pci_is_enabled(to_pci_dev(dev->dev))) { + nvme_freeze_queues(dev); + csts = readl(&dev->bar->csts); + } +@@ -2976,7 +2963,7 @@ static void nvme_dev_shutdown(struct nvm + nvme_shutdown_ctrl(dev); + nvme_disable_queue(dev, 0); + } +- nvme_dev_unmap(dev); ++ nvme_pci_disable(dev); + + for (i = dev->queue_count - 1; i >= 0; i--) + nvme_clear_queue(dev->queues[i]); +@@ -3136,7 +3123,7 @@ static void nvme_probe_work(struct work_ + bool start_thread = false; + int result; + +- result = nvme_dev_map(dev); ++ result = nvme_pci_enable(dev); + if (result) + goto out; + +@@ -3292,6 +3279,27 @@ static ssize_t nvme_sysfs_reset(struct d + } + static DEVICE_ATTR(reset_controller, S_IWUSR, NULL, nvme_sysfs_reset); + ++static int nvme_dev_map(struct nvme_dev *dev) ++{ ++ int bars; ++ struct pci_dev *pdev = to_pci_dev(dev->dev); ++ ++ bars = pci_select_bars(pdev, IORESOURCE_MEM); ++ if (!bars) ++ return -ENODEV; ++ if (pci_request_selected_regions(pdev, bars, "nvme")) ++ return -ENODEV; ++ ++ dev->bar = ioremap(pci_resource_start(pdev, 0), 8192); ++ if (!dev->bar) ++ goto release; ++ ++ return 0; ++release: ++ pci_release_regions(pdev); ++ return -ENODEV; ++} ++ + static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) + { + int node, result = -ENOMEM; +@@ -3317,6 +3325,11 @@ static int nvme_probe(struct pci_dev *pd + INIT_WORK(&dev->reset_work, nvme_reset_work); + dev->dev = get_device(&pdev->dev); + pci_set_drvdata(pdev, dev); ++ ++ result = nvme_dev_map(dev); ++ if (result) ++ goto free; ++ + result = nvme_set_instance(dev); + if (result) + goto put_pci; +@@ -3355,6 +3368,7 @@ static int nvme_probe(struct pci_dev *pd + nvme_release_instance(dev); + put_pci: + put_device(dev->dev); ++ nvme_dev_unmap(dev); + free: + kfree(dev->queues); + kfree(dev->entry); +@@ -3398,6 +3412,7 @@ static void nvme_remove(struct pci_dev * + nvme_free_queues(dev, 0); + nvme_release_cmb(dev); + nvme_release_prp_pools(dev); ++ nvme_dev_unmap(dev); + kref_put(&dev->kref, nvme_free_dev); + } + diff --git a/queue-4.4/pci-add-netronome-nfp4000-pf-device-id.patch b/queue-4.4/pci-add-netronome-nfp4000-pf-device-id.patch new file mode 100644 index 00000000000..506085de75f --- /dev/null +++ b/queue-4.4/pci-add-netronome-nfp4000-pf-device-id.patch @@ -0,0 +1,30 @@ +From 69874ec233871a62e1bc8c89e643993af93a8630 Mon Sep 17 00:00:00 2001 +From: Simon Horman +Date: Fri, 11 Dec 2015 11:30:11 +0900 +Subject: PCI: Add Netronome NFP4000 PF device ID + +From: Simon Horman + +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 +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/pci_ids.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -2498,6 +2498,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 + diff --git a/queue-4.4/pci-add-netronome-vendor-and-device-ids.patch b/queue-4.4/pci-add-netronome-vendor-and-device-ids.patch new file mode 100644 index 00000000000..67444f0cfba --- /dev/null +++ b/queue-4.4/pci-add-netronome-vendor-and-device-ids.patch @@ -0,0 +1,37 @@ +From a755e169031dac9ebaed03302c4921687c271d62 Mon Sep 17 00:00:00 2001 +From: "Jason S. McMullan" +Date: Wed, 30 Sep 2015 15:35:06 +0900 +Subject: PCI: Add Netronome vendor and device IDs + +From: Jason S. McMullan + +commit a755e169031dac9ebaed03302c4921687c271d62 upstream. + +Device IDs for the Netronome NFP3200, NFP3240, NFP6000, and NFP6000 SR-IOV +devices. + +Signed-off-by: Jason S. McMullan +[simon: edited changelog] +Signed-off-by: Simon Horman +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/pci_ids.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -2495,6 +2495,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 diff --git a/queue-4.4/pci-limit-config-space-size-for-netronome-nfp4000.patch b/queue-4.4/pci-limit-config-space-size-for-netronome-nfp4000.patch new file mode 100644 index 00000000000..8be60bc3b72 --- /dev/null +++ b/queue-4.4/pci-limit-config-space-size-for-netronome-nfp4000.patch @@ -0,0 +1,38 @@ +From c2e771b02792d222cbcd9617fe71482a64f52647 Mon Sep 17 00:00:00 2001 +From: Simon Horman +Date: Fri, 11 Dec 2015 11:30:12 +0900 +Subject: PCI: Limit config space size for Netronome NFP4000 + +From: Simon Horman + +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 +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -295,6 +295,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); + diff --git a/queue-4.4/pci-limit-config-space-size-for-netronome-nfp6000-family.patch b/queue-4.4/pci-limit-config-space-size-for-netronome-nfp6000-family.patch new file mode 100644 index 00000000000..a57d660f01f --- /dev/null +++ b/queue-4.4/pci-limit-config-space-size-for-netronome-nfp6000-family.patch @@ -0,0 +1,45 @@ +From 9f33a2ae59f24452c1076749deb615bccd435ca9 Mon Sep 17 00:00:00 2001 +From: "Jason S. McMullan" +Date: Wed, 30 Sep 2015 15:35:07 +0900 +Subject: PCI: Limit config space size for Netronome NFP6000 family + +From: Jason S. McMullan + +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 +[simon: edited changelog] +Signed-off-by: Simon Horman +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/quirks.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -287,6 +287,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) + { diff --git a/queue-4.4/pci-support-pcie-devices-with-short-cfg_size.patch b/queue-4.4/pci-support-pcie-devices-with-short-cfg_size.patch new file mode 100644 index 00000000000..4db607b011d --- /dev/null +++ b/queue-4.4/pci-support-pcie-devices-with-short-cfg_size.patch @@ -0,0 +1,75 @@ +From c20aecf6963d1273d8f6d61c042b4845441ca592 Mon Sep 17 00:00:00 2001 +From: "Jason S. McMullan" +Date: Wed, 30 Sep 2015 15:35:05 +0900 +Subject: PCI: Support PCIe devices with short cfg_size + +From: Jason S. McMullan + +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 +[simon: edited changelog] +Signed-off-by: Simon Horman +[bhelgaas: more changelog edits] +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -1372,10 +1372,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; + +@@ -1427,10 +1427,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; + } +@@ -1464,10 +1464,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); + diff --git a/queue-4.4/series b/queue-4.4/series index d24e3bffba9..20a3123ec9e 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -14,3 +14,13 @@ vfio-pci-fix-null-pointer-oops-in-error-interrupt-setup-handling.patch perf-intel-pt-fix-occasional-decoding-errors-when-tracing-system-wide.patch libnvdimm-nd_blk-mask-off-reserved-status-bits.patch alsa-hda-manage-power-well-properly-for-resume.patch +nvme-don-t-unmap-controller-registers-on-reset.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 +mmc-sdhci-acpi-reduce-baytrail-emmc-sd-sdio-hangs.patch +acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch +acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch +um-don-t-discard-.text.exit-section.patch diff --git a/queue-4.4/um-don-t-discard-.text.exit-section.patch b/queue-4.4/um-don-t-discard-.text.exit-section.patch new file mode 100644 index 00000000000..88d746f6bc3 --- /dev/null +++ b/queue-4.4/um-don-t-discard-.text.exit-section.patch @@ -0,0 +1,42 @@ +From dad2232844073295c64e9cc2d734a0ade043e0f6 Mon Sep 17 00:00:00 2001 +From: Andrey Ryabinin +Date: Wed, 17 Aug 2016 18:10:11 +0300 +Subject: um: Don't discard .text.exit section + +From: Andrey Ryabinin + +commit dad2232844073295c64e9cc2d734a0ade043e0f6 upstream. + +Commit e41f501d3912 ("vmlinux.lds: account for destructor sections") +added '.text.exit' to EXIT_TEXT which is discarded at link time by default. +This breaks compilation of UML: + `.text.exit' referenced in section `.fini_array' of + /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o): + defined in discarded section `.text.exit' of + /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o) + +Apparently UML doesn't want to discard exit text, so let's place all EXIT_TEXT +sections in .exit.text. + +Fixes: e41f501d3912 ("vmlinux.lds: account for destructor sections") +Reported-by: Stefan Traby +Signed-off-by: Andrey Ryabinin +Acked-by: Dmitry Vyukov +Signed-off-by: Richard Weinberger +Signed-off-by: Greg Kroah-Hartman + +--- + arch/um/include/asm/common.lds.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/um/include/asm/common.lds.S ++++ b/arch/um/include/asm/common.lds.S +@@ -81,7 +81,7 @@ + .altinstr_replacement : { *(.altinstr_replacement) } + /* .exit.text is discard at runtime, not link time, to deal with references + from .altinstructions and .eh_frame */ +- .exit.text : { *(.exit.text) } ++ .exit.text : { EXIT_TEXT } + .exit.data : { *(.exit.data) } + + .preinit_array : {