Fix Thinkpad A21m shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Not sure whether the shutdown still hangs with current kernels, it is at
least a fix that should go upstream. This one is in SUSE 10.1/SLE10
kernels.

I posted this one on linux-acpi twice, got OK from Borislav, see:
http://marc.theaimsgroup.com/?l=linux-acpi&m=114487806029130&w=2
but AFAIK it never got in...

Thanks,

    Thomas

From: Thomas Renninger <trenn@xxxxxxx>
Subject: Fix Thinkpad A21m shutdown
Patch-mainline: soon
References: 150851

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(-)

Signed-off-by: Thomas Renninger <trenn@xxxxxxx>

Index: linux-2.6.16/drivers/acpi/ibm_acpi.c
===================================================================
--- linux-2.6.16.orig/drivers/acpi/ibm_acpi.c
+++ 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;
 	}
 

--- Begin Message ---
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(-)

Signed-off-by: Thomas Renninger <trenn@xxxxxxx>

Index: linux-2.6.16/drivers/acpi/ibm_acpi.c
===================================================================
--- linux-2.6.16.orig/drivers/acpi/ibm_acpi.c
+++ 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;
 	}
 

--- End Message ---
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux