diff options
author | Rui Zhang <zr.zhang@vivo.com> | 2023-11-03 15:42:31 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-11-13 01:26:30 +0000 |
commit | 7993d3a9c34f609c02171e115fd12c10e2105ff4 (patch) | |
tree | f76508674be9f509ddf1d90d85997a1f7fbb2264 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | c986968fe92f20f2db26fa6bce27795b2e9ebe22 (diff) |
regulator: core: Only increment use_count when enable_count changes
The use_count of a regulator should only be incremented when the
enable_count changes from 0 to 1. Similarly, the use_count should
only be decremented when the enable_count changes from 1 to 0.
In the previous implementation, use_count was sometimes decremented
to 0 when some consumer called unbalanced disable,
leading to unexpected disable even the regulator is enabled by
other consumers. With this change, the use_count accurately reflects
the number of users which the regulator is enabled.
This should make things more robust in the case where a consumer does
leak references.
Signed-off-by: Rui Zhang <zr.zhang@vivo.com>
Link: https://lore.kernel.org/r/20231103074231.8031-1-zr.zhang@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions