Thinkpad X61 hangs when removing from dock

Bug #189185 reported by Timo Aaltonen on 2008-02-05
98
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Linux
Fix Released
Medium
linux (Ubuntu)
Medium
Ben Collins
Hardy
Medium
Unassigned

Bug Description

I've had this problem since Hardy got the .24 kernel: removing the laptop from the docking station makes it hang. Actually, just pressing the "unlock" button on the dock is enough. Light turns to green, but the system is frozen.

This is not 100% reproducible, but close. I'll attach the dmesg shortly.

Timo Aaltonen (tjaalton) wrote :
Timo Aaltonen (tjaalton) wrote :

Ok, I found out why I was not able to reproduce it 100%.. it hangs only if I boot the computer docked, in other words if I boot it undocked I can dock/undock at will.

The same happens with my Thinkpad X60s. I haven't tried booting the laptop undocked, but I'll try that soon.

I booted the X60s undocked, and now I have no problems docking or undocking. I'm using Hardy with kernel 2.6.24-5-generic. If more info is needes, I'm more than happy to help.

Timo Aaltonen (tjaalton) wrote :

Cool, confirming the bug.

Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: New → Confirmed
Paweł (paff) wrote :

I have the same problem. Lenovo X61, Ubuntu Hardy (2.6.24-8-generic).

Just wondering.. Is this is the same bug?
http://bugzilla.kernel.org/show_bug.cgi?id=9874
There seems to be a fix released for that one already.

Timo Aaltonen (tjaalton) wrote :

Looks close enough, so I added the bug tracker here.

and I hope this get's in Hardy beta.

Changed in linux:
milestone: none → ubuntu-8.04-beta
status: Confirmed → Triaged
Changed in linux:
status: Unknown → Fix Released
Ben Collins (ben-collins) wrote :

This patch is going to require some back porting, and wont make it into beta.

Changed in linux:
assignee: ubuntu-kernel-team → ben-collins
status: Triaged → In Progress
Ben Collins (ben-collins) wrote :

Apparently that patch in #9874 is not relevant to this bug as the code that it reverts is not present in 2.6.24 kernels.

If you are still experiencing this problem with 2.6.24-12, there is some other issue going on.

Changed in linux:
status: In Progress → Incomplete

The problem remains with 2.6.24-12, just crashed my X60s this morning by pressing the undock button.

Timo Aaltonen (tjaalton) wrote :

Yep, same here.

OK, I found out the real reason why it crashes:
http://<email address hidden>/msg13151.html

So, when I have a DVD drive in my docking station's ultrabay and I boot while the laptop is in the dock, it correctly recognises the drive, but crashes when pressing the undock button. If the drive is taken away from the ultrabay and the laptop is booted in the dock, no crash happens.

Perhaps we need to catch the ACPI event generated by the undock button, and do something with it to the drive in the ultrabay?

Ben Collins (ben-collins) wrote :

The patch for this was included in a previous kernel upload.

Changed in linux:
status: Incomplete → Fix Released
Ben Collins (ben-collins) wrote :

There was another issue to fix here. We switched some drivers to pata as opposed to IDE, which should fix this in a future upload.

Timo Aaltonen (tjaalton) wrote :

This is not fixed, it still hangs using -14.

Changed in linux:
status: Fix Released → Triaged
milestone: ubuntu-8.04-beta → ubuntu-8.04

Confirming, -14 does not fix the problem.

Confirming this issue on a X60, with -15 too.

This is a regression since Gutsy.

Still happens with 2.6.24-16.30.

Köntzä (kontza) wrote :

I followed guidance found from ThinkWiki (Google: thinkwiki ultrabase, and grab any info you can find). I managed to undock my X60s without a crash. However, my machine hung when I put it to suspend after undocking, and then tried to wake it up. This was with -15.

Steve Langasek (vorlon) on 2008-04-30
Changed in linux:
milestone: ubuntu-8.04 → ubuntu-8.04.1
svasie (svasie) wrote :

I can confirm the same behaviour. Running Hardy (updated as of 5 May) on a Dell Latitude D620.

When the undock button is pressed the system frozes and keeps unresponsive even to SysRq combinations.

After rebooting the following is registered at /var/log/messages:

"ACPI: \_SB_.PCI0.PCIE.GDCK - undocking"

Same for me on a Thinkpad X60, running kernel 2.6.24-17.

machek (machek-gmx) wrote :

Same problem here with Thinkpad X40 and an Ultrabase X4. Running 2.6.24-17
I'd like to add that there's no dock under /proc/acpi/ibm, even if docked. Don't know if that matters.

Adrian Kubala (adrian-ubuntu) wrote :

I am also able to reproduce this with the ultradock x4. Based on http://alcopop.org/unix/linux/x40/dock/ I tried undocking using the kernel's dock interface:

echo 1 > /sys/devices/platform/dock.0/undock

This did indeed cause the dock light to go off and the monitor to switch back to the thinkpad screen, but then the laptop froze (it did not respond to typing on its keyboard and the second hand of xclock stopped moving), until I plugged it back into the dock, at which point it began working again.

I have attached the relevant lines from /var/log/messages. The most interesting one, occurring immediately after undocking, is:
Jun 4 09:59:52 ergates kernel: [ 1755.335605] ata2: soft resetting link
Jun 4 09:59:54 ergates kernel: [ 1756.965663] ata2: failed to recover some devices, retrying in 5 secs

Steve Langasek (vorlon) on 2008-06-06
Changed in linux:
importance: Undecided → Medium
status: New → Triaged
Steve Langasek (vorlon) on 2008-06-06
Changed in linux:
milestone: ubuntu-8.04.1 → none
David Monro (davidm-ub) wrote :

Confirmed here (although I'm running the Hardy kernel on Gutsy); any attempt to undock results in a hard lock. Which is one more reason not to upgrade to hardy yet :(

The thinwiki solution works for me:
http://www.thinkwiki.org/wiki/How_to_hotswap_UltraBay_devices

To dock, echo 0 0 0 > /sys/class/scsi_host/host1/scan (or whatever
host number your DVD drive is).
To undock, echo 1 > /sys/class/scsi_device/1:0:0:0/device/delete ("1"
corresponds to host"1" above").

This undock solution still leads to a crash during suspend/hibernate.
To get around that,
remove the dock and run the dock command. You effectively scan for a
non-existent device but it allows suspend/hibernate.

On Sun, Jun 8, 2008 at 5:22 PM, David Monro <email address hidden> wrote:
> Confirmed here (although I'm running the Hardy kernel on Gutsy); any
> attempt to undock results in a hard lock. Which is one more reason not
> to upgrade to hardy yet :(
>
> --
> Thinkpad X61 hangs when removing from dock
> https://bugs.launchpad.net/bugs/189185
> You received this bug notification because you are a direct subscriber
> of the bug.
>

nopoles (paul-2byteconsulting) wrote :

I have the same problem with my X61 tablet (7767A4U) and my UltraBase. If I boot the laptop while docked, it will freeze when I undock. If I boot the laptop while undocked, I can dock and undock but never have access to the DVD drive.

The dock/undock scripts from ThinkWiki resolved most of my issues. The scripts from the section "Scripts for hotswapping" of http://www.thinkwiki.org/wiki/How_to_hotswap_UltraBay_devices will successfully dock & undock the laptop and the DVD drive works while docked. However I have to run the scripts manually.

ACPI is not reporting any events from the docking station. The module "thinkpad_acpi" is loaded, and using acpi_listen I can monitor all the other acpi signals. However the undock button on the UltraBase is never captured, neither is the dock event. The documentation for the thinkpad_acpi module in the kernel source (Documentation/thinkpad-acpi.txt) says that for the ibm/bay acpi events to get caught the laptop must be booted while docked. The docs also indicate that the option CONFIG_THINKPAD_ACPI_BAY must be enabled, which it is if I look at /boot/config-2.6.24-19-generic.

This final step seems to be an ACPI problem. I did not see a bug reported for this issue. Should I file a new bug for this?

Yannick Gingras (ygingras) wrote :

I had the same problem with an X61. Upgrading the kernel to 2.6.26-rc8 from git solved the problem.

Timo Aaltonen (tjaalton) wrote :

This is fixed in Intrepid, but booting the hardy kernel still results in a crash.

Changed in linux:
status: Triaged → Fix Released

Cool. Well, it was a race between you guys and Windows. In Windows my
Thinkpad crashes when I plug it into the dock. In Linux, it crashes
when I remove it. The Linux crash is worse because it tends to kill my
data. But if it's fixed, I'll try Ubuntu again.

D

2008/8/15 Timo Aaltonen <email address hidden>:
> This is fixed in Intrepid, but booting the hardy kernel still results in
> a crash.
>
> ** Changed in: linux (Ubuntu)
> Status: Triaged => Fix Released
>
> --
> Thinkpad X61 hangs when removing from dock
> https://bugs.launchpad.net/bugs/189185
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in The Linux Kernel: Fix Released
> Status in "linux" source package in Ubuntu: Fix Released
> Status in linux in Ubuntu Hardy: Triaged
>
> Bug description:
> I've had this problem since Hardy got the .24 kernel: removing the laptop from the docking station makes it hang. Actually, just pressing the "unlock" button on the dock is enough. Light turns to green, but the system is frozen.
>
> This is not 100% reproducible, but close. I'll attach the dmesg shortly.
>

Jeffrey Baker (jwbaker) wrote :

Would be handy to have this backported to Hardy.

Dennis Heinson (dheinson) wrote :

This is NOT fixed in Intrepid. Timo, could you recheck please?
I am using 2.6.27-7-generic kernel. As before, removing the DVD Drive works around the problem.

Also, the USB ports on my Ultrabase X6 do not work after re-docking.

Dennis Heinson (dheinson) wrote :

After installing linux-backports-generic I am not able to reproduce anymore. The USB problem persists, I will open a separate bug report about that. Thank you

With 2.6.24 and linux-backports-generic, I still get this. Is there something else I should be doing?

David Monro (davidm-ub) wrote :

NOT fixed for me in intrepid, even with linux-backports-modules-intrepid installed. Manually running the ultrabay_eject script from thinkwiki beforehand fixes it - but that is a pain in the neck as I can't just hit the eject button. I don't appear to have a problem with the USB ports though...

Kernel 2.6.27-7-generic (2.6.27-7.16), bios version 2.16 (7NETB6WW)

Timo Aaltonen (tjaalton) wrote :

It works fine on my X61..

David Monro (davidm-ub) wrote :

Do you have an optical drive in the X6 ultrabase?

David Monro (davidm-ub) wrote :

Ahh! another thing - are you using 32bit or 64bit? I'm running 64bit, maybe it is only fixed for 32bit?

I have an optical drive and I am using 32 bit.

nopoles (paul-2byteconsulting) wrote :

I had this freezing problem with 64Bit Ubuntu 7.10 on my X61, 7767A4U. If the laptop booted on the docking station, ACPI would not trigger the proper disconnect scripts during undocking and the laptop would freeze. (It was possible to manually disconnect by executing the ACPI script, sometimes ;)

However I've been using 64Bit 8.10 Ubuntu for several weeks, and I'm happy to say that the docking station works properly.

If the laptop boots while connected to the docking station the CD and USB devices will work. Clicking the disconnect button on the side of the dock properly disconnects the CD and USB devices, and I can safely disconnect the laptop from the dock. Docking also works properly, all the devices are auto discovered and available.

brad (netcom61) wrote :

This problem is fixed in Ubuntu 8.10 on IBM Thinkpad X31. -- It's working ok.

Sean Kennedy (sean-worker) wrote :

it looks like this is still a problem with an X61 and 9.04.

following the instructions at:
http://ubuntuforums.org/archive/index.php/t-833043.html

seems to have got past the hang

also, I'm using the x86 server kernel: linux-image-2.6.27-11-server

Raphaël HALIMI (raph) wrote :

Hi, using all information gathered mainly here and on ThinkWiki, I made a little package as a workaround for this bug (and others). It should work out-of-the-box for everyone who has an UltraBase with a CD/DVD in the UltraBay (but it should work with any brand handled by the new kernel's dock driver).

It's available at my PPA: https://launchpad.net/~raph/+archive/ppa

Its main component is a shell script that handles docking and undocking events, as well as bay's ejection or insertion (all are handled by the dock driver as of 2.6.28). It detects the type of dock triggering the event (ata_bay or dock_station) and try to unmount and unregister the device before undocking.

As of right now, it doesn't detect the type of device present in a bay (/sys/devices/platform/dock.?/block is missing, maybe because the dock driver is loaded into memory after block devices drivers, see at the end of the dock driver source), so this could be considered dirty because you have to specify in the config file the type of device you're using (defaults to /dev/sr0 on SCSI host 1:0:0:0). It seems that it's the best we can do in Jaunty without recompiling the kernel.

Another problem is the undock button. By default the dock driver disconnects immediately any device connected to the dock triggering the event, before the script could be run; to change this, we have to pass an option to the dock driver, but in Jaunty it's built-in the kernel, so you have to pass it to the kernel via the bootloader. If you use grub, my package can add "dock.immediate_undock=0" to your config file, in order to allow the use of the UltraBase eject button (similar code for lilo welcome).

And, last but not the least, it detects if you have a ThinkPad and if so, it binds the eject hotkey (Fn-F9) by adding a file to ACPI events config directory, so you can use the hotkey as well as the eject button.

Hope it helps.

Thomas Hood (jdthood) wrote :

The hang no longer occurs in Karmic.

Agreed.

thinkpad (fellowsgarden) wrote :

Hi,

Problem persists on Maverick (IBM Thinkpad X41 and X4 Docking Station).

Has anyone tried and been successful with

Raphaël HALIMI's
udev-dock_0.2_all.deb
https://launchpad.net/~raph/+archive/ppa

on Maverick ?

THANKS !

tp

PS:
What I shall try later is to remove the DVD drive from the docking station (when computer's off), as I don't use it often anyway and see if the trouble persists... I'll report if it works.

(I hadn't tested it on Karmic or any other earlier versions).

thinkpad (fellowsgarden) wrote :

No change for me when undocking / docking without the DVD drive in the docking station. So I guess earlier workarounds where you "delete" or otherwise unmount the DVD drive won't do the trick then either.

:-(

The only "workaround" I can see for me at the moment is to "Shut Down" Ubuntu and restart every time I want to dock / undock... or go back to XP.......... :-(

tp

Changed in linux:
importance: Unknown → Medium
Julian Wiedmann (jwiedmann) wrote :

This release has reached end-of-life [0].

[0] https://wiki.ubuntu.com/Releases

Changed in linux (Ubuntu Hardy):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.