* [PATCH] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
@ 2012-08-06 23:15 manoj.iyer
2012-08-06 23:30 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
0 siblings, 1 reply; 4+ messages in thread
From: manoj.iyer @ 2012-08-06 23:15 UTC (permalink / raw)
To: linux-kernel; +Cc: ibm-acpi-devel, platform-driver-x86, mjg, ibm-acpi
From: Manoj Iyer <manoj.iyer@canonical.com>
In the latest V-series bios DMI_PRODUCT_VERSION does not contain
the string Lenovo or Thinkpad, but is set to the model number, this
causes the thinkpad_acpi module to fail to load. Recognize laptop
as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo.
Test on V490u
=============
== After the patch ==
[ 1350.295757] thinkpad_acpi: ThinkPad ACPI Extras v0.24
[ 1350.295760] thinkpad_acpi: http://ibm-acpi.sf.net/
[ 1350.295761] thinkpad_acpi: ThinkPad BIOS H7ET21WW (1.00 ), EC unknown
[ 1350.295763] thinkpad_acpi: Lenovo LENOVO, model LV5DXXX
[ 1350.296086] thinkpad_acpi: detected a 8-level brightness capable ThinkPad
[ 1350.296694] thinkpad_acpi: radio switch found; radios are enabled
[ 1350.296703] thinkpad_acpi: possible tablet mode switch found; ThinkPad in laptop mode
[ 1350.306466] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
[ 1350.307082] Registered led device: tpacpi::thinklight
[ 1350.307215] Registered led device: tpacpi::power
[ 1350.307255] Registered led device: tpacpi::standby
[ 1350.307294] Registered led device: tpacpi::thinkvantage
[ 1350.308160] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
[ 1350.308333] thinkpad_acpi: Console audio control enabled, mode: monitor (read only)
[ 1350.312287] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input14
== Before the patch ==
sudo modprobe thinkpad_acpi
FATAL: Error inserting thinkpad_acpi (/lib/modules/3.2.0-27-generic/kernel/drivers/platform/x86/thinkpad_acpi.ko): No such device
Test on B485
=============
This patch was also test in a B485 where the thinkpad_acpi module does not
have any issues loading. But, I tested it to make sure this patch does not
break on already functioning models of Lenovo products.
[13486.746359] thinkpad_acpi: ThinkPad ACPI Extras v0.24
[13486.746364] thinkpad_acpi: http://ibm-acpi.sf.net/
[13486.746368] thinkpad_acpi: ThinkPad BIOS HJET15WW(1.01), EC unknown
[13486.746373] thinkpad_acpi: Lenovo Lenovo LB485, model 814TR01
[13486.747300] thinkpad_acpi: detected a 8-level brightness capable ThinkPad
[13486.752435] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
[13486.752883] Registered led device: tpacpi::thinklight
[13486.752915] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
[13486.753216] thinkpad_acpi: Console audio control enabled, mode: monitor (read only)
[13486.757147] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input15
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
drivers/platform/x86/thinkpad_acpi.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e7f7328..d05c0a4 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8662,7 +8662,14 @@ static int __must_check __init get_thinkpad_model_data(
tp->model_str = kstrdup(s, GFP_KERNEL);
if (!tp->model_str)
return -ENOMEM;
- }
+ } else {
+ s = dmi_get_system_info(DMI_BIOS_VENDOR);
+ if (s && !(strnicmp(s, "Lenovo", 6))) {
+ tp->model_str = kstrdup(s, GFP_KERNEL);
+ if (!tp->model_str)
+ return -ENOMEM;
+ }
+ }
s = dmi_get_system_info(DMI_PRODUCT_NAME);
tp->nummodel_str = kstrdup(s, GFP_KERNEL);
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
2012-08-06 23:15 [PATCH] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR manoj.iyer
@ 2012-08-06 23:30 ` Henrique de Moraes Holschuh
0 siblings, 0 replies; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2012-08-06 23:30 UTC (permalink / raw)
To: manoj.iyer
Cc: linux-kernel, ibm-acpi-devel, mjg, ibm-acpi, platform-driver-x86
On Mon, 06 Aug 2012, manoj.iyer@canonical.com wrote:
> In the latest V-series bios DMI_PRODUCT_VERSION does not contain
> the string Lenovo or Thinkpad, but is set to the model number, this
> causes the thinkpad_acpi module to fail to load. Recognize laptop
> as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo.
>
> Test on V490u
> =============
> == After the patch ==
>
> [ 1350.295757] thinkpad_acpi: ThinkPad ACPI Extras v0.24
> [ 1350.295760] thinkpad_acpi: http://ibm-acpi.sf.net/
> [ 1350.295761] thinkpad_acpi: ThinkPad BIOS H7ET21WW (1.00 ), EC unknown
> [ 1350.295763] thinkpad_acpi: Lenovo LENOVO, model LV5DXXX
> [ 1350.296086] thinkpad_acpi: detected a 8-level brightness capable ThinkPad
> [ 1350.296694] thinkpad_acpi: radio switch found; radios are enabled
> [ 1350.296703] thinkpad_acpi: possible tablet mode switch found; ThinkPad in laptop mode
> [ 1350.306466] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
> [ 1350.307082] Registered led device: tpacpi::thinklight
> [ 1350.307215] Registered led device: tpacpi::power
> [ 1350.307255] Registered led device: tpacpi::standby
> [ 1350.307294] Registered led device: tpacpi::thinkvantage
> [ 1350.308160] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
> [ 1350.308333] thinkpad_acpi: Console audio control enabled, mode: monitor (read only)
> [ 1350.312287] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input14
>
> == Before the patch ==
> sudo modprobe thinkpad_acpi
> FATAL: Error inserting thinkpad_acpi (/lib/modules/3.2.0-27-generic/kernel/drivers/platform/x86/thinkpad_acpi.ko): No such device
>
> Test on B485
> =============
> This patch was also test in a B485 where the thinkpad_acpi module does not
> have any issues loading. But, I tested it to make sure this patch does not
> break on already functioning models of Lenovo products.
>
> [13486.746359] thinkpad_acpi: ThinkPad ACPI Extras v0.24
> [13486.746364] thinkpad_acpi: http://ibm-acpi.sf.net/
> [13486.746368] thinkpad_acpi: ThinkPad BIOS HJET15WW(1.01), EC unknown
> [13486.746373] thinkpad_acpi: Lenovo Lenovo LB485, model 814TR01
> [13486.747300] thinkpad_acpi: detected a 8-level brightness capable ThinkPad
> [13486.752435] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
> [13486.752883] Registered led device: tpacpi::thinklight
> [13486.752915] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
> [13486.753216] thinkpad_acpi: Console audio control enabled, mode: monitor (read only)
> [13486.757147] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input15
>
> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
--
"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] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
@ 2012-08-06 22:21 manoj.iyer
2012-08-06 23:01 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
0 siblings, 1 reply; 4+ messages in thread
From: manoj.iyer @ 2012-08-06 22:21 UTC (permalink / raw)
To: linux-kernel; +Cc: ibm-acpi-devel, platform-driver-x86, mjg, ibm-acpi
From: Manoj Iyer <manoj.iyer@canonical.com>
In the latest V-series bios DMI_PRODUCT_VERSION does not contain
the string Lenovo or Thinkpad, but is set to the model number, this
causes the thinkpad_acpi module to fail to load. Recognize laptop
as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo.
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
drivers/platform/x86/thinkpad_acpi.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e7f7328..66dfdef 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8663,6 +8663,14 @@ static int __must_check __init get_thinkpad_model_data(
if (!tp->model_str)
return -ENOMEM;
}
+ else {
+ s = dmi_get_system_info(DMI_BIOS_VENDOR);
+ if (s && !(strnicmp(s, "Lenovo", 6))) {
+ tp->model_str = kstrdup(s, GFP_KERNEL);
+ if (!tp->model_str)
+ return -ENOMEM;
+ }
+ }
s = dmi_get_system_info(DMI_PRODUCT_NAME);
tp->nummodel_str = kstrdup(s, GFP_KERNEL);
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
2012-08-06 22:21 manoj.iyer
@ 2012-08-06 23:01 ` Henrique de Moraes Holschuh
0 siblings, 0 replies; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2012-08-06 23:01 UTC (permalink / raw)
To: manoj.iyer
Cc: linux-kernel, ibm-acpi-devel, mjg, ibm-acpi, platform-driver-x86
On Mon, 06 Aug 2012, manoj.iyer@canonical.com wrote:
> From: Manoj Iyer <manoj.iyer@canonical.com>
>
> In the latest V-series bios DMI_PRODUCT_VERSION does not contain
> the string Lenovo or Thinkpad, but is set to the model number, this
> causes the thinkpad_acpi module to fail to load. Recognize laptop
> as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo.
Please add here the testing you did.
> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index e7f7328..66dfdef 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -8663,6 +8663,14 @@ static int __must_check __init get_thinkpad_model_data(
> if (!tp->model_str)
> return -ENOMEM;
> }
> + else {
Please fix this: } else { all in a single line.
> + s = dmi_get_system_info(DMI_BIOS_VENDOR);
> + if (s && !(strnicmp(s, "Lenovo", 6))) {
> + tp->model_str = kstrdup(s, GFP_KERNEL);
> + if (!tp->model_str)
> + return -ENOMEM;
> + }
> + }
>
> s = dmi_get_system_info(DMI_PRODUCT_NAME);
> tp->nummodel_str = kstrdup(s, GFP_KERNEL);
That should be all. You might want to get acquinted with the checkpatch
script, it would have pointed the "else" thing to you, I think (I didn't
notice it right away).
Anyway, other than the cosmetic stuff above, the patch looks good. I
haven't tested it yet on a IBM thinkpad, though. Will do later today.
--
"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] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
@ 2012-08-06 21:23 manoj.iyer
2012-08-06 21:33 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
0 siblings, 1 reply; 4+ messages in thread
From: manoj.iyer @ 2012-08-06 21:23 UTC (permalink / raw)
To: linux-kernel; +Cc: ibm-acpi-devel, platform-driver-x86, mjg, ibm-acpi
From: Manoj Iyer <manoj.iyer@canonical.com>
In the latest V-series bios DMI_PRODUCT_VERSION does not contain
the string Lenovo or Thinkpad, but is set to the model number, this
causes the thinkpad_acpi module to fail to load. Recognize laptop
as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo.
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
drivers/platform/x86/thinkpad_acpi.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e7f7328..17692c8 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8658,11 +8658,16 @@ static int __must_check __init get_thinkpad_model_data(
}
s = dmi_get_system_info(DMI_PRODUCT_VERSION);
- if (s && !(strnicmp(s, "ThinkPad", 8) && strnicmp(s, "Lenovo", 6))) {
+ if (s && !(strnicmp(s, "ThinkPad", 8) && strnicmp(s, "Lenovo", 6)))
tp->model_str = kstrdup(s, GFP_KERNEL);
- if (!tp->model_str)
- return -ENOMEM;
- }
+ else {
+ s = dmi_get_system_info(DMI_BIOS_VENDOR);
+ if (s && !(strnicmp(s, "Lenovo", 6)))
+ tp->model_str = kstrdup(s, GFP_KERNEL);
+ }
+
+ if (!tp->model_str)
+ return -ENOMEM;
s = dmi_get_system_info(DMI_PRODUCT_NAME);
tp->nummodel_str = kstrdup(s, GFP_KERNEL);
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
2012-08-06 21:23 manoj.iyer
@ 2012-08-06 21:33 ` Henrique de Moraes Holschuh
0 siblings, 0 replies; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2012-08-06 21:33 UTC (permalink / raw)
To: manoj.iyer
Cc: linux-kernel, ibm-acpi-devel, mjg, ibm-acpi, platform-driver-x86
On Mon, 06 Aug 2012, manoj.iyer@canonical.com wrote:
> In the latest V-series bios DMI_PRODUCT_VERSION does not contain
> the string Lenovo or Thinkpad, but is set to the model number, this
> causes the thinkpad_acpi module to fail to load. Recognize laptop
> as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo.
>
> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index e7f7328..17692c8 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -8658,11 +8658,16 @@ static int __must_check __init get_thinkpad_model_data(
> }
>
> s = dmi_get_system_info(DMI_PRODUCT_VERSION);
> - if (s && !(strnicmp(s, "ThinkPad", 8) && strnicmp(s, "Lenovo", 6))) {
> + if (s && !(strnicmp(s, "ThinkPad", 8) && strnicmp(s, "Lenovo", 6)))
> tp->model_str = kstrdup(s, GFP_KERNEL);
> - if (!tp->model_str)
> - return -ENOMEM;
> - }
> + else {
> + s = dmi_get_system_info(DMI_BIOS_VENDOR);
> + if (s && !(strnicmp(s, "Lenovo", 6)))
> + tp->model_str = kstrdup(s, GFP_KERNEL);
> + }
> +
> + if (!tp->model_str)
> + return -ENOMEM;
This last unguarded if() can cause problems, s is allowed to be NULL. Just
leave it where it was, and add a second one to the new "else" branch.
--
"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:[~2012-08-06 23:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06 23:15 [PATCH] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR manoj.iyer
2012-08-06 23:30 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
-- strict thread matches above, loose matches on Subject: below --
2012-08-06 22:21 manoj.iyer
2012-08-06 23:01 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2012-08-06 21:23 manoj.iyer
2012-08-06 21:33 ` [ibm-acpi-devel] " 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
all inboxes | Powered by JetHome®