android_kernel_motorola_sm6375/drivers/opp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Viresh Kumar 9f7d28075a opp: Replace list_kref with a local counter
[ Upstream commit 03758d60265c773e1d06d436b99ee338f2ac55d6 ]

A kref or refcount isn't the right tool to be used here for counting
number of devices that are sharing the static OPPs created for the OPP
table. For example, we are reinitializing the kref again, after it
reaches a value of 0 and frees the resources, if the static OPPs get
added for the same OPP table structure (as the OPP table structure was
never freed). That is messy and very unclear.

This patch makes parsed_static_opps an unsigned integer and uses it to
count the number of users of the static OPPs. The increment and
decrement to parsed_static_opps is done under opp_table->lock now to
make sure no races are possible if the OPP table is getting added and
removed in parallel (which doesn't happen in practice, but can in
theory).

Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-10-01 13:17:26 +02:00
..
core.c opp: Replace list_kref with a local counter 2020-10-01 13:17:26 +02:00
cpu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
debugfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Kconfig pci-v5.3-changes 2019-07-15 20:44:49 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
of.c opp: Replace list_kref with a local counter 2020-10-01 13:17:26 +02:00
opp.h opp: Replace list_kref with a local counter 2020-10-01 13:17:26 +02:00
ti-opp-supply.c