public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: keith mannthey <kmannth@us.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: linux acpi <linux-acpi@vger.kernel.org>,
	Patrick Mochel <mochel@linux.intel.com>,
	lhms-devel <lhms-devel@lists.sourceforge.net>,
	discuss <discuss@x86-64.org>, andrew <akpm@osdl.org>,
	Andi Kleen <ak@suse.de>, dave hansen <haveblue@us.ibm.com>,
	kame <kamezawa.hiroyu@jp.fujitsu.com>, konrad <darnok@us.ibm.com>
Subject: [Patch] 5/5 in support of hot-add memory x86_64 fix acpi motherboard.c
Date: Fri, 28 Jul 2006 19:53:00 -0700	[thread overview]
Message-ID: <1154141580.5874.149.camel@keithlap> (raw)

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

Hello All,
  This patch fixes an issue I encountered while doing hot-add memroy on
my platform (IBM Summit).     

  My system loads to acpi memory hot plug driver just fine during boot.
It installs and registers acpi_memory_device_driver and it's handler.
When the hot add memory event occurs the handler is called. this is the
relevant call path

acpi_memory_get_device
acpi_bus_add
acpi_add_single_object
acpi_bus_find_driver
acpi_bus_driver_init
driver->ops.add

  The algorithm it try to match devices from acpi_bus_drivers.  It looks
for drivers that are on the right bus and calls acpi_bus_driver_init.
If it gets a good return value for acpi_bus_driver_init it thinks it
found the device and returns.  The problem is the motherboard driver
driver->ops.add is getting called and it ALWAYS returns AE_OK. 

  The device that is passed back up the call chain is the wrong one (the
motherboard device) and whole things break down. 

  My solution is the make the motherboard value fail to return a AE_OK
for devices it does not expect (like my hot-add memory event).  

Without this patch I cannot do real hot-add memory with my hardware.  

Thanks to KAMEZAWA Hiroyuki for helping to debug the issue and Patrick
Mochel for providing input.   

This was built against 2.6.18-rc2.

Signed-off-by:  Keith Mannthey <kmannth@us.ibm.com>

[-- Attachment #2: patch-2.6.18-rc2-motherboard --]
[-- Type: text/x-patch, Size: 700 bytes --]

diff -urN orig/drivers/acpi/motherboard.c work/drivers/acpi/motherboard.c
--- orig/drivers/acpi/motherboard.c	2006-07-28 13:57:35.000000000 -0400
+++ work/drivers/acpi/motherboard.c	2006-07-28 16:39:22.000000000 -0400
@@ -87,6 +87,7 @@
 		}
 	} else {
 		/* Memory mapped IO? */
+		 return -EINVAL;
 	}
 
 	if (requested_res)
@@ -96,11 +97,16 @@
 
 static int acpi_motherboard_add(struct acpi_device *device)
 {
+	acpi_status status;
 	if (!device)
 		return -EINVAL;
-	acpi_walk_resources(device->handle, METHOD_NAME__CRS,
+
+	status = acpi_walk_resources(device->handle, METHOD_NAME__CRS,
 			    acpi_reserve_io_ranges, NULL);
 
+	if (ACPI_FAILURE(status)) 
+		return -ENODEV;
+	
 	return 0;
 }
 

                 reply	other threads:[~2006-07-29  2:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1154141580.5874.149.camel@keithlap \
    --to=kmannth@us.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=darnok@us.ibm.com \
    --cc=discuss@x86-64.org \
    --cc=haveblue@us.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@linux.intel.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