public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: keith mannthey <kmannth@us.ibm.com>
To: linux-acpi@vger.kernel.org
Cc: Prarit Bhargava--redhat <prarit@redhat.com>,
	konrad <darnok@us.ibm.com>,
	external hotplug mem list <lhms-devel@lists.sourceforge.net>
Subject: Re: [Lhms-devel] [RFC] Patch [1/1] for acpi_memhotplug.c
Date: Tue, 20 Jun 2006 19:10:40 -0700	[thread overview]
Message-ID: <1150855840.5873.57.camel@keithlap> (raw)
In-Reply-To: <1150853300.5873.49.camel@keithlap>

[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]

On Tue, 2006-06-20 at 18:28 -0700, keith mannthey wrote:
> Hello again,
>   I am still without a working acpi memory driver for my hardware (with
> extra patches).  I posted patches a long while ago but have been off
> doing other things for a while.  
>   
> 1. The current driver is unable to created the mem_device from the hot-
> add event and the hot-add fails with out adding any memory to the
> system. I have address_resources attached to the acpi handle but in
> acpi_memory_get_device calling the path of 
> 
> acpi_bus_get_device
> acpi_get_parent
> acpi_bus_get_device /*for parent*/
> acpi_bus_add /*to created the memory device */
> 
> just doesn't create the memory_device and I don't know why.  Perhaps
> something about the event is off but I have had a fair amount of
> communication with the bios writers about this issue and everything
> looks ok to us.  The odd things is acpi_bus_add doesn't complain it
> happily returns success but no memory_device was attached to the
> device. 
> 
>   If you know how to debug this event better please advise. 
> 
>   If I look at the resources associated with the handle there is
> appropriate data to do the hot-add event (memory range data). I simply
> insert a function that creates the memory device directly from the
> handle and it's data(See attached patch) and the event carries on as
> expected.  
> 
> The patch applies and work just fine against 2.6.17 and it doesn't break
> the current call implementation.  
> 
> Any ideas?
> 
> Signed-off-by:  Keith Mannthey <kmannth@us.ibm.com>

Sorry for the repost to some I had the old acpi list on the cc.

[-- Attachment #2: acpi_mem_fixv3.patch --]
[-- Type: text/x-patch, Size: 1741 bytes --]

--- linux-2.6.15-rc1-orig/drivers/acpi/acpi_memhotplug.c	2005-11-14 10:56:13.000000000 -0800
+++ linux-2.6.15-rc1/drivers/acpi/acpi_memhotplug.c	2005-11-16 20:06:47.000000000 -0800
@@ -110,6 +110,32 @@
 	return_VALUE(0);
 }
 
+static int 
+acpi_memory_get_current_resource(acpi_handle handle, struct acpi_memory_device **return_device) {
+	
+	int result;
+	struct acpi_memory_device *mem_device;
+
+	ACPI_FUNCTION_TRACE("acpi_memory_get_current_resource");
+	
+	mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
+	if (!mem_device)
+		return_VALUE(-ENOMEM);
+	memset(mem_device,0, sizeof(struct acpi_memory_device));
+
+	mem_device->handle = handle;
+	result = acpi_memory_get_device_resources(mem_device);
+	if (result) {
+		kfree(mem_device);
+		return_VALUE(result);
+	}
+	mem_device->state = MEMORY_POWER_ON_STATE;
+	*return_device = mem_device;
+	
+	return_VALUE(result);
+}
+
+
 static int
 acpi_memory_get_device(acpi_handle handle,
 		       struct acpi_memory_device **mem_device)
@@ -118,6 +144,7 @@
 	acpi_handle phandle;
 	struct acpi_device *device = NULL;
 	struct acpi_device *pdevice = NULL;
+	int result;
 
 	ACPI_FUNCTION_TRACE("acpi_memory_get_device");
 
@@ -147,14 +174,17 @@
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n"));
 		return_VALUE(-EINVAL);
 	}
-
       end:
 	*mem_device = acpi_driver_data(device);
+
 	if (!(*mem_device)) {
-		printk(KERN_ERR "\n driver data not found");
-		return_VALUE(-ENODEV);
+		/* Try and get the memory_device from the current handle */
+		result = acpi_memory_get_current_resource(handle,mem_device);
+		if (result) {
+			printk(KERN_ERR "\nThere is no data for this memory device\n");
+			return_VALUE(-EINVAL);
+		}
 	}
-
 	return_VALUE(0);
 }
 

[-- Attachment #3: SSDT.dsl.gz --]
[-- Type: application/x-gzip, Size: 7562 bytes --]

  parent reply	other threads:[~2006-06-21  2:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-18 20:51 Re: [Lhms-devel] [PATCH 1/1] patch to fix acpi_memhotplug.c Moore, Robert
     [not found] ` <971FCB6690CD0E4898387DBF7552B90E0378BEE7-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2005-11-19 10:44   ` Erik Slagter
2005-11-19 12:15   ` Kamezawa Hiroyuki
     [not found]     ` <1150853300.5873.49.camel@keithlap>
2006-06-21  2:10       ` keith mannthey [this message]
     [not found]       ` <20060621114334.1b954854.kamezawa.hiroyu@jp.fujitsu.com>
     [not found]         ` <1150863525.7865.6.camel@keithlap>
     [not found]           ` <20060621194832.37124aae.kamezawa.hiroyu@jp.fujitsu.com>
2006-06-21 18:43             ` [Lhms-devel] [RFC] Patch [1/2] for acpi_memhotplug.c keith mannthey
2006-06-21 23:23               ` keith mannthey
2006-06-22  0:13                 ` KAMEZAWA Hiroyuki
2006-06-22  1:37                   ` keith mannthey
2006-06-22  1:58                     ` KAMEZAWA Hiroyuki
2006-06-22  2:19                       ` keith mannthey
2006-06-22  3:13                         ` KAMEZAWA Hiroyuki
2006-06-22  3:55                           ` keith mannthey
2006-06-22  5:20                             ` KAMEZAWA Hiroyuki
2006-06-22  6:11                               ` KAMEZAWA Hiroyuki
2006-06-22  7:01                               ` KAMEZAWA Hiroyuki
2006-06-22 17:25                               ` keith mannthey
2006-06-22 17:41                                 ` KAMEZAWA Hiroyuki
2006-06-22 18:29                                   ` keith mannthey
2006-06-22 19:07                                     ` keith mannthey
2006-06-22  2:28                       ` keith mannthey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1150855840.5873.57.camel@keithlap \
    --to=kmannth@us.ibm.com \
    --cc=darnok@us.ibm.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=prarit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox