Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4325799rwd; Tue, 30 May 2023 04:00:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wh7RFMt60w5SdzP2Rb4L4T+8iZPPUtL+YAwwGDJvmoDxk0hZ4wQXDLhlOQxBDIoxda27d X-Received: by 2002:a17:902:d502:b0:1b0:4b65:79e4 with SMTP id b2-20020a170902d50200b001b04b6579e4mr2158211plg.20.1685444424144; Tue, 30 May 2023 04:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685444424; cv=none; d=google.com; s=arc-20160816; b=GMvfWuixoY0OVYFSkWKXe4wEB5bHmgJM2RQr3GQLnURdZPNsQQKWzIv+RpwvIDGnMM eqjZOVGBu03v2EM0iEseSjDIZbWd3Ivb6iau3Rfl9aQXv/JFhUOhDX4pUVL2LCkjfvEe HOIny4HsnsfOncPvo9xw4Nw1STVPxZwWNr27hgus5bTc6H6473H0DEA1LrlxlZ6QbBRH tcESi3uuKzDpx9vCiPi+1AmmNt1ELYoJrHLCO/xRDRJRDjulVgyVAo+lm7MZBvRNEmZl qmGwkx/R2viDsv82SVXciCl1uDqrXSqfL+USxlpb75SSPRp1LhDf8hbIsM86w9yGo4NV 0/3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1q0i4yZqdxDmT+xuTpGSHTNOPsQSPD0T9mC8x9n9pmQ=; b=xe5fMffUBNzlWvLumJu/XTLD+7XZUAlAksPjRnNIj/NJW3bANvbOgmScppQUpbWSFc gn27OQtgaWVQHi9jiprsIB8qi437TUAZPheV3FpQUZEVAPx4OpVdNmsK6bDYxF6kbdTe m/VtoYgqhngyNGxtYGXGFEa88l5fwTiMjoMkf5ZzF6xXFIZBFrnlkGoo5EosNQkbLLll QhW1INIVvzsTfohLC+m1X1ejbsm73kFUE5ny2RIRUDbgXqSS2om+P2YTd/oFR1unHa12 vnCDB7Q8p0fl5kRmlaydite9RFZIoP1nn3wYwlb49K3rOmKoKSMR/80VFqjJTZefBoil JPWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VxeNEVTS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170902b28600b001a6fe422894si1025863plr.200.2023.05.30.04.00.10; Tue, 30 May 2023 04:00:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VxeNEVTS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231210AbjE3KzQ (ORCPT + 99 others); Tue, 30 May 2023 06:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjE3KzP (ORCPT ); Tue, 30 May 2023 06:55:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8132CA0 for ; Tue, 30 May 2023 03:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685444069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1q0i4yZqdxDmT+xuTpGSHTNOPsQSPD0T9mC8x9n9pmQ=; b=VxeNEVTSI7yS2hefjHpxBmx88WpmIBZtJUw+X+l4UEicjXpghuwK0eLH+2aZgHl26jJCqq Ej8cSNBtdb+aWzHu8zL40ZjFP4TUWszNPVTrCeibXD2VbV1i1sTI2YsQf4fcJdwbFEsl+N GZh+tKp6H1O5mXx1fa6O8bW0NdwSzRA= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-124-no0XoBy2ON-h9xNRRvqnzg-1; Tue, 30 May 2023 06:54:28 -0400 X-MC-Unique: no0XoBy2ON-h9xNRRvqnzg-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-506beab6a73so4224166a12.1 for ; Tue, 30 May 2023 03:54:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685444067; x=1688036067; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1q0i4yZqdxDmT+xuTpGSHTNOPsQSPD0T9mC8x9n9pmQ=; b=g2fP0RPb983An7SWxzRdC8oV1t60nqUkA18h9m0B3cVJS2DWD5wezJ7DiN/3LI5JuH 9ELbByrK6+ElyytfgWbRzlJZyHSBA4j6MaCDXZWuXbvRif2sDtATaww3ovOIOo3CEweg EwqkLVkqDNeSqYbaeK2fWLUXpKZKk9r6im0fWXd4C/BGUCcOhLBiNfHY5gbGivnaEYDz rrzlnN/A6lfNLHAguiZ/CfLbNCwNi+iMTC92FdLvrfI4GKjF4Nmodtyi+FLqYJ8DfSem 95+U2zPTBNlu61NmU56sNzIx+CtHLxGLgEYxTkrABx6Lg7AmUR58K22g5UQY1vz1FSec R+4w== X-Gm-Message-State: AC+VfDwGe4jmGUj8K+N+vDsuuoy+PZM5ZmCQPY2gSWCeP2QVx1+2+ush m11nmrkv1TP0sAijUgovYOXl+Ya6hCMpHMQXpVzbUDmc/h1Hq/6k4jopNKCl+9+cldgaaMlsnqH 6glltxIdju/hr1TnEkZ46PbFHvAgElkUX X-Received: by 2002:aa7:d658:0:b0:514:9e81:906f with SMTP id v24-20020aa7d658000000b005149e81906fmr1305858edr.27.1685444066906; Tue, 30 May 2023 03:54:26 -0700 (PDT) X-Received: by 2002:aa7:d658:0:b0:514:9e81:906f with SMTP id v24-20020aa7d658000000b005149e81906fmr1305844edr.27.1685444066550; Tue, 30 May 2023 03:54:26 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id n2-20020aa7d042000000b00514b044ec41sm693137edo.35.2023.05.30.03.54.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 May 2023 03:54:26 -0700 (PDT) Message-ID: <2ca9ef5d-2a24-c6b7-06fc-5b9919a2aaee@redhat.com> Date: Tue, 30 May 2023 12:54:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v3 1/5] platform/x86: think-lmi: Enable opcode support on BIOS settings Content-Language: en-US, nl To: Mark Pearson Cc: markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230526171658.3886-1-mpearson-lenovo@squebb.ca> From: Hans de Goede In-Reply-To: <20230526171658.3886-1-mpearson-lenovo@squebb.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, On 5/26/23 19:16, Mark Pearson wrote: > Whilst reviewing some documentation from the FW team on using WMI on > Lenovo system I noticed that we weren't using Opcode support when > changing BIOS settings in the thinkLMI driver. > > We should be doing this to ensure we're future proof as the old > non-opcode mechanism has been deprecated. > > Tested on X1 Carbon G10 and G11. > > Signed-off-by: Mark Pearson Thank you for this new version. Please prepare a v4 addressing Ilpo's review remarks. About the aligning function arguments on the next line to the '(' of the function call start at the previous line, checkpatch also checks for this. It is always a good idea to run checkpatch before submitting patches. E.g.: git format-patch -v3 HEAD~5 scripts/checkpatch.pl v3-00*.patch git send-email v3-00*.patch Regards, Hans > --- > Changes in v2: Update comment for clearer explanation of what the driver > is doing > Changes in v3: None. Version bump with rest of series > > drivers/platform/x86/think-lmi.c | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > > diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c > index 1138f770149d..2745224f62ab 100644 > --- a/drivers/platform/x86/think-lmi.c > +++ b/drivers/platform/x86/think-lmi.c > @@ -1001,7 +1001,33 @@ static ssize_t current_value_store(struct kobject *kobj, > tlmi_priv.pwd_admin->save_signature); > if (ret) > goto out; > - } else { /* Non certiifcate based authentication */ > + } else if (tlmi_priv.opcode_support) { > + /* > + * If opcode support is present use that interface. > + * Note - this sets the variable and then the password as separate > + * WMI calls. Function tlmi_save_bios_settings will error if the > + * password is incorrect. > + */ > + set_str = kasprintf(GFP_KERNEL, "%s,%s;", setting->display_name, > + new_setting); > + if (!set_str) { > + ret = -ENOMEM; > + goto out; > + } > + > + ret = tlmi_simple_call(LENOVO_SET_BIOS_SETTINGS_GUID, set_str); > + if (ret) > + goto out; > + > + if (tlmi_priv.pwd_admin->valid && tlmi_priv.pwd_admin->password[0]) { > + ret = tlmi_opcode_setting("WmiOpcodePasswordAdmin", > + tlmi_priv.pwd_admin->password); > + if (ret) > + goto out; > + } > + > + ret = tlmi_save_bios_settings(""); > + } else { /* old non opcode based authentication method (deprecated)*/ > if (tlmi_priv.pwd_admin->valid && tlmi_priv.pwd_admin->password[0]) { > auth_str = kasprintf(GFP_KERNEL, "%s,%s,%s;", > tlmi_priv.pwd_admin->password,