aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/power/opp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 1bbef8e838e7..e1807268cbf2 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -84,7 +84,11 @@ struct dev_pm_opp {
84 * 84 *
85 * This is an internal data structure maintaining the link to opps attached to 85 * This is an internal data structure maintaining the link to opps attached to
86 * a device. This structure is not meant to be shared to users as it is 86 * a device. This structure is not meant to be shared to users as it is
87 * meant for book keeping and private to OPP library 87 * meant for book keeping and private to OPP library.
88 *
89 * Because the opp structures can be used from both rcu and srcu readers, we
90 * need to wait for the grace period of both of them before freeing any
91 * resources. And so we have used kfree_rcu() from within call_srcu() handlers.
88 */ 92 */
89struct device_opp { 93struct device_opp {
90 struct list_head node; 94 struct list_head node;
@@ -511,7 +515,7 @@ static void kfree_device_rcu(struct rcu_head *head)
511{ 515{
512 struct device_opp *device_opp = container_of(head, struct device_opp, rcu_head); 516 struct device_opp *device_opp = container_of(head, struct device_opp, rcu_head);
513 517
514 kfree(device_opp); 518 kfree_rcu(device_opp, rcu_head);
515} 519}
516 520
517void __dev_pm_opp_remove(struct device_opp *dev_opp, struct dev_pm_opp *opp) 521void __dev_pm_opp_remove(struct device_opp *dev_opp, struct dev_pm_opp *opp)