Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597AbdH1AZz (ORCPT ); Sun, 27 Aug 2017 20:25:55 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:14477 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbdH1AZx (ORCPT ); Sun, 27 Aug 2017 20:25:53 -0400 X-AuditID: b6c32a36-f79196d0000051db-4f-59a3630f8411 Mime-Version: 1.0 Subject: RE: [PATCH 02/12] PM / devfreq: Fix locking range for making the frequency table Reply-To: myungjoo.ham@samsung.com From: MyungJoo Ham To: Chanwoo Choi , Kyungmin Park CC: "rafael.j.wysocki@intel.com" , "chanwoo@kernel.org" , Inki Dae , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "stable@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <1503538979-22693-3-git-send-email-cw00.choi@samsung.com> X-Drm-Type: N,general X-EPLocale: ko_KR.EUC-KR X-EPWebmail-Msg-Type: personal X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Illegal-Object: Syntax error in X-Sender: address found on vger.kernel.org: X-Sender: =?utf-8?B?U2Ftc3VuZyBFbGVjdHJvbmljcxtBcnRpZmljaWFsIEludA==?= ^-Extraneous program text X-Sender-IP: 10.113.73.204 X-Local-Sender: =?UTF-8?B?7ZWo66qF7KO8G0FydGlmaWNpYWwgSW50ZWxsaWdlbmNlIDNMYWIoUy9X?= =?UTF-8?B?7IS87YSwKRvsgrzshLHsoITsnpAbUHJpbmNpcGFsIEVuZ2lu?= =?UTF-8?B?ZWVy?= X-Global-Sender: =?UTF-8?B?TXl1bmdKb28gSGFtG0FydGlmaWNpYWwgSW50ZWxsaWdlbmNlIDNMYWIu?= =?UTF-8?B?G1NhbXN1bmcgRWxlY3Ryb25pY3MbUHJpbmNpcGFsIEVuZ2lu?= =?UTF-8?B?ZWVy?= X-Sender-Code: =?UTF-8?B?QzEwGxtDMTBWODI5MQ==?= Message-ID: <20170828002551epcms1p20fed7149e2e01f2d5517e926a1794864@epcms1p2> Date: Mon, 28 Aug 2017 00:25:51 +0000 X-CMS-MailID: 20170828002551epcms1p20fed7149e2e01f2d5517e926a1794864 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-MTR: 20170828002551epcms1p20fed7149e2e01f2d5517e926a1794864 CMS-TYPE: 101P X-Brightmail-Tracker: H4sIAAAAAAAAA01SWUwTURTN60ynA7E6lO1aNzIRxYW2UygOBMRErQQxkhij1ShO4KUQ6ZJO MeKP1WhQoijGGIMmEqtsoghIW6kxEfcPjCuKghsKUcAlatTErcPU6N+Z8845957JpQlNFaWl S+xu7LILpSwVSfouzzIkTyj0WgwjB9V89aP7JP/w85CSP/BsP8l3bx9R8fc6j1L8p71XED/Q MKria1tfogV0jvfCG0VOW9NuKqfqXBPK+dQ2NZ9cgzOLsVCEXQnYXugoKrFbs9ilKwoWFpjS DFwyl87PYxPsgg1nsYvy8pPNJaWhNdiETUJpWYjKF0SR1c/PdDnK3Dih2CG6s9i1HGfUcYZ5 OqPRqEtNWZdhNIUkG3BxtZ92+iM3Xxpa5UF9dCWKoIFJhbe3XihlHAe3n7ZQlSiS1jABBL5A O1mJaFrNRMHPQLSkiWbWwunfA4SENQwLnt6LhMzrYddzH5IwxSRDx9l+UsIxzEoI1lYRUibB dCqg8fAoKQ9Tw+GK12E8Cfz1HWPmCMYMg9cGwwvFQu+pUZWMAfqGbytkPBUOfWkm/mreXzuG ZBwDO592h/koeP49iKTBwOxE0HduMBykhcfeHoX8UIfAe++1Sv6oR1BxopWSKkOoz3n/Qsmg ZpbBj8dPxiaQTCK8av8dDloEzTv6xjYlmGngHz1KSFaCmQUtnXpZkgXBugeULBkP777sCReb AV3BE6r9aHrNv/9b819Qzb+gWkQ0oTjsFG1WLHJOo04UbGKZ3aordNja0Ngtzk4LoOO38roQ QyN2nBpmei0apbBJLLd1IaAJNkYdL4QodZFQvgW7HAWuslIsdiFTqE81oY0tdIQu2+4u4FLT DalpxtDFpXMcG6+ObelZrWGsghtvxNiJXX99CjpC60EVrHJObK613/POuc/WYH7b++hm/Joj d/XZuHfi3PZs07JG8/pc8cA37YCux5Kkyus3GRqPb2s9M9nasPjj9WB5SV5ihG/j10u7lJ/b TwbiMlKyTdRuw/YWiy9J6zfj1eu2pkx5YB33gRs6dDXTMjTc/WtJxh2XPul8zQ3rS8/75Swp FgvcbMIlCn8AqH1/+KEDAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170824014259epcas2p33d211dd0f29ebee0fc2fd7415d8294d9 X-RootMTR: 20170824014259epcas2p33d211dd0f29ebee0fc2fd7415d8294d9 References: <1503538979-22693-3-git-send-email-cw00.choi@samsung.com> <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: 1301 Lines: 34 > 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 Is this because you do not have locks inside devfreq_set_freq_table() anymore? > --- > 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));