Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp335597yba; Fri, 5 Apr 2019 07:39:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2S8FWG4Pj875VaduE88gXd/G9vEmSUCJrBjOcopTn4wP582KN6DwuiPmO3gO6AMAFpskT X-Received: by 2002:a63:2c09:: with SMTP id s9mr7507638pgs.411.1554475159213; Fri, 05 Apr 2019 07:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554475159; cv=none; d=google.com; s=arc-20160816; b=0wrlUOdWOx7lwCJ3z2U7tZivC/v1Pj9yw3E83rARTNlzc41nmiNZvhDxM1083TG1vx ZWTgVF1R5uTsQ035Xhrcsl8er1np3ehYWIThZPXm81h6fENbDuwz6IHcL90tIxTIcas8 7vLihLI3KTxSm9ZwAtUV4C8V+GCPrsxLNgEyms+iB7Vr7paB1X/vU4aArr6xQeoUm8wq yDAmTU27lKdggoOL/9PZ3EmhE4c3wk55XQYys14vuirdZR/3ygjtVglC8SMaIYDytqon v/HhXbmHufd8sjW34yTtOXCzkNeGC3OWLL5RzGPwEN+xjz3cxBprQgMJTBQBQhyAiSDQ 9JWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qyTjWcg9E2VqCIkA67yW5kn+EGXjm4nBmoivdZZBm/E=; b=CaJ6vZAJRyDgYxinTPJJQm21Y8sh2pxs0smoG/SmoOLJ6D6RL0uTHglBn61aIWrA6m GrWjtwSqTKoH6vH5L/VCxYM0quqO9h8f7+lOBxrhY81o5AfJBsnQiqMuJmLYQqQ2/SiM wvqNSH7FXAv5KkZYrRKyhIrqNPOQehNkAobMmva+E1G4PDdbcsMYk64lnWTpPSIONQJF UBvhuZNrd1YSk2/76YdQYyjX4xzVcIpYAb3v29J3qpGoq7+ptWBPYV/1juyPjrj1blyZ Dqq1hTv+SwXK35Xu6luXGu8uPAIz04q2fSP1AKL47qh2F01GnkYQjXNT3Q1ySHN0vwJv HahQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OC42Bkjr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc4si9543340plb.246.2019.04.05.07.39.03; Fri, 05 Apr 2019 07:39:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OC42Bkjr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731102AbfDEOiZ (ORCPT + 99 others); Fri, 5 Apr 2019 10:38:25 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40294 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729641AbfDEOiZ (ORCPT ); Fri, 5 Apr 2019 10:38:25 -0400 Received: by mail-pg1-f193.google.com with SMTP id u9so3175604pgo.7; Fri, 05 Apr 2019 07:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qyTjWcg9E2VqCIkA67yW5kn+EGXjm4nBmoivdZZBm/E=; b=OC42BkjrQZvITg0jT+frPP+fjGzxRQcHS2A+PGmKWG2qq0TuPKq9ApJ1cm1mslgtsf ZYNrOe3eEWTI5FzEChbPb3ygZVnUO3dZwMqEVXjB4jEkto/ClMwK1FNfAGLrK/FdjzfR iM0ViP9zeKs7SrueN4eLX2IOTBEDwyFGazqSdTtA6tdckqimk8yVSE1aQYjdIJf10uRu NnkKiNzBAmhipId9ZUDjS3oyv5SYIw0gyDAzGNDib9YRSZT7OMOXY9l65FiUffo8k6DY faNYF3yv7Byr7entlgOuREcYn1FHD+hyOQ8fVlhjZh+8vKlrgtAmEgvfVlvLBHhB8awu G8Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qyTjWcg9E2VqCIkA67yW5kn+EGXjm4nBmoivdZZBm/E=; b=LOPLZZQGhFA0PzEUzCNdT815ichKEV4dKywDbWf5Z8c5IwCeBZN+TIT3feGWPLGuIj yRV14Xkf5a2Cfxr0YvXxOjwzBxg7lLu2JsLuTBjLr56rQu8s1Lax0la1fqN/8yDp92Pa 1Kn9ZgPjIOVB1SOfRzIq+LBZdYMdosBLXYhB68bE1pmUGQfA3KOZoi/DnlWESQCxQ5yH /1QXXSsx2jcxe9KXjBnVVuLGOPDJwwKbNAEa6p76+UmnW7J9180yFtQL0SUrnhntl6/q UNXOvMLrjr14upp+dRflYwYgoOVylFl3DgEnLJuJCBFYq6lqI7LQ2TbpSn+pt6tQZ1PO 49yw== X-Gm-Message-State: APjAAAXtWgiCAfLNSi6/PIhkviNgvgU3+cRMhu2xH4icoi1Z2M/PzJbx 2HZzjzY6gEdcMPFjqwD984LxP1V2dnQirNGQMYw= X-Received: by 2002:a65:4302:: with SMTP id j2mr11842168pgq.291.1554475104250; Fri, 05 Apr 2019 07:38:24 -0700 (PDT) MIME-Version: 1.0 References: <20190308131426.10254-1-jiaxun.yang@flygoat.com> In-Reply-To: <20190308131426.10254-1-jiaxun.yang@flygoat.com> From: Andy Shevchenko Date: Fri, 5 Apr 2019 17:38:12 +0300 Message-ID: Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Read EC information on newer models To: Jiaxun Yang Cc: Henrique de Moraes Holschuh , Darren Hart , Andy Shevchenko , ibm-acpi-devel@lists.sourceforge.net, Platform Driver , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 8, 2019 at 3:15 PM Jiaxun Yang 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 > --- > 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