* [PATCH] regulator: core: remove lockdep assert from suspend_prepare
@ 2016-04-18 11:49 Tero Kristo
2016-04-18 11:59 ` Mark Brown
2016-04-18 19:03 ` Applied "regulator: core: remove lockdep assert from suspend_prepare" to the regulator tree Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Tero Kristo @ 2016-04-18 11:49 UTC (permalink / raw)
To: linux-kernel, broonie, lgirdwood
suspend_prepare can be called during regulator init time also, where
the mutex is not locked yet. This causes a false lockdep warning.
To avoid the problem, remove the lockdep assertion from the function
causing the issue. An alternative would be to lock the mutex during
init, but this would cause other problems (some APIs used during init
will attempt to lock the mutex also, causing deadlock.)
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/regulator/core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 73b7683..b63302e 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -808,8 +808,6 @@ static int suspend_set_state(struct regulator_dev *rdev,
/* locks held by caller */
static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state)
{
- lockdep_assert_held_once(&rdev->mutex);
-
if (!rdev->constraints)
return -EINVAL;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: core: remove lockdep assert from suspend_prepare
2016-04-18 11:49 [PATCH] regulator: core: remove lockdep assert from suspend_prepare Tero Kristo
@ 2016-04-18 11:59 ` Mark Brown
2016-04-18 14:14 ` Tero Kristo
2016-04-18 19:03 ` Applied "regulator: core: remove lockdep assert from suspend_prepare" to the regulator tree Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2016-04-18 11:59 UTC (permalink / raw)
To: Tero Kristo; +Cc: linux-kernel, lgirdwood
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
On Mon, Apr 18, 2016 at 02:49:53PM +0300, Tero Kristo wrote:
> suspend_prepare can be called during regulator init time also, where
It can be? That seems unexpected...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: core: remove lockdep assert from suspend_prepare
2016-04-18 11:59 ` Mark Brown
@ 2016-04-18 14:14 ` Tero Kristo
0 siblings, 0 replies; 4+ messages in thread
From: Tero Kristo @ 2016-04-18 14:14 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, lgirdwood
On 18/04/16 14:59, Mark Brown wrote:
> On Mon, Apr 18, 2016 at 02:49:53PM +0300, Tero Kristo wrote:
>
>> suspend_prepare can be called during regulator init time also, where
>
> It can be? That seems unexpected...
>
regulator_register()
-> set_machine_constraints()
-> suspend_prepare()
Called if you have setup initial_state for the regulator.
-Tero
^ permalink raw reply [flat|nested] 4+ messages in thread
* Applied "regulator: core: remove lockdep assert from suspend_prepare" to the regulator tree
2016-04-18 11:49 [PATCH] regulator: core: remove lockdep assert from suspend_prepare Tero Kristo
2016-04-18 11:59 ` Mark Brown
@ 2016-04-18 19:03 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2016-04-18 19:03 UTC (permalink / raw)
To: Tero Kristo; +Cc: Tomi Valkeinen, Mark Brown, linux-kernel, broonie, lgirdwood
The patch
regulator: core: remove lockdep assert from suspend_prepare
has been applied to the regulator tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 07c5c3ad98926dc15d31aa86de62fd4170f2a745 Mon Sep 17 00:00:00 2001
From: Tero Kristo <t-kristo@ti.com>
Date: Mon, 18 Apr 2016 14:49:53 +0300
Subject: [PATCH] regulator: core: remove lockdep assert from suspend_prepare
suspend_prepare can be called during regulator init time also, where
the mutex is not locked yet. This causes a false lockdep warning.
To avoid the problem, remove the lockdep assertion from the function
causing the issue. An alternative would be to lock the mutex during
init, but this would cause other problems (some APIs used during init
will attempt to lock the mutex also, causing deadlock.)
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/regulator/core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6dd63523bcfe..f28fca4b68e3 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -808,8 +808,6 @@ static int suspend_set_state(struct regulator_dev *rdev,
/* locks held by caller */
static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state)
{
- lockdep_assert_held_once(&rdev->mutex);
-
if (!rdev->constraints)
return -EINVAL;
--
2.8.0.rc3
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-18 19:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 11:49 [PATCH] regulator: core: remove lockdep assert from suspend_prepare Tero Kristo
2016-04-18 11:59 ` Mark Brown
2016-04-18 14:14 ` Tero Kristo
2016-04-18 19:03 ` Applied "regulator: core: remove lockdep assert from suspend_prepare" to the regulator tree Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.