Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72840C4332F for ; Wed, 1 Dec 2021 06:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347009AbhLAGup (ORCPT ); Wed, 1 Dec 2021 01:50:45 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:15001 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346956AbhLAGun (ORCPT ); Wed, 1 Dec 2021 01:50:43 -0500 Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4J3qMC5FKQzZcD1; Wed, 1 Dec 2021 14:44:39 +0800 (CST) Received: from dggpeml500006.china.huawei.com (7.185.36.76) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 1 Dec 2021 14:47:21 +0800 Received: from huawei.com (10.175.100.227) by dggpeml500006.china.huawei.com (7.185.36.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 1 Dec 2021 14:47:20 +0800 From: Tang Yizhou To: , , CC: , , Tang Yizhou Subject: [PATCH v2 1/2] cpufreq: Fix a comment in cpufreq_policy_free Date: Wed, 1 Dec 2021 15:14:59 +0800 Message-ID: <20211201071500.28648-2-tangyizhou@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211201071500.28648-1-tangyizhou@huawei.com> References: <20211201071500.28648-1-tangyizhou@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.100.227] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500006.china.huawei.com (7.185.36.76) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Comment both when CPUFREQ_CREATE_POLICY and CPUFREQ_REMOVE_POLICY notification are sent. Signed-off-by: Tang Yizhou --- drivers/cpufreq/cpufreq.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index e338d2f010fe..e76777881739 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1296,8 +1296,9 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy) if (policy->max_freq_req) { /* - * CPUFREQ_CREATE_POLICY notification is sent only after - * successfully adding max_freq_req request. + * Need to send CPUFREQ_REMOVE_POLICY notification if + * max_freq_req request is successfully added. + * See also: CPUFREQ_CREATE_POLICY notification. */ blocking_notifier_call_chain(&cpufreq_policy_notifier_list, CPUFREQ_REMOVE_POLICY, policy); @@ -1429,6 +1430,10 @@ static int cpufreq_online(unsigned int cpu) goto out_destroy_policy; } + /* + * CPUFREQ_CREATE_POLICY notification is sent only after + * successfully adding max_freq_req request. + */ blocking_notifier_call_chain(&cpufreq_policy_notifier_list, CPUFREQ_CREATE_POLICY, policy); } -- 2.17.1