linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/hwmon/acpi_power_meter.c: Change log level
@ 2019-07-22 14:50 Shenran Wang
  2019-07-22 18:27 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Shenran Wang @ 2019-07-22 14:50 UTC (permalink / raw)
  To: jdelvare, linux; +Cc: linux-hwmon

From ce991220c17873821bd1e2bd011686201b3daaff Mon Sep 17 00:00:00 2001
From: Wang Shenran <shenran268@gmail.com>
Date: Mon, 22 Jul 2019 14:38:10 +0300
Subject: [PATCH] drivers/hwmon/acpi_power_meter.c: Change log level

At boot time, the acpi_power_meter driver logs the following error level
message: "Ignoring unsafe software power cap". Having read about it from
a few sources, it seems that the error message can be quite misleading.

While the message can imply that Linux is ignoring the fact that the
system is operating in potentially dangerous conditions, the truth is
the driver found an ACPI_PMC object that supports software power
capping. The driver simply decides not to use it, perhaps because it
doesn't support the object.

The best solution is probably changing the log level from error to warning.
All sources I have found, regarding the error, have downplayed its
significance. There is not much of a reason for it to be on error level,
while causing potential confusions or misinterpretations.

Signed-off-by: Wang Shenran <shenran268@gmail.com>
---
 drivers/hwmon/acpi_power_meter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 6ba1a08253f0..ee0363e5be43 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -681,7 +681,7 @@ static int setup_attrs(struct
acpi_power_meter_resource *resource)

        if (resource->caps.flags & POWER_METER_CAN_CAP) {
                if (!can_cap_in_hardware()) {
-                       dev_err(&resource->acpi_dev->dev,
+                       dev_warn(&resource->acpi_dev->dev,
                                "Ignoring unsafe software power cap!\n");
                        goto skip_unsafe_cap;
                }
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers/hwmon/acpi_power_meter.c: Change log level
  2019-07-22 14:50 [PATCH] drivers/hwmon/acpi_power_meter.c: Change log level Shenran Wang
@ 2019-07-22 18:27 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-07-22 18:27 UTC (permalink / raw)
  To: Shenran Wang; +Cc: jdelvare, linux-hwmon

On Mon, Jul 22, 2019 at 05:50:34PM +0300, Shenran Wang wrote:
> From ce991220c17873821bd1e2bd011686201b3daaff Mon Sep 17 00:00:00 2001
> From: Wang Shenran <shenran268@gmail.com>
> Date: Mon, 22 Jul 2019 14:38:10 +0300
> Subject: [PATCH] drivers/hwmon/acpi_power_meter.c: Change log level
> 
> At boot time, the acpi_power_meter driver logs the following error level
> message: "Ignoring unsafe software power cap". Having read about it from
> a few sources, it seems that the error message can be quite misleading.
> 
> While the message can imply that Linux is ignoring the fact that the
> system is operating in potentially dangerous conditions, the truth is
> the driver found an ACPI_PMC object that supports software power
> capping. The driver simply decides not to use it, perhaps because it
> doesn't support the object.
> 
> The best solution is probably changing the log level from error to warning.
> All sources I have found, regarding the error, have downplayed its
> significance. There is not much of a reason for it to be on error level,
> while causing potential confusions or misinterpretations.
> 
> Signed-off-by: Wang Shenran <shenran268@gmail.com>
> ---
>  drivers/hwmon/acpi_power_meter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
> index 6ba1a08253f0..ee0363e5be43 100644
> --- a/drivers/hwmon/acpi_power_meter.c
> +++ b/drivers/hwmon/acpi_power_meter.c
> @@ -681,7 +681,7 @@ static int setup_attrs(struct
> acpi_power_meter_resource *resource)
> 

This patch is corrupted. Split line above, tabs replaced with spaces below.

Guenter

>         if (resource->caps.flags & POWER_METER_CAN_CAP) {
>                 if (!can_cap_in_hardware()) {
> -                       dev_err(&resource->acpi_dev->dev,
> +                       dev_warn(&resource->acpi_dev->dev,
>                                 "Ignoring unsafe software power cap!\n");
>                         goto skip_unsafe_cap;
>                 }
> -- 
> 2.20.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-22 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 14:50 [PATCH] drivers/hwmon/acpi_power_meter.c: Change log level Shenran Wang
2019-07-22 18:27 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).