From 2cd3c05be258831d4fc3ce97cd6c889609644311 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 9 Jun 2014 15:47:36 -0700 Subject: [PATCH] 3.14-stable patches added patches: gpio-mcp23s08-bug-fix-of-spi-device-tree-registration.patch iommu-vt-d-fix-missing-iotlb-flush-in-intel_iommu_unmap.patch --- ...-fix-of-spi-device-tree-registration.patch | 54 +++++++++++++++++ ...ing-iotlb-flush-in-intel_iommu_unmap.patch | 59 +++++++++++++++++++ queue-3.14/series | 2 + 3 files changed, 115 insertions(+) create mode 100644 queue-3.14/gpio-mcp23s08-bug-fix-of-spi-device-tree-registration.patch create mode 100644 queue-3.14/iommu-vt-d-fix-missing-iotlb-flush-in-intel_iommu_unmap.patch diff --git a/queue-3.14/gpio-mcp23s08-bug-fix-of-spi-device-tree-registration.patch b/queue-3.14/gpio-mcp23s08-bug-fix-of-spi-device-tree-registration.patch new file mode 100644 index 00000000000..9d4bf9170cf --- /dev/null +++ b/queue-3.14/gpio-mcp23s08-bug-fix-of-spi-device-tree-registration.patch @@ -0,0 +1,54 @@ +From 99e4b98dbe3ad1fe38a74d12c3b8d44a55930de4 Mon Sep 17 00:00:00 2001 +From: Michael Welling +Date: Wed, 16 Apr 2014 20:00:24 -0500 +Subject: gpio: mcp23s08: Bug fix of SPI device tree registration. + +From: Michael Welling + +commit 99e4b98dbe3ad1fe38a74d12c3b8d44a55930de4 upstream. + +The chips variable needs to be incremented for each chip that is +found in the spi_present_mask when registering via device tree. +Without this and the checking a negative index is passed to the +data->chip array in a subsequent loop. + +Signed-off-by: Michael Welling +Acked-by: Peter Korsgaard +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-mcp23s08.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/gpio/gpio-mcp23s08.c ++++ b/drivers/gpio/gpio-mcp23s08.c +@@ -895,8 +895,11 @@ static int mcp23s08_probe(struct spi_dev + return -ENODEV; + } + +- for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) ++ for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) { + pullups[addr] = 0; ++ if (spi_present_mask & (1 << addr)) ++ chips++; ++ } + } else { + type = spi_get_device_id(spi)->driver_data; + pdata = dev_get_platdata(&spi->dev); +@@ -919,12 +922,12 @@ static int mcp23s08_probe(struct spi_dev + pullups[addr] = pdata->chip[addr].pullups; + } + +- if (!chips) +- return -ENODEV; +- + base = pdata->base; + } + ++ if (!chips) ++ return -ENODEV; ++ + data = kzalloc(sizeof *data + chips * sizeof(struct mcp23s08), + GFP_KERNEL); + if (!data) diff --git a/queue-3.14/iommu-vt-d-fix-missing-iotlb-flush-in-intel_iommu_unmap.patch b/queue-3.14/iommu-vt-d-fix-missing-iotlb-flush-in-intel_iommu_unmap.patch new file mode 100644 index 00000000000..890a6b35493 --- /dev/null +++ b/queue-3.14/iommu-vt-d-fix-missing-iotlb-flush-in-intel_iommu_unmap.patch @@ -0,0 +1,59 @@ +From dwmw2@infradead.org Mon Jun 9 15:43:20 2014 +From: David Woodhouse +Date: Mon, 09 Jun 2014 14:09:53 +0100 +Subject: [stable PATCH] iommu/vt-d: Fix missing IOTLB flush in intel_iommu_unmap() +To: stable@kernel.org +Cc: iommu@lists.linux-foundation.org +Message-ID: <1402319285.7595.9.camel@i7.infradead.org> + +From: David Woodhouse + +Based on commit ea8ea460c9ace60bbb5ac6e5521d637d5c15293d upstream + +This missing IOTLB flush was added as a minor, inconsequential bug-fix +in commit ea8ea460c ("iommu/vt-d: Clean up and fix page table clear/free +behaviour") in 3.15. It wasn't originally intended for -stable but a +couple of users have reported issues which turn out to be fixed by +adding the missing flush. + +Signed-off-by: David Woodhouse +--- +For 3.14 and earlier. As noted, this fix is in 3.15 already. + + drivers/iommu/intel-iommu.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +--- a/drivers/iommu/intel-iommu.c ++++ b/drivers/iommu/intel-iommu.c +@@ -4075,7 +4075,7 @@ static size_t intel_iommu_unmap(struct i + unsigned long iova, size_t size) + { + struct dmar_domain *dmar_domain = domain->priv; +- int order; ++ int order, iommu_id; + + order = dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT, + (iova + size - 1) >> VTD_PAGE_SHIFT); +@@ -4083,6 +4083,22 @@ static size_t intel_iommu_unmap(struct i + if (dmar_domain->max_addr == iova + size) + dmar_domain->max_addr = iova; + ++ for_each_set_bit(iommu_id, dmar_domain->iommu_bmp, g_num_of_iommus) { ++ struct intel_iommu *iommu = g_iommus[iommu_id]; ++ int num, ndomains; ++ ++ /* ++ * find bit position of dmar_domain ++ */ ++ ndomains = cap_ndoms(iommu->cap); ++ for_each_set_bit(num, iommu->domain_ids, ndomains) { ++ if (iommu->domains[num] == dmar_domain) ++ iommu_flush_iotlb_psi(iommu, num, ++ iova >> VTD_PAGE_SHIFT, ++ 1 << order, 0); ++ } ++ } ++ + return PAGE_SIZE << order; + } + diff --git a/queue-3.14/series b/queue-3.14/series index 8ea91257e9c..9be17155005 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -74,3 +74,5 @@ netfilter-fix-potential-use-after-free-in-ip6_route_me_harder.patch netfilter-nfnetlink-fix-use-after-free-when-it-fails-to-process-batch.patch drm-i915-add-unregister-callback-to-connector.patch drm-i915-dp-fix-order-of-dp-aux-i2c-device-cleanup.patch +gpio-mcp23s08-bug-fix-of-spi-device-tree-registration.patch +iommu-vt-d-fix-missing-iotlb-flush-in-intel_iommu_unmap.patch -- 2.47.3