Skip to contentSkip to conversation

Fix Thinkpad A21m shutdown

PATCH In review Thomas Renninger 2 participants 2 messages Apr 12, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix Thinkpad A21m shutdown

Subject: Fix Thinkpad A21m shutdown

The A21m Thinkpad (maybe also others) have a GDCK method and a DOCK device. It seems that on others machines the GDCK is the docking device. Installing the notify handler for a GDCK device fails.
When module is unloaded it is tried to remove the never installed notify handler for the GDCK method which seems to freeze the machine.

Fix: Do not set notify_installed when installing the notify handler fails.

 drivers/acpi/ibm_acpi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/acpi/ibm_acpi.c +4 -2
Index: linux-2.6.16/drivers/acpi/ibm_acpi.c
===================================================================
@@ -1716,12 +1716,12 @@ static int __init setup_notify(struct ib
 	int ret;
 
 	if (!*ibm->handle)
-		return 0;
+		return 1;
 
 	ret = acpi_bus_get_device(*ibm->handle, &ibm->device);
 	if (ret < 0) {
 		printk(IBM_ERR "%s device not present\n", ibm->name);
-		return 0;
+		return 1;
 	}
 
 	acpi_driver_data(ibm->device) = ibm;
@@ -1811,6 +1811,8 @@ static int __init ibm_init(struct ibm_st
 		ret = setup_notify(ibm);
 		if (ret < 0)
 			return ret;
+		if (ret > 0)
+			return 0;
 		ibm->notify_installed = 1;
 	}
 
#1 lore raw
Quoted 8 lines · Thomas Renninger

The A21m Thinkpad (maybe also others) have a GDCK method and a DOCK device. It seems that on others machines the GDCK is the docking device. Installing the notify handler for a GDCK device fails.
When module is unloaded it is tried to remove the never installed notify handler for the GDCK method which seems to freeze the machine.

Fix: Do not set notify_installed when installing the notify handler fails.

Thanks, Thomas - makes sense. Len, please apply.

Regards,
Borislav

 drivers/acpi/ibm_acpi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/acpi/ibm_acpi.c +4 -2
Index: linux-2.6.16/drivers/acpi/ibm_acpi.c
===================================================================
@@ -1716,12 +1716,12 @@ static int __init setup_notify(struct ib
 	int ret;
 
 	if (!*ibm->handle)
-		return 0;
+		return 1;
 
 	ret = acpi_bus_get_device(*ibm->handle, &ibm->device);
 	if (ret < 0) {
 		printk(IBM_ERR "%s device not present\n", ibm->name);
-		return 0;
+		return 1;
 	}
 
 	acpi_driver_data(ibm->device) = ibm;
@@ -1811,6 +1811,8 @@ static int __init ibm_init(struct ibm_st
 		ret = setup_notify(ibm);
 		if (ret < 0)
 			return ret;
+		if (ret > 0)
+			return 0;
 		ibm->notify_installed = 1;
 	}