PM / OPP: list_del_rcu should be used in function _remove_opp_dev

list_del_rcu should be used to replace list_del in function _remove_opp_dev,
since the opp is a rcu protected pointer.

Test: for example, on an ARM big.Little platform, the opp_table of big cluster
will be removed when big cluster is removed, which should be implemented in
the cpufreq driver.
Then a stress test that the big cluster is plugged in/out, can test the patch.

Change-Id: I59c0ba16d372575ff1d80097575eeea826f6df52
Signed-off-by: Vincent Wang <vincent.wang@spreadtrum.com>
This commit is contained in:
Vincent Wang
2017-12-13 14:20:17 +08:00
committed by Greg Kroah-Hartman
parent 960923fdc2
commit f361eb39cd

View File

@@ -708,7 +708,7 @@ static void _remove_opp_dev(struct opp_device *opp_dev,
struct opp_table *opp_table)
{
opp_debug_unregister(opp_dev, opp_table);
list_del(&opp_dev->node);
list_del_rcu(&opp_dev->node);
call_srcu(&opp_table->srcu_head.srcu, &opp_dev->rcu_head,
_kfree_opp_dev_rcu);
}