Re: Re: [Lhms-devel] [PATCH 1/1] patch to fix acpi_memhotplug.c

KAMEZAWA Hiroyuki
2005-11-17T06:08:44Z

keith wrote:
>
> My add event is called with my patch. The notify event is triggering
> and falling into the right path.
>
> I tried your patch but my device is not making and add event. I really
> looks to just be a notify with the memory range attached. I really
> think my patch is the right way to go for my hardware.
>
>
Could you show your AML tree around Memory ?
I'm interested in.

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);
+ }
}
I'm not sure why this is *right* way.

This is traditinal way to attach driver data to device.
==
acpi_bus_add() ->
acpi_add_single_object() -> ----------------(*) acpi_device is create here.
acpi_bus_find_driver()->
acpi_bus_driver_init()->
driver->ops.add()
==

Maybe driver->ops.add is not called for some reason.
What happens in acpi_add_single_object() in your environment ?
acpi_bus_find_driver() is called ?

-- Kame