public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memory hotadd fixes [5/5] avoid registering res twice
@ 2006-08-03  3:37 KAMEZAWA Hiroyuki
  2006-08-04  0:23 ` keith mannthey
  0 siblings, 1 reply; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2006-08-03  3:37 UTC (permalink / raw)
  To: LKML; +Cc: LHMS, kmannth@us.ibm.com, y-goto@jp.fujitsu.com, Andrew Morton

both of acpi_memory_enable_device() and acpi_memory_add_device()
may evaluate _CRS method.

We should avoid evaluate device's resource twice if we could get it
successfully in past.

Signed-Off-By: KAMEZWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

 drivers/acpi/acpi_memhotplug.c |    4 ++++
 1 files changed, 4 insertions(+)

Index: linux-2.6.18-rc3/drivers/acpi/acpi_memhotplug.c
===================================================================
--- linux-2.6.18-rc3.orig/drivers/acpi/acpi_memhotplug.c	2006-08-02 14:12:45.000000000 +0900
+++ linux-2.6.18-rc3/drivers/acpi/acpi_memhotplug.c	2006-08-02 14:24:10.000000000 +0900
@@ -129,11 +129,15 @@
 	struct acpi_memory_info *info, *n;
 
 
+	if (!list_empty(&mem_device->res_list))
+		return 0;
+
 	status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
 				     acpi_memory_get_resource, mem_device);
 	if (ACPI_FAILURE(status)) {
 		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
 			kfree(info);
+		INIT_LIST_HEAD(&mem_device->res_list);
 		return -EINVAL;
 	}
 


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

* Re: [PATCH] memory hotadd fixes [5/5] avoid registering res twice
  2006-08-03  3:37 [PATCH] memory hotadd fixes [5/5] avoid registering res twice KAMEZAWA Hiroyuki
@ 2006-08-04  0:23 ` keith mannthey
  0 siblings, 0 replies; 2+ messages in thread
From: keith mannthey @ 2006-08-04  0:23 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki; +Cc: lkml, lhms-devel, y-goto@jp.fujitsu.com, Andrew Morton

On Thu, 2006-08-03 at 12:37 +0900, KAMEZAWA Hiroyuki wrote:
> both of acpi_memory_enable_device() and acpi_memory_add_device()
> may evaluate _CRS method.
> 
> We should avoid evaluate device's resource twice if we could get it
> successfully in past.
> 
> Signed-Off-By: KAMEZWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> 
>  drivers/acpi/acpi_memhotplug.c |    4 ++++
>  1 files changed, 4 insertions(+)
> 
> Index: linux-2.6.18-rc3/drivers/acpi/acpi_memhotplug.c
> ===================================================================
> --- linux-2.6.18-rc3.orig/drivers/acpi/acpi_memhotplug.c	2006-08-02 14:12:45.000000000 +0900
> +++ linux-2.6.18-rc3/drivers/acpi/acpi_memhotplug.c	2006-08-02 14:24:10.000000000 +0900
> @@ -129,11 +129,15 @@
>  	struct acpi_memory_info *info, *n;
>  
> 
> +	if (!list_empty(&mem_device->res_list))
> +		return 0;
> +
>  	status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
>  				     acpi_memory_get_resource, mem_device);
>  	if (ACPI_FAILURE(status)) {
>  		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
>  			kfree(info);
> +		INIT_LIST_HEAD(&mem_device->res_list);
>  		return -EINVAL;
>  	}

Looks fine to me. 

Acked-By: Keith Mannthey <kmannth@us.ibm.com>








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

end of thread, other threads:[~2006-08-04  0:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03  3:37 [PATCH] memory hotadd fixes [5/5] avoid registering res twice KAMEZAWA Hiroyuki
2006-08-04  0:23 ` keith mannthey

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