From mboxrd@z Thu Jan 1 00:00:00 1970 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 1A822C83F19 for ; Mon, 28 Aug 2023 12:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232647AbjH1McD (ORCPT ); Mon, 28 Aug 2023 08:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbjH1Mbd (ORCPT ); Mon, 28 Aug 2023 08:31:33 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39D2612E; Mon, 28 Aug 2023 05:31:14 -0700 (PDT) Received: from kwepemd100002.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RZ8x84hPZzVk1Q; Mon, 28 Aug 2023 20:28:44 +0800 (CST) Received: from [10.67.110.108] (10.67.110.108) by kwepemd100002.china.huawei.com (7.221.188.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.23; Mon, 28 Aug 2023 20:31:07 +0800 Message-ID: Date: Mon, 28 Aug 2023 20:31:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend() To: Viresh Kumar CC: , , References: <20230826095201.1137288-1-liaochang1@huawei.com> <20230828070000.ooymfbw3qhs5xl5y@vireshk-i7> From: "Liao, Chang" In-Reply-To: <20230828070000.ooymfbw3qhs5xl5y@vireshk-i7> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.108] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd100002.china.huawei.com (7.221.188.184) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Viresh 在 2023/8/28 15:00, Viresh Kumar 写道: > On 26-08-23, 09:52, Liao Chang wrote: >> The error message printed by cpufreq_resume() currently is the pointer >> value of the policy structure, while the error message printed by >> cpufreq_suspend() is the name of the driver. In order to make the error >> messages more consistent and easier to understand, change the error >> message printed by cpufreq_resume() to the name of driver. > > Also I don't think printing kernel addresses will help much anyway, > and it also may not be recommended. > >> Signed-off-by: Liao Chang >> --- >> drivers/cpufreq/cpufreq.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c >> index c835ff117386..2199c04ac64d 100644 >> --- a/drivers/cpufreq/cpufreq.c >> +++ b/drivers/cpufreq/cpufreq.c >> @@ -1943,8 +1943,8 @@ void cpufreq_resume(void) >> >> for_each_active_policy(policy) { >> if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) { >> - pr_err("%s: Failed to resume driver: %p\n", __func__, >> - policy); >> + pr_err("%s: Failed to resume driver: %s\n", __func__, >> + cpufreq_driver->name); >> } else if (has_target()) { >> down_write(&policy->rwsem); >> ret = cpufreq_start_governor(policy); > > There is another print down here which prints policy, please update > that too in a similar way. What about printing message like this below when cpufreq_start_governor() fails. diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 50bbc969ffe5..b78b509429a6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1943,16 +1943,16 @@ void cpufreq_resume(void) if (ret) - pr_err("%s: Failed to start governor for policy: %p\n", - __func__, policy); + pr_err("%s: Failed to start governor for policy%u\n", + __func__, policy->cpu); } } } > -- BR Liao, Chang