From f361eb39cdbfcb4372acb091d80c9c4bbf865262 Mon Sep 17 00:00:00 2001 From: Vincent Wang Date: Wed, 13 Dec 2017 14:20:17 +0800 Subject: [PATCH] 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 --- drivers/base/power/opp/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index a7c5b79371a7..94001aafc6d0 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -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); }