* [GIT PULL] ibm-acpi patches for 2.6.21
@ 2007-02-06 21:13 Henrique de Moraes Holschuh
2007-02-06 21:13 ` [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad Henrique de Moraes Holschuh
0 siblings, 1 reply; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-06 21:13 UTC (permalink / raw)
To: Len Brown; +Cc: ibm-acpi-devel, linux-acpi
Please pull from git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
branch for-upstream/acpi-release
To receive the following patches:
Henrique de Moraes Holschuh (1):
ACPI: ibm-acpi: cleanup init and exit paths
Theodore Ts'o (1):
ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad
Please schedule these patches to be merged in mainline 2.6.21.
The patches are also going to be sent as replies to this email, for your
convenience.
--
"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] 5+ messages in thread
* [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad
2007-02-06 21:13 [GIT PULL] ibm-acpi patches for 2.6.21 Henrique de Moraes Holschuh
@ 2007-02-06 21:13 ` Henrique de Moraes Holschuh
2007-02-06 21:13 ` [PATCH 2/2] ACPI: ibm-acpi: cleanup init and exit paths Henrique de Moraes Holschuh
2007-02-07 14:19 ` [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad Henrique de Moraes Holschuh
0 siblings, 2 replies; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-06 21:13 UTC (permalink / raw)
To: Len Brown
Cc: ibm-acpi-devel, linux-acpi, Theodore Ts'o,
Henrique de Moraes Holschuh
From: Theodore Ts'o <tytso@mit.edu>
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>
Cc: Whoopie <whoopie79@gmx.net>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
drivers/acpi/ibm_acpi.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index c6144ca..5c0f1b8 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -159,7 +159,8 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
#endif
IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
"\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
- "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */
+ "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60, SATA mode? */
+ "\\_SB.PCI0.IDE0.PRIM.MSTR", /* T60p, IDE mode? */
"\\_SB.PCI0.IDE0.SCND.MSTR", /* all others */
); /* A21e, R30, R31 */
--
1.4.4.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ACPI: ibm-acpi: cleanup init and exit paths
2007-02-06 21:13 ` [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad Henrique de Moraes Holschuh
@ 2007-02-06 21:13 ` Henrique de Moraes Holschuh
2007-02-09 20:40 ` Len Brown
2007-02-07 14:19 ` [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad Henrique de Moraes Holschuh
1 sibling, 1 reply; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-06 21:13 UTC (permalink / raw)
To: Len Brown; +Cc: ibm-acpi-devel, linux-acpi, Henrique de Moraes Holschuh
This patch fixes a small memory leak on module removal, and does other
assorted minor cleanups on the module init codepath.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
drivers/acpi/ibm_acpi.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 5c0f1b8..20cbde5 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -497,6 +497,10 @@ static int ibm_acpi_driver_init(void)
printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION);
printk(IBM_INFO "%s\n", IBM_URL);
+ if (ibm_thinkpad_ec_found)
+ printk(IBM_INFO "ThinkPad EC firmware %s\n",
+ ibm_thinkpad_ec_found);
+
return 0;
}
@@ -2618,7 +2622,7 @@ static void __init ibm_handle_init(char *name,
ibm_handle_init(#object, &object##_handle, *object##_parent, \
object##_paths, ARRAY_SIZE(object##_paths), &object##_path)
-static int set_ibm_param(const char *val, struct kernel_param *kp)
+static int __init set_ibm_param(const char *val, struct kernel_param *kp)
{
unsigned int i;
@@ -2660,7 +2664,8 @@ static void acpi_ibm_exit(void)
for (i = ARRAY_SIZE(ibms) - 1; i >= 0; i--)
ibm_exit(&ibms[i]);
- remove_proc_entry(IBM_DIR, acpi_root_dir);
+ if (proc_dir)
+ remove_proc_entry(IBM_DIR, acpi_root_dir);
if (ibm_thinkpad_ec_found)
kfree(ibm_thinkpad_ec_found);
@@ -2711,9 +2716,6 @@ static int __init acpi_ibm_init(void)
/* Models with newer firmware report the EC in DMI */
ibm_thinkpad_ec_found = check_dmi_for_ec();
- if (ibm_thinkpad_ec_found)
- printk(IBM_INFO "ThinkPad EC firmware %s\n",
- ibm_thinkpad_ec_found);
/* these handles are not required */
IBM_HANDLE_INIT(vid);
@@ -2743,6 +2745,7 @@ static int __init acpi_ibm_init(void)
proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir);
if (!proc_dir) {
printk(IBM_ERR "unable to create proc dir %s", IBM_DIR);
+ acpi_ibm_exit();
return -ENODEV;
}
proc_dir->owner = THIS_MODULE;
--
1.4.4.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad
2007-02-06 21:13 ` [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad Henrique de Moraes Holschuh
2007-02-06 21:13 ` [PATCH 2/2] ACPI: ibm-acpi: cleanup init and exit paths Henrique de Moraes Holschuh
@ 2007-02-07 14:19 ` Henrique de Moraes Holschuh
1 sibling, 0 replies; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-07 14:19 UTC (permalink / raw)
To: Len Brown; +Cc: ibm-acpi-devel, linux-acpi, Theodore Ts'o
On Tue, 06 Feb 2007, Henrique de Moraes Holschuh wrote:
> IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
> "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
> - "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */
> + "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60, SATA mode? */
> + "\\_SB.PCI0.IDE0.PRIM.MSTR", /* T60p, IDE mode? */
> "\\_SB.PCI0.IDE0.SCND.MSTR", /* all others */
> ); /* A21e, R30, R31 */
Unfortunately, a bad design bug makes earlier entries in this list that
happen to exist shadow any later entries, which is completely unaceptable
behaviour for the bay support as earlier entries *will* exist in some
models, no matter how you order the list.
Len, if you have not pulled this one yet, please hold the pull request. I
will not revert the patch, but rather work on a proper fix to ibm-acpi's
bay_init().
--
"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] 5+ messages in thread
* Re: [PATCH 2/2] ACPI: ibm-acpi: cleanup init and exit paths
2007-02-06 21:13 ` [PATCH 2/2] ACPI: ibm-acpi: cleanup init and exit paths Henrique de Moraes Holschuh
@ 2007-02-09 20:40 ` Len Brown
0 siblings, 0 replies; 5+ messages in thread
From: Len Brown @ 2007-02-09 20:40 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: ibm-acpi-devel, linux-acpi
Applied.
thanks,
-Len
On Tuesday 06 February 2007 16:13, Henrique de Moraes Holschuh wrote:
> This patch fixes a small memory leak on module removal, and does other
> assorted minor cleanups on the module init codepath.
>
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> ---
> drivers/acpi/ibm_acpi.c | 13 ++++++++-----
> 1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
> index 5c0f1b8..20cbde5 100644
> --- a/drivers/acpi/ibm_acpi.c
> +++ b/drivers/acpi/ibm_acpi.c
> @@ -497,6 +497,10 @@ static int ibm_acpi_driver_init(void)
> printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION);
> printk(IBM_INFO "%s\n", IBM_URL);
>
> + if (ibm_thinkpad_ec_found)
> + printk(IBM_INFO "ThinkPad EC firmware %s\n",
> + ibm_thinkpad_ec_found);
> +
> return 0;
> }
>
> @@ -2618,7 +2622,7 @@ static void __init ibm_handle_init(char *name,
> ibm_handle_init(#object, &object##_handle, *object##_parent, \
> object##_paths, ARRAY_SIZE(object##_paths), &object##_path)
>
> -static int set_ibm_param(const char *val, struct kernel_param *kp)
> +static int __init set_ibm_param(const char *val, struct kernel_param *kp)
> {
> unsigned int i;
>
> @@ -2660,7 +2664,8 @@ static void acpi_ibm_exit(void)
> for (i = ARRAY_SIZE(ibms) - 1; i >= 0; i--)
> ibm_exit(&ibms[i]);
>
> - remove_proc_entry(IBM_DIR, acpi_root_dir);
> + if (proc_dir)
> + remove_proc_entry(IBM_DIR, acpi_root_dir);
>
> if (ibm_thinkpad_ec_found)
> kfree(ibm_thinkpad_ec_found);
> @@ -2711,9 +2716,6 @@ static int __init acpi_ibm_init(void)
>
> /* Models with newer firmware report the EC in DMI */
> ibm_thinkpad_ec_found = check_dmi_for_ec();
> - if (ibm_thinkpad_ec_found)
> - printk(IBM_INFO "ThinkPad EC firmware %s\n",
> - ibm_thinkpad_ec_found);
>
> /* these handles are not required */
> IBM_HANDLE_INIT(vid);
> @@ -2743,6 +2745,7 @@ static int __init acpi_ibm_init(void)
> proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir);
> if (!proc_dir) {
> printk(IBM_ERR "unable to create proc dir %s", IBM_DIR);
> + acpi_ibm_exit();
> return -ENODEV;
> }
> proc_dir->owner = THIS_MODULE;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-02-09 20:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-06 21:13 [GIT PULL] ibm-acpi patches for 2.6.21 Henrique de Moraes Holschuh
2007-02-06 21:13 ` [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad Henrique de Moraes Holschuh
2007-02-06 21:13 ` [PATCH 2/2] ACPI: ibm-acpi: cleanup init and exit paths Henrique de Moraes Holschuh
2007-02-09 20:40 ` Len Brown
2007-02-07 14:19 ` [PATCH 1/2] ACPI: ibm-acpi: add Ultrabay support for the T60p ThinkPad 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