Skip to contentSkip to conversation

regulator: core: Ensure we lock all regulators

RFC PATCH In review John Stultz 3 participants 4 messages Apr 29, 2016 – May 6, 2016 Stable branch

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 regulator: core: Ensure we lock all regulators

It seems upstream commit 49a6bb7a1c09 ("regulator: core: Ensure we lock all regulators"), was missed when considering tagging for -stable.

Without this varient of that patch (the original doesn't apply, due to a later fix to the same which was backported), I see double-unlock lockdep splats in the v4.4.8 based HiKey kernel.

Cc Mark Brown <[email protected]>
Cc Tyler Baker <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
CC stable <[email protected]> # 4.4 only (I think)
Fixes 3c2c5fb9b99ca ("regulator: core: avoid unused variable warning")
Originally-Reported-by Tyler Baker <[email protected]>
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +1 -1
index 7b94b8e..732ac71 100644
@@ -148,7 +148,7 @@ static void regulator_lock_supply(struct regulator_dev *rdev)
 {
 	int i;
 
-	for (i = 0; rdev->supply; rdev = rdev_get_supply(rdev), i++)
+	for (i = 0; rdev; rdev = rdev_get_supply(rdev), i++)
 		mutex_lock_nested(&rdev->mutex, i);
 }
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · John Stultz

It seems upstream commit 49a6bb7a1c09 ("regulator: core: Ensure we lock all regulators"), was missed when considering tagging for -stable.

Without this varient of that patch (the original doesn't apply, due to a later fix to the same which was backported), I see double-unlock lockdep splats in the v4.4.8 based HiKey kernel.

This is really just the result of backporting 49a6bb7a1c0963 (regulator:
core: Ensure we lock all regulators) and the commit above.

#2 lore raw
In reply to John Stultz
Quoted 26 lines · John Stultz

It seems upstream commit 49a6bb7a1c09 ("regulator: core: Ensure we lock all regulators"), was missed when considering tagging for -stable.

Without this varient of that patch (the original doesn't apply, due to a later fix to the same which was backported), I see double-unlock lockdep splats in the v4.4.8 based HiKey kernel.

Cc Mark Brown <[email protected]>
Cc Tyler Baker <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
CC stable <[email protected]> # 4.4 only (I think)
Fixes 3c2c5fb9b99ca ("regulator: core: avoid unused variable warning")
Originally-Reported-by Tyler Baker <[email protected]>
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +0 -0
index 7b94b8e..732ac71 100644

drivers/regulator/core.c static void regulator_lock_supply(struct regulator_dev *rdev) · line 154

Quoted 8 lines
drivers/regulator/core.c +1 -1
@@ -148,7 +148,7 @@ static void regulator_lock_supply(struct regulator_dev *rdev)
 {
 	int i;
 
-	for (i = 0; rdev->supply; rdev = rdev_get_supply(rdev), i++)
+	for (i = 0; rdev; rdev = rdev_get_supply(rdev), i++)
 		mutex_lock_nested(&rdev->mutex, i);
 }
 

This should now all be fixed in 4.4.9, and this patch isn't needed, right?

thanks,

greg k-h

#3 lore raw
Quoted 30 lines · Greg Kroah-Hartman
Quoted 29 lines · John Stultz

It seems upstream commit 49a6bb7a1c09 ("regulator: core: Ensure we lock all regulators"), was missed when considering tagging for -stable.

Without this varient of that patch (the original doesn't apply, due to a later fix to the same which was backported), I see double-unlock lockdep splats in the v4.4.8 based HiKey kernel.

Cc Mark Brown <[email protected]>
Cc Tyler Baker <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
CC stable <[email protected]> # 4.4 only (I think)
Fixes 3c2c5fb9b99ca ("regulator: core: avoid unused variable warning")
Originally-Reported-by Tyler Baker <[email protected]>
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +0 -0
index 7b94b8e..732ac71 100644
@@ -148,7 +148,7 @@ static void regulator_lock_supply(struct regulator_dev *rdev)
 {
      int i;
 
Quoted 8 lines

drivers/regulator/core.c static void regulator_lock_supply(struct regulator_dev *rdev) · line 154

Quoted 5 lines
drivers/regulator/core.c +1 -1
-     for (i = 0; rdev->supply; rdev = rdev_get_supply(rdev), i++)
+     for (i = 0; rdev; rdev = rdev_get_supply(rdev), i++)
              mutex_lock_nested(&rdev->mutex, i);
 }
 

This should now all be fixed in 4.4.9, and this patch isn't needed, right?

Yea. Looks right to me in 4.4.9.

thanks!
-john