2012-08-10 02:06:33

by Aaron Lu

[permalink] [raw]
Subject: [PATCH] ACPI: power: Use KERN_DEBUG when no power resources are found

commit a606dac368eed5696fb38e16b1394f1d049c09e9 adds support to link
devices which have _PRx, if a device does not have _PRx, a warning
message will be printed.

This commit is for ZPODD on Intel's platform, on AMD's platform, there
is no _PRx to support ZPODD, we use _PSx.

So instead of printing a useless warning message on AMD's platform,
changing the print level to DEBUG to suppress this message.

Reported-by: Borislav Petkov <[email protected]>
Cc: <[email protected]> 3.5+
Signed-off-by: Aaron Lu <[email protected]>
---
drivers/acpi/power.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 215ecd0..e5e01d9 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -460,7 +460,7 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
return ret;

no_power_resource:
- printk(KERN_WARNING PREFIX "Invalid Power Resource to register!");
+ printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!");
return -ENODEV;
}
EXPORT_SYMBOL_GPL(acpi_power_resource_register_device);
--
1.7.11.3


2012-08-23 13:27:04

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] ACPI: power: Use KERN_DEBUG when no power resources are found

On Fri, Aug 10, 2012 at 10:05:53AM +0800, Aaron Lu wrote:
> commit a606dac368eed5696fb38e16b1394f1d049c09e9 adds support to link
> devices which have _PRx, if a device does not have _PRx, a warning
> message will be printed.
>
> This commit is for ZPODD on Intel's platform, on AMD's platform, there
> is no _PRx to support ZPODD, we use _PSx.
>
> So instead of printing a useless warning message on AMD's platform,
> changing the print level to DEBUG to suppress this message.
>
> Reported-by: Borislav Petkov <[email protected]>
> Cc: <[email protected]> 3.5+
> Signed-off-by: Aaron Lu <[email protected]>

Ping?

Can we get this applied pls - I still see it on -rc3.

Thanks.

> ---
> drivers/acpi/power.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
> index 215ecd0..e5e01d9 100644
> --- a/drivers/acpi/power.c
> +++ b/drivers/acpi/power.c
> @@ -460,7 +460,7 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
> return ret;
>
> no_power_resource:
> - printk(KERN_WARNING PREFIX "Invalid Power Resource to register!");
> + printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!");
> return -ENODEV;
> }
> EXPORT_SYMBOL_GPL(acpi_power_resource_register_device);
> --
> 1.7.11.3
>

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

2012-08-24 22:36:26

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] ACPI: power: Use KERN_DEBUG when no power resources are found

On Thu, 2012-08-23 at 15:26 +0200, Borislav Petkov wrote:
> On Fri, Aug 10, 2012 at 10:05:53AM +0800, Aaron Lu wrote:
> > commit a606dac368eed5696fb38e16b1394f1d049c09e9 adds support to link
> > devices which have _PRx, if a device does not have _PRx, a warning
> > message will be printed.
> >
> > This commit is for ZPODD on Intel's platform, on AMD's platform, there
> > is no _PRx to support ZPODD, we use _PSx.
> >
> > So instead of printing a useless warning message on AMD's platform,
> > changing the print level to DEBUG to suppress this message.
[]
> > diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
[]
> > @@ -460,7 +460,7 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
> > return ret;
> >
> > no_power_resource:
> > - printk(KERN_WARNING PREFIX "Invalid Power Resource to register!");
> > + printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!");

Perhaps add something like:
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
printk(etc...)
instead?

2012-08-29 02:02:09

by Aaron Lu

[permalink] [raw]
Subject: Re: [PATCH] ACPI: power: Use KERN_DEBUG when no power resources are found

On Fri, Aug 24, 2012 at 03:36:21PM -0700, Joe Perches wrote:
> On Thu, 2012-08-23 at 15:26 +0200, Borislav Petkov wrote:
> > On Fri, Aug 10, 2012 at 10:05:53AM +0800, Aaron Lu wrote:
> > > commit a606dac368eed5696fb38e16b1394f1d049c09e9 adds support to link
> > > devices which have _PRx, if a device does not have _PRx, a warning
> > > message will be printed.
> > >
> > > This commit is for ZPODD on Intel's platform, on AMD's platform, there
> > > is no _PRx to support ZPODD, we use _PSx.
> > >
> > > So instead of printing a useless warning message on AMD's platform,
> > > changing the print level to DEBUG to suppress this message.
> []
> > > diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
> []
> > > @@ -460,7 +460,7 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
> > > return ret;
> > >
> > > no_power_resource:
> > > - printk(KERN_WARNING PREFIX "Invalid Power Resource to register!");
> > > + printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!");
>
> Perhaps add something like:
> if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
> printk(etc...)
> instead?

Sorry for not describing this problem clear, this would also occur on
Intel platforms as long as that device we are calling this register
function on does not have any power resource attached to it.

So the problem is actually, does the acpi_power_resource_register_device
function expect such input devices that they do not have any power
resource attached? If yes, then it shouldn't complain with a warning
message; if no, then we should probably check these conditions before
making such a call.

Looking at the function itself, I think it expects such devices so a
warning message here is not appropriate.

-Aaron