OSDN Git Service

regulator: Avoid grabbing regulator lock during suspend/resume
authorStephen Boyd <swboyd@chromium.org>
Tue, 4 Aug 2020 07:08:37 +0000 (00:08 -0700)
committerMark Brown <broonie@kernel.org>
Tue, 18 Aug 2020 16:18:41 +0000 (17:18 +0100)
commit0955f5be4337c0ada82e49389249eb99199f8db2
tree30fb00531dbae7750857b542dc4dba6f3643d19e
parenta16138a32eeeca01e2603193288ff0714bead11d
regulator: Avoid grabbing regulator lock during suspend/resume

I see it takes about 5us per regulator to grab the lock, check that this
regulator isn't going to do anything for suspend, and then release the
lock. When that is combined with PMICs that have dozens of regulators we
get into a state where we spend a few miliseconds doing a bunch of
locking operations synchronously to figure out that there's nothing to
do. Let's reorganize the code here a bit so that we don't grab the lock
until we're actually going to do something so that suspend is a little
faster.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200804070837.1084024-1-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c