linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, Dmitry Osipenko <digetx@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH] regulator: core: Skip balancing of the enabled regulators in regulator_enable()
Date: Tue, 8 Oct 2019 14:01:15 +0200	[thread overview]
Message-ID: <0e222fdd-4407-51ea-b75c-a62621cbe622@samsung.com> (raw)
In-Reply-To: <20191008115025.GF4382@sirena.co.uk>

Hi Mark,

On 08.10.2019 13:50, Mark Brown wrote:
> On Tue, Oct 08, 2019 at 12:17:09PM +0200, Marek Szyprowski wrote:
>> Commit f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators
>> locking"), regardless of the subject, added additional call to
>> regulator_balance_voltage() during regulator_enable(). This is basically
>> a good idea, however it causes some issue for the regulators which are
>> already enabled at boot and are critical for system operation (for example
>> provides supply to the CPU).
> If regulators are essential to system operation they should be marked as
> always-on...

The are marked as always on:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos5800-peach-pi.dts#n253

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos5800-peach-pi.dts#n265

>> CPUfreq or other drivers typically call regulator_enable() on such
>> regulators during their probe, although the regulators are already enabled
>> by bootloader. The mentioned patch however added a call to
>> regulator_balance_voltage(), what in case of system boot, where no
>> additional requirements are set yet, typically causes to limit the voltage
>> to the minimal value defined at regulator constraints. This causes a crash
>> of the system when voltage on the CPU regulator is set to the lowest
>> possible value without adjusting the operation frequency. Fix this by
>> adding a check if regulator is already enabled - if so, then skip the
>> balancing procedure. The voltage will be balanced later anyway once the
>> required voltage value is requested.
> This then means that for users that might legitimately enable and
> disable regulators that need to be constrained are forced to change the
> voltage when they enable the regualtors in order to have their
> constraints take effect which seems bad.  I'd rather change the the
> cpufreq consumers to either not do the enable (since there really should
> be an always-on constraint this should be redundant, we might need to
> fix the core to take account of their settings though I think we lost
> that) or to set the voltage to whatever they need prior to doing their
> first enable, that seems more robust.

Well, I'm open for other ways of fixing this issue. Calling enable on 
always-on regulator imho should not change its rate...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


  reply	other threads:[~2019-10-08 12:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20191008101720eucas1p2e0d1bca6e696848bf689067e05620679@eucas1p2.samsung.com>
2019-10-08 10:17 ` [PATCH] regulator: core: Skip balancing of the enabled regulators in regulator_enable() Marek Szyprowski
2019-10-08 11:50   ` Mark Brown
2019-10-08 12:01     ` Marek Szyprowski [this message]
2019-10-08 12:06       ` Mark Brown
2019-10-08 12:38         ` Marek Szyprowski
2019-10-08 12:47           ` Mark Brown
2019-10-08 13:24             ` Bartlomiej Zolnierkiewicz
2019-10-08 15:02               ` Dmitry Osipenko
2019-10-08 16:15                 ` Mark Brown
2019-10-08 17:05                   ` Dmitry Osipenko
2019-10-08 17:17                     ` Mark Brown
2019-10-08 18:00                       ` Dmitry Osipenko
2019-10-08 18:07                         ` Mark Brown
2019-10-09 10:29                           ` Marek Szyprowski
2019-10-09 14:13                             ` Mark Brown
2019-10-10  7:29                               ` Viresh Kumar
2019-10-10 10:19                               ` Marek Szyprowski
2019-10-10 13:55                                 ` Mark Brown
2019-10-17 10:29                                   ` Marek Szyprowski
2019-10-08 15:48               ` Mark Brown
2019-10-08 16:02                 ` Bartlomiej Zolnierkiewicz
2019-10-08 16:21                   ` 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=0e222fdd-4407-51ea-b75c-a62621cbe622@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=digetx@gmail.com \
    --cc=krzk@kernel.org \
    --cc=l.stach@pengutronix.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).