From: Dmitry Osipenko <digetx@gmail.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>,
linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Cc: Collabora Kernel ML <kernel@collabora.com>,
drinkcat@chromium.org, dianders@chromium.org,
Liam Girdwood <lgirdwood@gmail.com>,
mka@chromium.org
Subject: Re: [PATCH] regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage
Date: Fri, 17 Jan 2020 19:28:04 +0300 [thread overview]
Message-ID: <1fdaed3c-05e0-4756-5013-5cc59a766e2f@gmail.com> (raw)
In-Reply-To: <20200116094543.2847321-1-enric.balletbo@collabora.com>
16.01.2020 12:45, Enric Balletbo i Serra пишет:
> `cat /sys/kernel/debug/regulator/regulator_summary` ends on a deadlock
> when you have a voltage controlled regulator (vctrl).
>
> The problem is that the vctrl_get_voltage() and vctrl_set_voltage() calls the
> regulator_get_voltage() and regulator_set_voltage() and that will try to lock
> again the dependent regulators (the regulator supplying the control voltage).
>
> Fix the issue by exporting the unlocked version of the regulator_get_voltage()
> and regulator_set_voltage() API so drivers that need it, like the voltage
> controlled regulator driver can use it.
>
> Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking")
> Reported-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
> drivers/regulator/core.c | 2 ++
> drivers/regulator/vctrl-regulator.c | 38 +++++++++++++++++------------
> 2 files changed, 25 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index 03d79fee2987..e7d167ce326c 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -3470,6 +3470,7 @@ int regulator_set_voltage_rdev(struct regulator_dev *rdev, int min_uV,
> out:
> return ret;
> }
> +EXPORT_SYMBOL(regulator_set_voltage_rdev);
>
> static int regulator_limit_voltage_step(struct regulator_dev *rdev,
> int *current_uV, int *min_uV)
> @@ -4034,6 +4035,7 @@ int regulator_get_voltage_rdev(struct regulator_dev *rdev)
> return ret;
> return ret - rdev->constraints->uV_offset;
> }
> +EXPORT_SYMBOL(regulator_get_voltage_rdev);
I think it should be EXPORT_SYMBOL_GPL().
next prev parent reply other threads:[~2020-01-17 16:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 9:45 Enric Balletbo i Serra
2020-01-17 15:44 ` Applied "regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage" to the regulator tree Mark Brown
2020-01-17 16:28 ` Dmitry Osipenko [this message]
2020-01-20 12:08 ` [PATCH] regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage Mark Brown
2020-01-20 12:10 ` Enric Balletbo i Serra
2020-01-20 12:22 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1fdaed3c-05e0-4756-5013-5cc59a766e2f@gmail.com \
--to=digetx@gmail.com \
--cc=broonie@kernel.org \
--cc=dianders@chromium.org \
--cc=drinkcat@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=kernel@collabora.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®