Why can't _CRS be found in ->remove?
In the driver's ->add method, I can walk _CRS just fine:
acpi_gpe_block_add; handle = e0000763fdf8bd80acpi_gpe_block_add; handle = e0000763fdf8bc40acpi_gpe_block_add; handle = e0000763fefc03c0acpi_gpe_block_add; handle = e0000763fefc0240
But in the ->remove method, it fails:
acpi_gpe_block_remove: handle = e0000763fdf8bd80report_method_error: Could not get node _CRSacpi_gpe_block_remove: handle = e0000763fdf8bc40report_method_error: Could not get node _CRSacpi_gpe_block_remove: handle = e0000763fefc03c0report_method_error: Could not get node _CRSacpi_gpe_block_remove: handle = e0000763fefc0240report_method_error: Could not get node _CRS
Here's the relevant code snippets:
static int acpi_gpe_block_add(struct acpi_device *device)
{
struct gpe_block block;
printk("acpi_gpe_block_add; handle = %p\n", device->handle);
block.register_count = 0;
acpi_walk_resources(device->handle, METHOD_NAME__CRS,
acpi_gpe_block_crs_add, &block);
if (block.register_count == 0)
return 0;
printk("calling acpi_install_gpe_block\n");
return acpi_install_gpe_block(device->handle, &block.address,
block.register_count, block.interrupt_level);
}static int acpi_gpe_block_remove(struct acpi_device *device, int type)
{
int status = acpi_remove_gpe_block(device->handle);
printk("acpi_gpe_block_remove: handle = %p\n", device->handle);
acpi_walk_resources(device->handle, METHOD_NAME__CRS,
acpi_gpe_block_crs_remove, NULL);
return status;
}static struct acpi_driver acpi_gpe_block_driver = {
.name = NAME,
.ids = "ACPI0006",
.ops = {
.add = acpi_gpe_block_add,
.remove = acpi_gpe_block_remove,
},
};
BTW, I made a small change to get a better error message. I'd appreciate something like this being in future ACPICA releases:
Index: drivers/acpi/namespace/nsutils.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/acpi/namespace/nsutils.c,v retrieving revision 1.5
acpi/namespace/nsutils.c 7 Nov 2004 02:37:21 -0000 renamed from acpi/namespace/nsutils.c 30 Mar 2004 12:42:26 -0000 1.5 +0 -0
@@ -143,7 +143,8 @@ acpi_ns_report_method_error ( if (path) { status = acpi_ns_get_node_by_path (path, prefix_node, ACPI_NS_NO
_UPSEARCH, &node);
if (ACPI_FAILURE (status)) {
- acpi_os_printf ("report_method_error: Could not get node
\n");
+ acpi_os_printf ("report_method_error: Could not get "
+ "node %s\n", path);
return;
}
}Signature · 13 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
Quoted 8 lines · Matthew Wilcox
static int
acpi_gpe_block_remove(struct acpi_device *device, int type){ int status = acpi_remove_gpe_block(device->handle); printk("acpi_gpe_block_remove: handle = %p\n", device->handle); acpi_walk_resources(device->handle, METHOD_NAME__CRS, acpi_gpe_block_crs_remove, NULL); return status; }
The problem here was that I was removing the GPE blocks that were part of the FADT block. Oops. That must've corrupted "a few" things ;-)
Things are working much better now ... a couple of interrupt problems still. More tomorrow or Monday.
Signature · 13 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click