lkml.org 
[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] platform/x86: thinkpad_acpi: Read EC information on newer models
On Fri, Mar 8, 2019 at 3:15 PM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
>
> Newer ThinkPads have a totally different EC program information DMI
> table. And thermal subdriver can't work without correct EC version.
>
> Read from this entry if the old method failed to get EC information.
>

Thank you for the patch. See my comments below.

> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 62 ++++++++++++++++++++++------
> 1 file changed, 49 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 2e24ee42a3c6..17fd2065000b 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -9959,6 +9959,37 @@ static char __init tpacpi_parse_fw_id(const char * const s,
> return '\0';
> }
>
> +static void find_new_ec_fwstr(const struct dmi_header *dm, void *private)
> +{

Today it's a new one, tomorrow something else might come. Care to use
versioning instead?
Something line find_ec_fwstr_vXYZ().

> +}

> - tp->ec_version_str = kstrdup(ec_fw_string, GFP_KERNEL);
> - if (!tp->ec_version_str)
> - return -ENOMEM;

>
> - t = tpacpi_parse_fw_id(ec_fw_string,
> - &tp->ec_model, &tp->ec_release);
> - if (t != 'H') {
> - pr_notice("ThinkPad firmware release %s doesn't match the known patterns\n",
> - ec_fw_string);
> - pr_notice("please report this to %s\n",
> - TPACPI_MAIL);
> - }

Seems to me that this is the same to below. Can you leave indentation
in place and fix it in a separate (following) patch?

> - break;
> + if (ec_fw_string[0]) {
> + tp->ec_version_str = kstrdup(ec_fw_string, GFP_KERNEL);
> + if (!tp->ec_version_str)
> + return -ENOMEM;
> +
> + t = tpacpi_parse_fw_id(ec_fw_string,
> + &tp->ec_model, &tp->ec_release);
> + if (t != 'H') {
> + pr_notice("ThinkPad firmware release %s doesn't match the known patterns\n",
> + ec_fw_string);
> + pr_notice("please report this to %s\n", TPACPI_MAIL);
> }
> }


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2019-04-05 16:38    [W:0.079 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site