* [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend()
@ 2023-08-26 9:52 Liao Chang
2023-08-28 7:00 ` Viresh Kumar
0 siblings, 1 reply; 5+ messages in thread
From: Liao Chang @ 2023-08-26 9:52 UTC (permalink / raw)
To: rafael, viresh.kumar; +Cc: linux-pm, linux-kernel
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.
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
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);
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend()
2023-08-26 9:52 [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend() Liao Chang
@ 2023-08-28 7:00 ` Viresh Kumar
2023-08-28 12:31 ` Liao, Chang
0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2023-08-28 7:00 UTC (permalink / raw)
To: Liao Chang; +Cc: rafael, linux-pm, linux-kernel
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 <liaochang1@huawei.com>
> ---
> 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.
--
viresh
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend()
2023-08-28 7:00 ` Viresh Kumar
@ 2023-08-28 12:31 ` Liao, Chang
2023-08-29 6:01 ` Viresh Kumar
0 siblings, 1 reply; 5+ messages in thread
From: Liao, Chang @ 2023-08-28 12:31 UTC (permalink / raw)
To: Viresh Kumar; +Cc: rafael, linux-pm, linux-kernel
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 <liaochang1@huawei.com>
>> ---
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend()
2023-08-28 12:31 ` Liao, Chang
@ 2023-08-29 6:01 ` Viresh Kumar
2023-08-29 6:22 ` Liao, Chang
0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2023-08-29 6:01 UTC (permalink / raw)
To: Liao, Chang; +Cc: rafael, linux-pm, linux-kernel
On 28-08-23, 20:31, Liao, Chang wrote:
> 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",
s/policy/CPU%u's policy/ ?
> + __func__, policy->cpu);
Sounds good.
--
viresh
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend()
2023-08-29 6:01 ` Viresh Kumar
@ 2023-08-29 6:22 ` Liao, Chang
0 siblings, 0 replies; 5+ messages in thread
From: Liao, Chang @ 2023-08-29 6:22 UTC (permalink / raw)
To: Viresh Kumar; +Cc: rafael, linux-pm, linux-kernel
在 2023/8/29 14:01, Viresh Kumar 写道:
> On 28-08-23, 20:31, Liao, Chang wrote:
>> 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",
>
> s/policy/CPU%u's policy/ ?
Sounds good, thanks.
--
BR
Liao, Chang
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-08-29 6:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-26 9:52 [PATCH] cpufreq: Fix inconsistency in error messages of cpufreq_resume/suspend() Liao Chang
2023-08-28 7:00 ` Viresh Kumar
2023-08-28 12:31 ` Liao, Chang
2023-08-29 6:01 ` Viresh Kumar
2023-08-29 6:22 ` Liao, Chang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®