[ltp] Re: What are people using for Dock/Undocking scripts for their X60/61's?

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Sat, 7 Mar 2009 09:49:38 -0300


On Sat, 07 Mar 2009, Thomas Hood wrote:
> Theodore Tso wrote:
>> the problem is that right after you push the
>> button, it disconnects the hard drive right away.
>
> That is, pressing the undock button causes immediate (electronic)
> disconnection.  And this causes an immediate hang in the kernel.
>
> Assuming we want undocking to be as effortless as possible there
> are two solutions.
>
> 1. Change Linux so that it does not hang when the Ultrabay Slim
> drive disappears without warning.

This is obviously a big bad bug, and needs fixing. libata has eject
support, and that should be *ALSO* properly connected to the ACPI
bay/dock driver if needed, so that dumb things don't happen.

And all of this needs to be taught about thinkpads, which are well
engineered and have two-stage undocking ("request", "undock").

> 2. Avoid using the "undock" button on the UltraBase; instead hook
> a hotkey such as Fn-F9 to do something like:
>
>    echo 1 >  /sys/class/scsi_device/1:0:0:0/device/delete
>    echo eject > /proc/acpi/ibm/bay
>    echo 1 > /sys/devices/platform/dock.0/undock

Ugly bandaid from hell.  Let's just fix the damn bugs.  The kernel
KNOWS which ACPI node belongs to which device, it is high time it
learned to do smart things with that information... in fact, it
already tries to AFAIK, so there must be something broken instead of
just missing...

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh