From: keith mannthey <kmannth@us.ibm.com>
To: lhms-devel <lhms-devel@lists.sourceforge.net>
Cc: linux-mm <linux-mm@kvack.org>, dave hansen <haveblue@us.ibm.com>,
kame <kamezawa.hiroyu@jp.fujitsu.com>,
intel-acpi <acpi@linux.intel.com>
Subject: [RFC] Patch [4/4] x86_64 sparsmem add- acpi fixup take 2 motherboard.c
Date: Fri, 23 Jun 2006 19:06:17 -0700 [thread overview]
Message-ID: <1151114777.7094.53.camel@keithlap> (raw)
[-- Attachment #1: Type: text/plain, Size: 1930 bytes --]
patch against the motherboard driver. I am unsure what the correct fix
is but there are 3 options.
1. The motherboard driver needs to be fixed (my patch or something like
it)
2. The algorithm in acpi_bus_match/acpi_bus_find_driver is flawed.
3. There is somthing wrong with the ACPI namespace on the box (BIOS).
Let me explain what is happening from a I don't know much about acpi
point of view.
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 and
things break down.
My fix is to make the motherboard driver return an error when it sees
resources it doesn't know about. I don't know if this is the correct
solution or to but it highlights the problem I am having. With this
patch in place this work as expected with regards to the acpi memory
device.
Kame (who helped me greatly in tracking down the source my troubles)
thinks that the root cause is that the device has both a _HID and _CID
The driver for _HID is different for _CID and the driver for _CID is
found before _HID and I run the wrong add.
I am not sure what the correct solution to this problem is. Built
against 2.6.17-mm1 but should apply with fuzz just about anywhere.
Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
[-- Attachment #2: patch-2.6.17-mm1-motherboard --]
[-- Type: text/x-patch, Size: 780 bytes --]
diff -urN linux-2.6.17-mm1-orig/drivers/acpi/motherboard.c linux-2.6.17-mm1/drivers/acpi/motherboard.c
--- linux-2.6.17-mm1-orig/drivers/acpi/motherboard.c 2006-06-23 16:12:01.000000000 -0400
+++ linux-2.6.17-mm1/drivers/acpi/motherboard.c 2006-06-23 18:22:25.000000000 -0400
@@ -88,6 +88,7 @@
}
} else {
/* Memory mapped IO? */
+ return -EINVAL;
}
if (requested_res)
@@ -97,12 +98,14 @@
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);
- return 0;
+ return status;
}
static struct acpi_driver acpi_motherboard_driver1 = {
next reply other threads:[~2006-06-24 2:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-24 2:06 keith mannthey [this message]
2006-06-24 7:46 ` KAMEZAWA Hiroyuki
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=1151114777.7094.53.camel@keithlap \
--to=kmannth@us.ibm.com \
--cc=acpi@linux.intel.com \
--cc=haveblue@us.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-mm@kvack.org \
/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