public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add Ultrabay support for the T60p Thinkpad
@ 2006-12-10  5:13 Theodore Ts'o
  2006-12-10 12:49 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
  2006-12-31 16:29 ` Henrique de Moraes Holschuh
  0 siblings, 2 replies; 4+ messages in thread
From: Theodore Ts'o @ 2006-12-10  5:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, ibm-acpi-devel

Add Ultrabay Support for the T60p Thinkpad

The following patch adds support for obtaining the status and ejecting
Ultrabay devices for the T60p Thinkpad; my guess is that it probably
works on T60 Thinkpads and probably more recent Lenovo latops as well.

With the 2.03 BIOS I have been able to eject a SATA drive in an Ultrabay
carrier by using the command:

  "echo 1 > /sys/class/scsi_device/1:0:0:0/device/delete"

and upon re-inserting the it back into the device and issuing the
command:

 "echo 0 0 0 > /sys/class/scsi_host/host1/scan"

have the device appear again.  (With the 1.02 BIOS the device does not
function when re-inserted, even after a warm boot; a cold reboot is
required to store the Ultrabay device's functionality.)

More complicated Ultrabay eject and insert scripts can be found on the
ThinkWiki, although it's important to comment out the "hdparm -Y" as it
apparently doesn't work or do anything, and causes the eject process to
hang for about a minute.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

Index: 2.6.19/drivers/acpi/ibm_acpi.c
===================================================================
--- 2.6.19.orig/drivers/acpi/ibm_acpi.c	2006-12-09 18:35:09.000000000 -0500
+++ 2.6.19/drivers/acpi/ibm_acpi.c	2006-12-09 18:35:42.000000000 -0500
@@ -169,6 +169,7 @@
 #endif
 IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST",	/* 570 */
 	   "\\_SB.PCI0.IDE0.IDES.IDSM",	/* 600e/x, 770e, 770x */
+	   "\\_SB.PCI0.IDE0.PRIM.MSTR",	/* T60p */
 	   "\\_SB.PCI0.IDE0.SCND.MSTR",	/* all others */
     );				/* A21e, R30, R31 */
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ibm-acpi-devel] [PATCH] Add Ultrabay support for the T60p Thinkpad
  2006-12-10  5:13 [PATCH] Add Ultrabay support for the T60p Thinkpad Theodore Ts'o
@ 2006-12-10 12:49 ` Henrique de Moraes Holschuh
  2006-12-10 19:15   ` Theodore Tso
  2006-12-31 16:29 ` Henrique de Moraes Holschuh
  1 sibling, 1 reply; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2006-12-10 12:49 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-kernel, akpm, ibm-acpi-devel

On Sun, 10 Dec 2006, Theodore Ts'o wrote:
> Add Ultrabay Support for the T60p Thinkpad

Thanks, an equivalent patch is alredy merged in acpi-test, and waiting a
push to linus.

BTW: this is an ACK if you want to merge this patch ahead of the stuff in
acpi-test.

> Ultrabay devices for the T60p Thinkpad; my guess is that it probably
> works on T60 Thinkpads and probably more recent Lenovo latops as well.

It works on all *60 and *61 new ThinkPads, yes.

> have the device appear again.  (With the 1.02 BIOS the device does not
> function when re-inserted, even after a warm boot; a cold reboot is
> required to store the Ultrabay device's functionality.)

Nice to know that, thanks.

Take a look on the experimental ACPI bay and dock support in acpi-test, it
is even better than ibm-acpi's builtin support... and in fact, deprecates
it.

-- 
  "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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Add Ultrabay support for the T60p Thinkpad
  2006-12-10 12:49 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
@ 2006-12-10 19:15   ` Theodore Tso
  0 siblings, 0 replies; 4+ messages in thread
From: Theodore Tso @ 2006-12-10 19:15 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh; +Cc: linux-kernel, akpm, ibm-acpi-devel

On Sun, Dec 10, 2006 at 10:49:46AM -0200, Henrique de Moraes Holschuh wrote:
> 
> Thanks, an equivalent patch is alredy merged in acpi-test, and waiting a
> push to linus.
> 
> BTW: this is an ACK if you want to merge this patch ahead of the stuff in
> acpi-test.

Great, I don't think I saw any mention of T60 support on the
linux-thinkpad mailing list, so I didn't realize this work had already
been done.  Would have saved me all of 15 minutes or so.  :-)

When is acpi-test scehduled to be merged?  If it's going to be pushed
soon into mainline, then I don't want to make any extra work for
folks.  If it's going to be a while, the patch is pretty simple and
low-risk, so hopefully it can get merged quickly.

> > have the device appear again.  (With the 1.02 BIOS the device does not
> > function when re-inserted, even after a warm boot; a cold reboot is
> > required to store the Ultrabay device's functionality.)
> 
> Nice to know that, thanks.

I wasn't quite exact in describing the problem originally, so for the
record, if you are using a 1.02/1.04 BIOS, if all you do is
disassociate the device using:

  "echo 1 > /sys/class/scsi_device/1:0:0:0/device/delete"

it's fine.  But if you apply this patch and then actually shut the bay using:

  "echo eject > /proc/acpi/ibm/bay"

Then when you re-insert the disk, it will appear to be probed, but any
attempt to read or write from the disk will return an error, and doing
a shutdown and trying to boot off of the device will also result in an
error.  Only a power-cycle will restore the Ultrabay to usability.
When I upgraded to the 2.03 BIOS, it worked just fine, so I assume
this was a BIOS and/or DSDT bug fix.

> Take a look on the experimental ACPI bay and dock support in acpi-test, it
> is even better than ibm-acpi's builtin support... and in fact, deprecates
> it.

Great, I'll have to look at it.  In the meantime, here's an updated
patch which only changes the documentation and comments.  I'll leave
it to Andrew/Linus to decide whether they want to merge this patch or
acpi-test.

						- Ted

Add Ultrabay Support for the T60p Thinkpad

The following patch adds support for obtaining the status and ejecting
Ultrabay devices for the T60p Thinkpad; my guess is that it probably
works on T60 Thinkpads and probably more recent Lenovo latops as well.

With the 2.03 BIOS I have been able to eject a SATA drive in an Ultrabay
carrier by using the commands:

  "echo 1 > /sys/class/scsi_device/1:0:0:0/device/delete"
  "echo eject > /proc/acpi/ibm/bay"

and upon re-inserting the it back into the device and issuing the
command:

 "echo 0 0 0 > /sys/class/scsi_host/host1/scan"

have the device appear again.  (With the 1.02 BIOS the device does not
function when re-inserted, even after a warm boot; a cold reboot is
required to store the Ultrabay device's functionality.)

More complicated Ultrabay eject and insert scripts can be found on the
ThinkWiki, although it's important to comment out the "hdparm -Y" as it
apparently doesn't work or do anything, and causes the eject process to
hang for about a minute.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

Index: 2.6.19/drivers/acpi/ibm_acpi.c
===================================================================
--- 2.6.19.orig/drivers/acpi/ibm_acpi.c	2006-12-09 18:35:09.000000000 -0500
+++ 2.6.19/drivers/acpi/ibm_acpi.c	2006-12-09 18:35:42.000000000 -0500
@@ -169,6 +169,7 @@
 #endif
 IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST",	/* 570 */
 	   "\\_SB.PCI0.IDE0.IDES.IDSM",	/* 600e/x, 770e, 770x */
+	   "\\_SB.PCI0.IDE0.PRIM.MSTR",	/* {T,Z}]6{0,1}[p] */
 	   "\\_SB.PCI0.IDE0.SCND.MSTR",	/* all others */
     );				/* A21e, R30, R31 */
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add Ultrabay support for the T60p Thinkpad
  2006-12-10  5:13 [PATCH] Add Ultrabay support for the T60p Thinkpad Theodore Ts'o
  2006-12-10 12:49 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
@ 2006-12-31 16:29 ` Henrique de Moraes Holschuh
  1 sibling, 0 replies; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2006-12-31 16:29 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-kernel, akpm, ibm-acpi-devel, Whoopie

Whoopie from ThinkWiki just sent me an email, calling my attention to the
fact that the patch you submitted is in fact different from the one I
merged... something I should have triple-verified.  It appears the t60p has
the bay in a different ACPI node than some other *60 ThinkPads.  Either
that, or the node moves depending on ICHR mode set in the BIOS.

So I apologise for the screw up, and:

Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

I am merging your patch into the ibm-acpi tree and will ask Len to push it
to Linus.  Now, please excuse me while I go look for a new brown-paperbag
hat...

On Sun, 10 Dec 2006, Theodore Ts'o wrote:
> Add Ultrabay Support for the T60p Thinkpad
> 
> The following patch adds support for obtaining the status and ejecting
> Ultrabay devices for the T60p Thinkpad; my guess is that it probably
> works on T60 Thinkpads and probably more recent Lenovo latops as well.
> 
> With the 2.03 BIOS I have been able to eject a SATA drive in an Ultrabay
> carrier by using the command:
> 
>   "echo 1 > /sys/class/scsi_device/1:0:0:0/device/delete"
> 
> and upon re-inserting the it back into the device and issuing the
> command:
> 
>  "echo 0 0 0 > /sys/class/scsi_host/host1/scan"
> 
> have the device appear again.  (With the 1.02 BIOS the device does not
> function when re-inserted, even after a warm boot; a cold reboot is
> required to store the Ultrabay device's functionality.)
> 
> More complicated Ultrabay eject and insert scripts can be found on the
> ThinkWiki, although it's important to comment out the "hdparm -Y" as it
> apparently doesn't work or do anything, and causes the eject process to
> hang for about a minute.
> 
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> 
> Index: 2.6.19/drivers/acpi/ibm_acpi.c
> ===================================================================
> --- 2.6.19.orig/drivers/acpi/ibm_acpi.c	2006-12-09 18:35:09.000000000 -0500
> +++ 2.6.19/drivers/acpi/ibm_acpi.c	2006-12-09 18:35:42.000000000 -0500
> @@ -169,6 +169,7 @@
>  #endif
>  IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST",	/* 570 */
>  	   "\\_SB.PCI0.IDE0.IDES.IDSM",	/* 600e/x, 770e, 770x */
> +	   "\\_SB.PCI0.IDE0.PRIM.MSTR",	/* T60p */
>  	   "\\_SB.PCI0.IDE0.SCND.MSTR",	/* all others */
>      );				/* A21e, R30, R31 */
>  

-- 
  "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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-31 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-10  5:13 [PATCH] Add Ultrabay support for the T60p Thinkpad Theodore Ts'o
2006-12-10 12:49 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2006-12-10 19:15   ` Theodore Tso
2006-12-31 16:29 ` Henrique de Moraes Holschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox