]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2016 23:21:09 +0000 (16:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2016 23:21:09 +0000 (16:21 -0700)
added patches:
edac-i7core-sb_edac-don-t-return-notify_bad-from-mce_decoder-callback.patch
i2c-cpm-fix-build-break-due-to-incompatible-pointer-types.patch
i2c-exynos5-fix-possible-abba-deadlock-by-keeping-i2c-clock-prepared.patch

queue-3.14/edac-i7core-sb_edac-don-t-return-notify_bad-from-mce_decoder-callback.patch [new file with mode: 0644]
queue-3.14/i2c-cpm-fix-build-break-due-to-incompatible-pointer-types.patch [new file with mode: 0644]
queue-3.14/i2c-exynos5-fix-possible-abba-deadlock-by-keeping-i2c-clock-prepared.patch [new file with mode: 0644]
queue-3.14/series

diff --git a/queue-3.14/edac-i7core-sb_edac-don-t-return-notify_bad-from-mce_decoder-callback.patch b/queue-3.14/edac-i7core-sb_edac-don-t-return-notify_bad-from-mce_decoder-callback.patch
new file mode 100644 (file)
index 0000000..9f2fbed
--- /dev/null
@@ -0,0 +1,51 @@
+From c4fc1956fa31003bfbe4f597e359d751568e2954 Mon Sep 17 00:00:00 2001
+From: Tony Luck <tony.luck@intel.com>
+Date: Fri, 29 Apr 2016 15:42:25 +0200
+Subject: EDAC: i7core, sb_edac: Don't return NOTIFY_BAD from mce_decoder callback
+
+From: Tony Luck <tony.luck@intel.com>
+
+commit c4fc1956fa31003bfbe4f597e359d751568e2954 upstream.
+
+Both of these drivers can return NOTIFY_BAD, but this terminates
+processing other callbacks that were registered later on the chain.
+Since the driver did nothing to log the error it seems wrong to prevent
+other interested parties from seeing it. E.g. neither of them had even
+bothered to check the type of the error to see if it was a memory error
+before the return NOTIFY_BAD.
+
+Signed-off-by: Tony Luck <tony.luck@intel.com>
+Acked-by: Aristeu Rozanski <aris@redhat.com>
+Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
+Cc: linux-edac <linux-edac@vger.kernel.org>
+Link: http://lkml.kernel.org/r/72937355dd92318d2630979666063f8a2853495b.1461864507.git.tony.luck@intel.com
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/edac/i7core_edac.c |    2 +-
+ drivers/edac/sb_edac.c     |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/edac/i7core_edac.c
++++ b/drivers/edac/i7core_edac.c
+@@ -1878,7 +1878,7 @@ static int i7core_mce_check_error(struct
+       i7_dev = get_i7core_dev(mce->socketid);
+       if (!i7_dev)
+-              return NOTIFY_BAD;
++              return NOTIFY_DONE;
+       mci = i7_dev->mci;
+       pvt = mci->pvt_info;
+--- a/drivers/edac/sb_edac.c
++++ b/drivers/edac/sb_edac.c
+@@ -1840,7 +1840,7 @@ static int sbridge_mce_check_error(struc
+       mci = get_mci_for_node_id(mce->socketid);
+       if (!mci)
+-              return NOTIFY_BAD;
++              return NOTIFY_DONE;
+       pvt = mci->pvt_info;
+       /*
diff --git a/queue-3.14/i2c-cpm-fix-build-break-due-to-incompatible-pointer-types.patch b/queue-3.14/i2c-cpm-fix-build-break-due-to-incompatible-pointer-types.patch
new file mode 100644 (file)
index 0000000..af531ad
--- /dev/null
@@ -0,0 +1,40 @@
+From 609d5a1b2b35bb62b4b3750396e55453160c2a17 Mon Sep 17 00:00:00 2001
+From: Michael Ellerman <mpe@ellerman.id.au>
+Date: Wed, 13 Apr 2016 13:59:14 +1000
+Subject: i2c: cpm: Fix build break due to incompatible pointer types
+
+From: Michael Ellerman <mpe@ellerman.id.au>
+
+commit 609d5a1b2b35bb62b4b3750396e55453160c2a17 upstream.
+
+Since commit ea8daa7b9784 ("kbuild: Add option to turn incompatible
+pointer check into error"), assignments from an incompatible pointer
+types have become a hard error, eg:
+
+  drivers/i2c/busses/i2c-cpm.c:545:91: error: passing argument 3 of
+  'dma_alloc_coherent' from incompatible pointer type
+
+Fix the build break by converting txdma & rxdma to dma_addr_t.
+
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Fixes: ea8daa7b9784
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-cpm.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-cpm.c
++++ b/drivers/i2c/busses/i2c-cpm.c
+@@ -120,8 +120,8 @@ struct cpm_i2c {
+       cbd_t __iomem *rbase;
+       u_char *txbuf[CPM_MAXBD];
+       u_char *rxbuf[CPM_MAXBD];
+-      u32 txdma[CPM_MAXBD];
+-      u32 rxdma[CPM_MAXBD];
++      dma_addr_t txdma[CPM_MAXBD];
++      dma_addr_t rxdma[CPM_MAXBD];
+ };
+ static irqreturn_t cpm_i2c_interrupt(int irq, void *dev_id)
diff --git a/queue-3.14/i2c-exynos5-fix-possible-abba-deadlock-by-keeping-i2c-clock-prepared.patch b/queue-3.14/i2c-exynos5-fix-possible-abba-deadlock-by-keeping-i2c-clock-prepared.patch
new file mode 100644 (file)
index 0000000..434ad71
--- /dev/null
@@ -0,0 +1,137 @@
+From 10ff4c5239a137abfc896ec73ef3d15a0f86a16a Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <javier@osg.samsung.com>
+Date: Sat, 16 Apr 2016 21:14:52 -0400
+Subject: i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared
+
+From: Javier Martinez Canillas <javier@osg.samsung.com>
+
+commit 10ff4c5239a137abfc896ec73ef3d15a0f86a16a upstream.
+
+The exynos5 I2C controller driver always prepares and enables a clock
+before using it and then disables unprepares it when the clock is not
+used anymore.
+
+But this can cause a possible ABBA deadlock in some scenarios since a
+driver that uses regmap to access its I2C registers, will first grab
+the regmap lock and then the I2C xfer function will grab the prepare
+lock when preparing the I2C clock. But since the clock driver also
+uses regmap for I2C accesses, preparing a clock will first grab the
+prepare lock and then the regmap lock when using the regmap API.
+
+An example of this happens on the Exynos5422 Odroid XU4 board where a
+s2mps11 PMIC is used and both the s2mps11 regulators and clk drivers
+share the same I2C regmap.
+
+The possible deadlock is reported by the kernel lockdep:
+
+  Possible unsafe locking scenario:
+
+        CPU0                    CPU1
+        ----                    ----
+   lock(sec_core:428:(regmap)->lock);
+                                lock(prepare_lock);
+                                lock(sec_core:428:(regmap)->lock);
+   lock(prepare_lock);
+
+  *** DEADLOCK ***
+
+Fix it by leaving the code prepared on probe and use {en,dis}able in
+the I2C transfer function.
+
+This patch is similar to commit 34e81ad5f0b6 ("i2c: s3c2410: fix ABBA
+deadlock by keeping clock prepared") that fixes the same bug in other
+driver for an I2C controller found in Samsung SoCs.
+
+Reported-by: Anand Moon <linux.amoon@gmail.com>
+Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
+Reviewed-by: Anand Moon <linux.amoon@gmail.com>
+Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-exynos5.c |   24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-exynos5.c
++++ b/drivers/i2c/busses/i2c-exynos5.c
+@@ -574,7 +574,9 @@ static int exynos5_i2c_xfer(struct i2c_a
+               return -EIO;
+       }
+-      clk_prepare_enable(i2c->clk);
++      ret = clk_enable(i2c->clk);
++      if (ret)
++              return ret;
+       for (i = 0; i < num; i++, msgs++) {
+               stop = (i == num - 1);
+@@ -598,7 +600,7 @@ static int exynos5_i2c_xfer(struct i2c_a
+       }
+  out:
+-      clk_disable_unprepare(i2c->clk);
++      clk_disable(i2c->clk);
+       return ret;
+ }
+@@ -652,7 +654,9 @@ static int exynos5_i2c_probe(struct plat
+               return -ENOENT;
+       }
+-      clk_prepare_enable(i2c->clk);
++      ret = clk_prepare_enable(i2c->clk);
++      if (ret)
++              return ret;
+       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       i2c->regs = devm_ioremap_resource(&pdev->dev, mem);
+@@ -701,6 +705,10 @@ static int exynos5_i2c_probe(struct plat
+       platform_set_drvdata(pdev, i2c);
++      clk_disable(i2c->clk);
++
++      return 0;
++
+  err_clk:
+       clk_disable_unprepare(i2c->clk);
+       return ret;
+@@ -712,6 +720,8 @@ static int exynos5_i2c_remove(struct pla
+       i2c_del_adapter(&i2c->adap);
++      clk_unprepare(i2c->clk);
++
+       return 0;
+ }
+@@ -722,6 +732,8 @@ static int exynos5_i2c_suspend_noirq(str
+       i2c->suspended = 1;
++      clk_unprepare(i2c->clk);
++
+       return 0;
+ }
+@@ -731,7 +743,9 @@ static int exynos5_i2c_resume_noirq(stru
+       struct exynos5_i2c *i2c = platform_get_drvdata(pdev);
+       int ret = 0;
+-      clk_prepare_enable(i2c->clk);
++      ret = clk_prepare_enable(i2c->clk);
++      if (ret)
++              return ret;
+       ret = exynos5_hsi2c_clock_setup(i2c);
+       if (ret) {
+@@ -740,7 +754,7 @@ static int exynos5_i2c_resume_noirq(stru
+       }
+       exynos5_i2c_init(i2c);
+-      clk_disable_unprepare(i2c->clk);
++      clk_disable(i2c->clk);
+       i2c->suspended = 0;
+       return 0;
index 0fcde362a73fce7136b21923447d8298be4d796b..dd6427d7f6b4b27925fdc8f83ba2bbe5f865f900 100644 (file)
@@ -11,3 +11,6 @@ crypto-gcm-fix-rfc4543-decryption-crash.patch
 nl80211-check-netlink-protocol-in-socket-release-notification.patch
 input-gtco-fix-crash-on-detecting-device-without-endpoints.patch
 pinctrl-single-fix-pcs_parse_bits_in_pinctrl_entry-to-use-__ffs-than-ffs.patch
+i2c-cpm-fix-build-break-due-to-incompatible-pointer-types.patch
+i2c-exynos5-fix-possible-abba-deadlock-by-keeping-i2c-clock-prepared.patch
+edac-i7core-sb_edac-don-t-return-notify_bad-from-mce_decoder-callback.patch