Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751911AbdHXBos (ORCPT ); Wed, 23 Aug 2017 21:44:48 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:45170 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbdHXBnC (ORCPT ); Wed, 23 Aug 2017 21:43:02 -0400 X-AuditID: b6c32a45-f79466d000002ac6-34-599e2f23012c From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com Cc: rafael.j.wysocki@intel.com, chanwoo@kernel.org, inki.dae@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 02/12] PM / devfreq: Fix locking range for making the frequency table Date: Thu, 24 Aug 2017 10:42:49 +0900 Message-id: <1503538979-22693-3-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1503538979-22693-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLKsWRmVeSWpSXmKPExsWy7bCmha6y/rxIgyNvtS0m3rjCYnH9y3NW i0n3J7BYnG16w25xedccNovPvUcYLW43rmCzeLziLbvFgo2PGB04PRbvecnksWlVJ5tH35ZV jB6fN8kFsESl2mSkJqakFimk5iXnp2TmpdsqeQfHO8ebmhkY6hpaWpgrKeQl5qbaKrn4BOi6 ZeYA3aKkUJaYUwoUCkgsLlbSt7Mpyi8tSVXIyC8usVWKNjQ00jM0MNczMjLSMzGOtTIyBSpJ SM1Y9fk9U8EWzoo77XPZGxgbOboYOTkkBEwkLjQ8ZYawxSQu3FvP1sXIxSEksINRYt2+nUwQ zndGiWP/J7PCdMz6/JAVIrGBUeLHrNssEM4PRokTEzYxglSxCWhJ7H9xgw3EFhEIkOhcuwps FLPAHEaJM5v3s4AkhAXCJQ6t/wY2lkVAVeJ36z4wm1fAVWLds98sEOvkJD7secQOYnMK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HRqzehaZnKvvdXT1VM7L294Lh/lPDync7t+z/5cFgYReUoXtHl z+0QczO93fhE0Ur3jscqESteqbdbtBS3Ht6643NFovSiUsF/nJPFG/x1BW73XjzpWvZ9iR2/ gWfwY0G1PR/uFerw3MnjnJz+RKlwb8AasfW68cKMWw9kvl/Pt1lVlPXpxZVKLMUZiYZazEXF iQDdF64OJQIAAA== X-CMS-MailID: 20170824014259epcas2p33d211dd0f29ebee0fc2fd7415d8294d9 X-Msg-Generator: CA X-Sender-IP: 182.195.42.143 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170824014259epcas2p33d211dd0f29ebee0fc2fd7415d8294d9 X-RootMTR: 20170824014259epcas2p33d211dd0f29ebee0fc2fd7415d8294d9 References: <1503538979-22693-1-git-send-email-cw00.choi@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1170 Lines: 32 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@vger.kernel.org Fixes: 0ec09ac2cebe ("PM / devfreq: Set the freq_table of devfreq device") Signed-off-by: Chanwoo Choi --- 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