From: Greg Kroah-Hartman Date: Mon, 2 May 2016 18:22:13 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v3.14.68~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3d7bf6c085ec7263b4ab096dc89350d20f47249;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches 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 --- 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 index 5d32ece82aa..00000000000 --- a/queue-4.4/mtd-nand-pxa3xx_nand-fix-dmaengine-initialization.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 9097103f06332d099c5ab06d1e7f22f4bcaca6e2 Mon Sep 17 00:00:00 2001 -From: Robert Jarzmik -Date: Fri, 12 Feb 2016 23:29:04 +0100 -Subject: mtd: nand: pxa3xx_nand: fix dmaengine initialization - -From: Robert Jarzmik - -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 -Acked-by: Ezequiel Garcia -Signed-off-by: Brian Norris -Signed-off-by: Greg Kroah-Hartman - ---- - 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 index 00000000000..f32fa027f5d --- /dev/null +++ b/queue-4.4/regulator-core-ensure-we-lock-all-regulators.patch @@ -0,0 +1,34 @@ +From 49a6bb7a1c0963f260e4b0dcc2c0e56ec65a28b2 Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Tue, 1 Dec 2015 15:51:52 +0000 +Subject: regulator: core: Ensure we lock all regulators + +From: Mark Brown + +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 +Signed-off-by: Mark Brown +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..0d914350be4 --- /dev/null +++ b/queue-4.4/regulator-core-fix-nested-locking-of-supplies.patch @@ -0,0 +1,58 @@ +From 70a7fb80e85ae7f78f8e90cec3fbd862ea6a4d4b Mon Sep 17 00:00:00 2001 +From: Thierry Reding +Date: Wed, 2 Dec 2015 16:54:50 +0100 +Subject: regulator: core: Fix nested locking of supplies + +From: Thierry Reding + +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 +Cc: Arnd Bergmann +Fixes: fa731ac7ea04 ("regulator: core: avoid unused variable warning") +Signed-off-by: Thierry Reding +Signed-off-by: Mark Brown +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..22363f96a7e --- /dev/null +++ b/queue-4.4/regulator-core-fix-regulator_lock_supply-regression.patch @@ -0,0 +1,45 @@ +From bb41897e38c53458a88b271f2fbcd905ee1f9584 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 27 Nov 2015 14:46:41 +0100 +Subject: regulator: core: fix regulator_lock_supply regression + +From: Arnd Bergmann + +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: +> [] 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 +Signed-off-by: Arnd Bergmann +Fixes: 716fec9d1965 ("[SUBMITTED] regulator: core: avoid unused variable warning") +Signed-off-by: Mark Brown +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..a799833f1ce --- /dev/null +++ b/queue-4.4/revert-regulator-core-fix-nested-locking-of-supplies.patch @@ -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 +From: Greg Kroah-Hartman +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 +Cc: Mark Brown +Cc: Arnd Bergmann +Cc: Thierry Reding +Cc: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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); + } + diff --git a/queue-4.4/series b/queue-4.4/series index 22a83625e6b..25bba2ded1c 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -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