[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1503538979-22693-3-git-send-email-cw00.choi@samsung.com>
Date: Thu, 24 Aug 2017 10:42:49 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
cw00.choi@...sung.com
Cc: rafael.j.wysocki@...el.com, chanwoo@...nel.org,
inki.dae@...sung.com, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, stable@...r.kernel.org
Subject: [PATCH 02/12] PM / devfreq: Fix locking range for making the
frequency table
Even if the freq_table is included in the struct devfreq,
the commit 0ec09ac2cebe ("PM / devfreq: Set the freq_table
of devfreq device") set the frequency table outside the mutex locking.
So, this patch initializes the frequency table within the mutex locking.
Cc: stable@...r.kernel.org
Fixes: 0ec09ac2cebe ("PM / devfreq: Set the freq_table of devfreq device")
Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
---
drivers/devfreq/devfreq.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index a1c4ee818614..3c5ccb96e165 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -553,11 +553,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
devfreq->data = data;
devfreq->nb.notifier_call = devfreq_notifier_call;
- if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
- mutex_unlock(&devfreq->lock);
+ if (!devfreq->profile->max_state && !devfreq->profile->freq_table)
devfreq_set_freq_table(devfreq);
- mutex_lock(&devfreq->lock);
- }
dev_set_name(&devfreq->dev, "devfreq%d",
atomic_inc_return(&devfreq_no));
--
1.9.1
Powered by blists - more mailing lists