]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2016 18:22:13 +0000 (11:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2016 18:22:13 +0000 (11:22 -0700)
added patches:
regulator-core-ensure-we-lock-all-regulators.patch
regulator-core-fix-nested-locking-of-supplies.patch
regulator-core-fix-regulator_lock_supply-regression.patch
revert-regulator-core-fix-nested-locking-of-supplies.patch

queue-4.4/mtd-nand-pxa3xx_nand-fix-dmaengine-initialization.patch [deleted file]
queue-4.4/regulator-core-ensure-we-lock-all-regulators.patch [new file with mode: 0644]
queue-4.4/regulator-core-fix-nested-locking-of-supplies.patch [new file with mode: 0644]
queue-4.4/regulator-core-fix-regulator_lock_supply-regression.patch [new file with mode: 0644]
queue-4.4/revert-regulator-core-fix-nested-locking-of-supplies.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/mtd-nand-pxa3xx_nand-fix-dmaengine-initialization.patch b/queue-4.4/mtd-nand-pxa3xx_nand-fix-dmaengine-initialization.patch
deleted file mode 100644 (file)
index 5d32ece..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 9097103f06332d099c5ab06d1e7f22f4bcaca6e2 Mon Sep 17 00:00:00 2001
-From: Robert Jarzmik <robert.jarzmik@free.fr>
-Date: Fri, 12 Feb 2016 23:29:04 +0100
-Subject: mtd: nand: pxa3xx_nand: fix dmaengine initialization
-
-From: Robert Jarzmik <robert.jarzmik@free.fr>
-
-commit 9097103f06332d099c5ab06d1e7f22f4bcaca6e2 upstream.
-
-When the driver is initialized in a pure device-tree platform, the
-driver's probe fails allocating the dma channel :
-[  525.624435] pxa3xx-nand 43100000.nand: no resource defined for data DMA
-[  525.632088] pxa3xx-nand 43100000.nand: alloc nand resource failed
-
-The reason is that the DMA IO resource is not acquired through platform
-resources but by OF bindings.
-
-Fix this by ensuring that DMA IO resources are only queried in the non
-device-tree case.
-
-Fixes: 8f5ba31aa565 ("mtd: nand: pxa3xx-nand: switch to dmaengine")
-Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
-Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- drivers/mtd/nand/pxa3xx_nand.c |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/mtd/nand/pxa3xx_nand.c
-+++ b/drivers/mtd/nand/pxa3xx_nand.c
-@@ -1750,7 +1750,7 @@ static int alloc_nand_resource(struct pl
-       if (ret < 0)
-               return ret;
--      if (use_dma) {
-+      if (!np && use_dma) {
-               r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-               if (r == NULL) {
-                       dev_err(&pdev->dev,
diff --git a/queue-4.4/regulator-core-ensure-we-lock-all-regulators.patch b/queue-4.4/regulator-core-ensure-we-lock-all-regulators.patch
new file mode 100644 (file)
index 0000000..f32fa02
--- /dev/null
@@ -0,0 +1,34 @@
+From 49a6bb7a1c0963f260e4b0dcc2c0e56ec65a28b2 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@kernel.org>
+Date: Tue, 1 Dec 2015 15:51:52 +0000
+Subject: regulator: core: Ensure we lock all regulators
+
+From: Mark Brown <broonie@kernel.org>
+
+commit 49a6bb7a1c0963f260e4b0dcc2c0e56ec65a28b2 upstream.
+
+The latest workaround for the lockdep interface's not using the second
+argument of mutex_lock_nested() changed the loop missed locking the last
+regulator due to a thinko with the loop termination condition exiting
+one regulator too soon.
+
+Reported-by: Tyler Baker <tyler.baker@linaro.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/regulator/core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -141,7 +141,7 @@ static void regulator_lock_supply(struct
+       int i;
+       mutex_lock(&rdev->mutex);
+-      for (i = 1; rdev->supply; rdev = rdev->supply->rdev, i++)
++      for (i = 1; rdev; rdev = rdev->supply->rdev, i++)
+               mutex_lock_nested(&rdev->mutex, i);
+ }
diff --git a/queue-4.4/regulator-core-fix-nested-locking-of-supplies.patch b/queue-4.4/regulator-core-fix-nested-locking-of-supplies.patch
new file mode 100644 (file)
index 0000000..0d91435
--- /dev/null
@@ -0,0 +1,58 @@
+From 70a7fb80e85ae7f78f8e90cec3fbd862ea6a4d4b Mon Sep 17 00:00:00 2001
+From: Thierry Reding <treding@nvidia.com>
+Date: Wed, 2 Dec 2015 16:54:50 +0100
+Subject: regulator: core: Fix nested locking of supplies
+
+From: Thierry Reding <treding@nvidia.com>
+
+commit 70a7fb80e85ae7f78f8e90cec3fbd862ea6a4d4b upstream.
+
+Commit fa731ac7ea04 ("regulator: core: avoid unused variable warning")
+introduced a subtle change in how supplies are locked. Where previously
+code was always locking the regulator of the current iteration, the new
+implementation only locks the regulator if it has a supply. For any
+given power tree that means that the root will never get locked.
+
+On the other hand the regulator_unlock_supply() will still release all
+the locks, which in turn causes the lock debugging code to warn about a
+mutex being unlocked which wasn't locked.
+
+Cc: Mark Brown <broonie@kernel.org>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Fixes: fa731ac7ea04 ("regulator: core: avoid unused variable warning")
+Signed-off-by: Thierry Reding <treding@nvidia.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/regulator/core.c |   11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -132,6 +132,14 @@ static bool have_full_constraints(void)
+       return has_full_constraints || of_have_populated_dt();
+ }
++static inline struct regulator_dev *rdev_get_supply(struct regulator_dev *rdev)
++{
++      if (rdev && rdev->supply)
++              return rdev->supply->rdev;
++
++      return NULL;
++}
++
+ /**
+  * regulator_lock_supply - lock a regulator and its supplies
+  * @rdev:         regulator source
+@@ -140,8 +148,7 @@ static void regulator_lock_supply(struct
+ {
+       int i;
+-      mutex_lock(&rdev->mutex);
+-      for (i = 1; rdev; rdev = rdev->supply->rdev, i++)
++      for (i = 0; rdev; rdev = rdev_get_supply(rdev), i++)
+               mutex_lock_nested(&rdev->mutex, i);
+ }
diff --git a/queue-4.4/regulator-core-fix-regulator_lock_supply-regression.patch b/queue-4.4/regulator-core-fix-regulator_lock_supply-regression.patch
new file mode 100644 (file)
index 0000000..22363f9
--- /dev/null
@@ -0,0 +1,45 @@
+From bb41897e38c53458a88b271f2fbcd905ee1f9584 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Fri, 27 Nov 2015 14:46:41 +0100
+Subject: regulator: core: fix regulator_lock_supply regression
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit bb41897e38c53458a88b271f2fbcd905ee1f9584 upstream.
+
+As noticed by Geert Uytterhoeven, my patch to avoid a harmless build warning
+in regulator_lock_supply() was total crap and introduced a real bug:
+
+> [ BUG: bad unlock balance detected! ]
+> kworker/u4:0/6 is trying to release lock (&rdev->mutex) at:
+> [<c0247b84>] regulator_set_voltage+0x38/0x50
+
+we still lock the regulator supplies, but not the actual regulators,
+so we are missing a lock, and the unlock is unbalanced.
+
+This rectifies it by first locking the regulator device itself before
+using the same loop as before to lock its supplies.
+
+Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Fixes: 716fec9d1965 ("[SUBMITTED] regulator: core: avoid unused variable warning")
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/regulator/core.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -140,7 +140,8 @@ static void regulator_lock_supply(struct
+ {
+       int i;
+-      for (i = 0; rdev->supply; rdev = rdev->supply->rdev, i++)
++      mutex_lock(&rdev->mutex);
++      for (i = 1; rdev->supply; rdev = rdev->supply->rdev, i++)
+               mutex_lock_nested(&rdev->mutex, i);
+ }
diff --git a/queue-4.4/revert-regulator-core-fix-nested-locking-of-supplies.patch b/queue-4.4/revert-regulator-core-fix-nested-locking-of-supplies.patch
new file mode 100644 (file)
index 0000000..a799833
--- /dev/null
@@ -0,0 +1,50 @@
+From foo@baz Mon May  2 11:14:34 PDT 2016
+Date: Mon, 02 May 2016 11:14:34 -0700
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: Revert "regulator: core: Fix nested locking of supplies"
+
+This reverts commit b1999fa6e8145305a6c8bda30ea20783717708e6 which was
+commit 70a7fb80e85ae7f78f8e90cec3fbd862ea6a4d4b upstream.
+
+It causes run-time breakage in the 4.4-stable tree and more patches are
+needed to be applied first before this one in order to resolve the
+issue.
+
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Cc: Mark Brown <broonie@kernel.org>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Cc: Thierry Reding <treding@nvidia.com>
+Cc: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/regulator/core.c |   10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -132,14 +132,6 @@ static bool have_full_constraints(void)
+       return has_full_constraints || of_have_populated_dt();
+ }
+-static inline struct regulator_dev *rdev_get_supply(struct regulator_dev *rdev)
+-{
+-      if (rdev && rdev->supply)
+-              return rdev->supply->rdev;
+-
+-      return NULL;
+-}
+-
+ /**
+  * regulator_lock_supply - lock a regulator and its supplies
+  * @rdev:         regulator source
+@@ -148,7 +140,7 @@ static void regulator_lock_supply(struct
+ {
+       int i;
+-      for (i = 0; rdev->supply; rdev = rdev_get_supply(rdev), i++)
++      for (i = 0; rdev->supply; rdev = rdev->supply->rdev, i++)
+               mutex_lock_nested(&rdev->mutex, i);
+ }
index 22a83625e6b4ac941f007f898e0e87b23f4caa99..25bba2ded1c544aa00f39ff7e32fda7a413eba9b 100644 (file)
@@ -21,7 +21,6 @@ debugfs-make-automount-point-inodes-permanently-empty.patch
 dmaengine-dw-fix-master-selection.patch
 dmaengine-hsu-correct-use-of-channel-status-register.patch
 dmaengine-pxa_dma-fix-the-maximum-requestor-line.patch
-mtd-nand-pxa3xx_nand-fix-dmaengine-initialization.patch
 sched-cgroup-fix-cleanup-cgroup-teardown-init.patch
 arm64-honour-pte_write-in-set_pte_at-for-kernel-mappings.patch
 arm64-update-pte_rdonly-in-set_pte_at-for-prot_none-permission.patch
@@ -110,3 +109,7 @@ cgroup-make-sure-a-parent-css-isn-t-freed-before-its-children.patch
 usb-usbip-fix-potential-out-of-bounds-write.patch
 videobuf2-core-check-user-space-planes-array-in-dqbuf.patch
 videobuf2-v4l2-verify-planes-array-in-buffer-dequeueing.patch
+revert-regulator-core-fix-nested-locking-of-supplies.patch
+regulator-core-fix-regulator_lock_supply-regression.patch
+regulator-core-ensure-we-lock-all-regulators.patch
+regulator-core-fix-nested-locking-of-supplies.patch