public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device
@ 2010-07-13  3:36 yakui.zhao
  2010-07-21  2:15 ` ykzhao
  0 siblings, 1 reply; 3+ messages in thread
From: yakui.zhao @ 2010-07-13  3:36 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, Zhao Yakui

From: Zhao Yakui <yakui.zhao@intel.com>

The _ADR object is used to provide OSPM with the address of one device on its
parent bus. In course of finding ACPI handle for the corresponding PCI device,
we will firstly evaluate the _ADR object and then compare the two addresses to
see whether it is the target ACPI device. But for one PCI device(0000:00:00.0)
under the PCI root bridge, the corresponding address will be constructed as
zero.In such case maybe the ACPI device without _ADR object will be misdetected
and then be used to create the relationship between PCI device and ACPI device.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
---
 drivers/acpi/glue.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 4af6301..78b0164 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -100,7 +100,8 @@ do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv)
 
 	status = acpi_get_object_info(handle, &info);
 	if (ACPI_SUCCESS(status)) {
-		if (info->address == find->address)
+		if ((info->address == find->address)
+			&& (info->valid & ACPI_VALID_ADR))
 			find->handle = handle;
 		kfree(info);
 	}
-- 
1.5.4.5


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

* Re: [PATCH] ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device
  2010-07-13  3:36 [PATCH] ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device yakui.zhao
@ 2010-07-21  2:15 ` ykzhao
  2010-07-27  2:33   ` Len Brown
  0 siblings, 1 reply; 3+ messages in thread
From: ykzhao @ 2010-07-21  2:15 UTC (permalink / raw)
  To: lenb@kernel.org; +Cc: linux-acpi@vger.kernel.org

On Tue, 2010-07-13 at 11:36 +0800, Zhao, Yakui wrote:
> From: Zhao Yakui <yakui.zhao@intel.com>
> 
> The _ADR object is used to provide OSPM with the address of one device on its
> parent bus. In course of finding ACPI handle for the corresponding PCI device,
> we will firstly evaluate the _ADR object and then compare the two addresses to
> see whether it is the target ACPI device. But for one PCI device(0000:00:00.0)
> under the PCI root bridge, the corresponding address will be constructed as
> zero.In such case maybe the ACPI device without _ADR object will be misdetected
> and then be used to create the relationship between PCI device and ACPI device.

This patch is to fix the following bug:

https://bugzilla.kernel.org/show_bug.cgi?id=16422

> 
> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> ---
>  drivers/acpi/glue.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
> index 4af6301..78b0164 100644
> --- a/drivers/acpi/glue.c
> +++ b/drivers/acpi/glue.c
> @@ -100,7 +100,8 @@ do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv)
>  
>  	status = acpi_get_object_info(handle, &info);
>  	if (ACPI_SUCCESS(status)) {
> -		if (info->address == find->address)
> +		if ((info->address == find->address)
> +			&& (info->valid & ACPI_VALID_ADR))
>  			find->handle = handle;
>  		kfree(info);
>  	}


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

* Re: [PATCH] ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device
  2010-07-21  2:15 ` ykzhao
@ 2010-07-27  2:33   ` Len Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Len Brown @ 2010-07-27  2:33 UTC (permalink / raw)
  To: ykzhao; +Cc: linux-acpi@vger.kernel.org

applied

thanks,
Len Brown, Intel Open Source Technology Center


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

end of thread, other threads:[~2010-07-27  2:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-13  3:36 [PATCH] ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device yakui.zhao
2010-07-21  2:15 ` ykzhao
2010-07-27  2:33   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox