Re: [Lhms-devel] [RFC] Patch [1/2] for acpi_memhotplug.c

keith mannthey
2006-06-22T01:37:03Z

On Thu, 2006-06-22 at 09:13 +0900, KAMEZAWA Hiroyuki wrote:
> On Wed, 21 Jun 2006 16:23:47 -0700
> keith mannthey <kmannth@us.ibm.com> wrote:
> > Update. I have moved to 2.6.17-rc6-mm2 to work with the development
> > acpi_memhotplug driver there. I have added various debug statements and
> > this is what I know.
> >
> Thanks, looks informative.
>
> > acpi_memory_get_device calls acpi_bus_add
> > acpi_bus_add calls acpi_add_single_object (fails)
> > acpi_add_single_object passes acpi_bus_get_flags
> > finds the device present
> > passes acpi_device_set_context
> > calls acpi_device_register
> > after calling acpi_bus_find_driver
> > ends up
> > if (!result) *child = device;
> > and returns.
> >
>
> Then, "acpi_device" itself is added, but no driver data.
> acpi_add_single_object doesn't check return value of acpi_bus_find_driver(),
> as you know. So...
> ===
> static int acpi_bus_find_driver(struct acpi_device *device)
> {
> <snip>
> list_for_each_safe(node, next, &acpi_bus_drivers) {
> <snip>
> if (!acpi_bus_match(device, driver)) {
> (*)----------- result = acpi_bus_driver_init(device, driver);
> if (!result)
> goto Done;
> }
> ....
> }
> ===
> Next check point is:
> - acpi_bus_driver_init() is called or not
> - what acpi_bus_driver_init() returns

result = acpi_bus_driver_init(device, driver);
if (!result)
goto Done;

I goto Done.

> in acpi_bus_driver_init()
> - driver->ops.add() is called or not
> - what it retruns

It is called. But that is not the whole story.
In acpi_bus_driver_init it calls driver->ops.add(device). This ops.add
is not acpi_memory_device_add. I do get not any printks that I would
expect from acpi_memory_device_add.

If I print out in acpi_bus_driver_init
printk(" device_add() about %s\n",acpi_device_name(device));
result = driver->ops.add(device);

The device name is null. I don't think the device / driver combo that
has been passed in are the right ones.

> int acpi_memory_device_add()
> - it is called or not
> - why this fails.
This is not called.

After acpi_bus_driver_init calls the unknown .add it returns successfully.
it sets

device->driver = driver;
and
return 0;

Maybe I am picking the wrong driver from list_for_each_safe(node, next, &acpi_bus_drivers)
in acpi_bus_find_driver?

Thanks for your help.
--
keith mannthey <kmannth@us.ibm.com>
Linux Technology Center IBM