Patchwork ACPI / PCI / hotplug: Avoid warning when _ADR not present

login
register
mail settings
Submitter Toshi Kani
Date Nov. 27, 2013, 8:33 p.m.
Message ID <1385584389-22461-1-git-send-email-toshi.kani@hp.com>
Download mbox | patch
Permalink /patch/294654/
State Not Applicable
Headers show

Comments

Toshi Kani - Nov. 27, 2013, 8:33 p.m.
acpiphp_enumerate_slots() walks ACPI namenamespace under
a PCI host bridge with callback register_slot().
register_slot() evaluates _ADR for all the device objects
and emits a warning message for any error.  Some platforms
have _HID device objects (such as HPET and IPMI), which
trigger unnecessary warning messages.

This patch avoids emitting a warning message when a target
device object does not have _ADR.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
Patch is based on Linus's tree (3.13-rc1).
---
 drivers/pci/hotplug/acpiphp_glue.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki - Nov. 28, 2013, 2:15 p.m.
On Wednesday, November 27, 2013 01:33:09 PM Toshi Kani wrote:
> acpiphp_enumerate_slots() walks ACPI namenamespace under
> a PCI host bridge with callback register_slot().
> register_slot() evaluates _ADR for all the device objects
> and emits a warning message for any error.  Some platforms
> have _HID device objects (such as HPET and IPMI), which
> trigger unnecessary warning messages.
> 
> This patch avoids emitting a warning message when a target
> device object does not have _ADR.
> 
> Signed-off-by: Toshi Kani <toshi.kani@hp.com>
> ---
> Patch is based on Linus's tree (3.13-rc1).

Queued up as a fix for 3.13, thanks!

> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index 1cf605f..438a4d0 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -279,7 +279,9 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
>  
>  	status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
>  	if (ACPI_FAILURE(status)) {
> -		acpi_handle_warn(handle, "can't evaluate _ADR (%#x)\n", status);
> +		if (status != AE_NOT_FOUND)
> +			acpi_handle_warn(handle,
> +				"can't evaluate _ADR (%#x)\n", status);
>  		return AE_OK;
>  	}
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 1cf605f..438a4d0 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -279,7 +279,9 @@  static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
 
 	status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
 	if (ACPI_FAILURE(status)) {
-		acpi_handle_warn(handle, "can't evaluate _ADR (%#x)\n", status);
+		if (status != AE_NOT_FOUND)
+			acpi_handle_warn(handle,
+				"can't evaluate _ADR (%#x)\n", status);
 		return AE_OK;
 	}