From patchwork Wed May 17 18:19:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13245515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B487CC77B75 for ; Wed, 17 May 2023 18:20:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229492AbjEQSUC (ORCPT ); Wed, 17 May 2023 14:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjEQSUB (ORCPT ); Wed, 17 May 2023 14:20:01 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48D031708; Wed, 17 May 2023 11:20:00 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B3A7F5C00FD; Wed, 17 May 2023 14:19:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 17 May 2023 14:19:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684347599; x= 1684433999; bh=yEx5pnV4SMs/Lz7ucq6fHxr/ssA2T3F4PyuZxJWZ4yY=; b=R jp1dLxRduXWT3nYcjKZOrxkxUsPrajWOV1BZEPxXO8MIBXBQIX03cltsF0H3h7IF C9XUvFwZMH3VPcOwtHUacQRKqfgHM1yk81atZ/E3iTGJ8lI1zykuxBQu5bAHlTo0 VcbpjkVFjIVvtxQDDj4LFtYcDPpNjEy6bIDoR42E9iBeiAtTjgjXWZSlLlvNRaHf WUXNjQHYLnC6DAeskjQiV1JZvVbEI0GdXEudg8qvmCgDl/Fp4rjzhKEoRci0QB/L l9MdIjevN+xZ6OyaB2gDg8u3UwET9/gJPUvcU1v2/WCo8Fm0hCR3faKYB72VCaBL Ef0F2ACDVN1I9QvxEBT9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1684347599; x= 1684433999; bh=yEx5pnV4SMs/Lz7ucq6fHxr/ssA2T3F4PyuZxJWZ4yY=; b=G mnytK7zwKLwGwRdlfhC7PYDkMvoW8rxidNiNVbtTl2Je4xXGViexK1KDO+ZFan+Z CS2yKFQxYCGSJVM9JiLahycsSWFPYfh69naTGXcC+G54WF5qQ0bBTTKlI8OTpOMe GC7ChaK/CNVUJkWzLOMkynKUDb+kFa10rJV9l550bNNfBnKfAnBwe2qK4QVrpHQW rtOoMkxCNaWv+XCAgGlEqyQ4bOfzKfSQPAvlLTMMnxjXTJTlEVkXDiACUYShepjP tP2dTsn/aZlP093SgKX2wBV25M6YaeekyHPn4xvLkEbd3f4KKZMHC1eKEDnuGbI+ ksk4mAsHjwhlrudKDMH7g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeiuddguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 May 2023 14:19:58 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] platform/x86: think-lmi: Enable opcode support on BIOS settings Date: Wed, 17 May 2023 14:19:42 -0400 Message-Id: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org 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 --- drivers/platform/x86/think-lmi.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index 1138f770149d..d9341305eba9 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -1001,7 +1001,28 @@ 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 */ + 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, From patchwork Wed May 17 18:19:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13245516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CA6DC77B7F for ; Wed, 17 May 2023 18:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjEQSUC (ORCPT ); Wed, 17 May 2023 14:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjEQSUB (ORCPT ); Wed, 17 May 2023 14:20:01 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC2351739; Wed, 17 May 2023 11:20:00 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 3ADC95C00D4; Wed, 17 May 2023 14:20:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 17 May 2023 14:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684347600; x= 1684434000; bh=9To+EmgUW3U3bAfyN/Fi0ZyDnM5B92IoNonvDRNfTQ8=; b=u 5pk54aREflRZ5sOV8yRRKYngyY/6zd12WwowW2vj4EAk//Je8pebyziVVrRpmg4j 9egssOJCoE6nTubYbzkjpwiqb0HG8DgeazxZDPUCH9n6a1Vttt8P37GJOcTXozXc tDtLKHdBfmQ1diEj0ngtRDTLKlAMJuBGHv3mwtXlRl3G8A701BvXQYEoKSrydyeH 5BuMpaxEVpETyQZZp6v4juoUPAYld/TmTonSgjqjizLWRdnwppMfqqImJvbgcqxB rzm7m5MNSQg8mYAvPH8td04UgX4V6tp1W97sSsDYZYYaejnENwnwoMv0fDphtpHs usNd93nBLP490FsucbCDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1684347600; x= 1684434000; bh=9To+EmgUW3U3bAfyN/Fi0ZyDnM5B92IoNonvDRNfTQ8=; b=S m/C6R1uTVKzgLvmvfLIkXLdR4md3lK+TPEK3cLUc2SvjdRL7lVA0eUIAzYlBUU9/ 2Q7dtGHXtEl6JMekyhp2pKAY6kgq+K/Yvx4GWl6pYGZsUhnzU5THWDlZavaDGWEH LfAoj2PduHycBE6DzQTwzKRZK3D3DVhUmJeUYYrK8CCIHXqNezCnJSlsnjQb4u8Z YGa2qI37piBmfnMIo1n56TiwBCgV3r9IfPuFx1iTx9HNcgNf2BziiN9prdacWJbl Le4lMrL5UKgSiN4BusE1DH64WLIct88U4zceV3vo4sx/YPXSQjIBncOW99pFeJgK sRDYA/g4+qu2gCsPOLKbA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeiuddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 May 2023 14:19:59 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] platform/x86: think-lmi: Correct System password interface Date: Wed, 17 May 2023 14:19:43 -0400 Message-Id: <20230517181945.3725-2-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> References: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org The system password identification was incorrect. This means that if the password was enabled it wouldn't be detected correctly; and setting it would not work. Correct these mistakes. Signed-off-by: Mark Pearson --- drivers/platform/x86/think-lmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index d9341305eba9..b8431d3b137f 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -171,7 +171,7 @@ MODULE_PARM_DESC(debug_support, "Enable debug command support"); #define TLMI_POP_PWD (1 << 0) #define TLMI_PAP_PWD (1 << 1) #define TLMI_HDD_PWD (1 << 2) -#define TLMI_SYS_PWD (1 << 3) +#define TLMI_SYS_PWD (1 << 6) #define TLMI_CERT (1 << 7) #define to_tlmi_pwd_setting(kobj) container_of(kobj, struct tlmi_pwd_setting, kobj) @@ -1504,7 +1504,7 @@ static int tlmi_analyze(void) tlmi_priv.pwd_power->valid = true; if (tlmi_priv.opcode_support) { - tlmi_priv.pwd_system = tlmi_create_auth("sys", "system"); + tlmi_priv.pwd_system = tlmi_create_auth("smp", "system"); if (!tlmi_priv.pwd_system) goto fail_clear_attr; From patchwork Wed May 17 18:19:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13245517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32135C7EE23 for ; Wed, 17 May 2023 18:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229445AbjEQSUD (ORCPT ); Wed, 17 May 2023 14:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjEQSUC (ORCPT ); Wed, 17 May 2023 14:20:02 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5689F1BE7; Wed, 17 May 2023 11:20:01 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C24765C0046; Wed, 17 May 2023 14:20:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 17 May 2023 14:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684347600; x= 1684434000; bh=KSnphhYejWUvC0O6HxRUPmnz6slx1Pk6ZLSyjVku7do=; b=G iKdUR2FflKmrqn1aJT5sPCRNXjfthV/lAPLQd0QttUh5yvEAYiLjQwNksp+qntWg n47ciCB31D9W4lD9rL7JC0vzTv5WwvzsYYokZQKcy/xTV+ImoosycBkz5zv2cld1 ih7orDJ2jIgBttI0YobcYBU77QbRWANMafk+l1ByiO+4mTCR8HKbVMXk1nYOxbkQ xHFBzOFfwggGko/FtEBG7FOXvtJrcD2DDCnpj7oatfU046tgN4QoaKnqBtzRjsOY 3eZX5ls5VqQC14j1voio3y8QrkSP8fd5NDOLZERFl8yUN59blOLwd5jEVtAHS6uH ysl/l+ElF344jXZELq6Yg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1684347600; x= 1684434000; bh=KSnphhYejWUvC0O6HxRUPmnz6slx1Pk6ZLSyjVku7do=; b=G 47RBIv+/lDCYfFyyQzoJ9U3C6DPy7WSIl4bAvp/4oPTxZoBxYYfwLzZx5Ijz/F7l KXyfWpzklH6TWEViv/XtGrS0arzk4u4NkfEKMmKLg3gk6ap0caCo/++zwWGeAIjL Rn72K7fNDTDS5zkJ3v0s2vgnGNrdBH2AcHV0aJtLGnByP0iLPeXV749yDKoRn33J hJWdGUM2A+70f1JqOTpwtwzTYauclnyZ22bmZBh5czAfdtn9/F+/LWA7df71UxIr Nu1fj77E69jvcw3fTN0qtL6EYCSNNOuIm9DrjNH6LB8l/EK8kNHEuKwzz0oryPGI F5IptsXcd8x+4YBZKOQmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeiuddguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 May 2023 14:20:00 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] platform/x86: think-lmi: Correct NVME password handling Date: Wed, 17 May 2023 14:19:44 -0400 Message-Id: <20230517181945.3725-3-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> References: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org NVME passwords identifier have been standardised across the Lenovo systems and now use udrp and adrp (user and admin level) instead of unvp and mnvp. This should apparently be backwards compatible. Also cleaned up so the index is set to a default of 1 rather than 0 as this just makes more sense (there is no device 0). Signed-off-by: Mark Pearson --- drivers/platform/x86/think-lmi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index b8431d3b137f..2d95b1a199fa 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -456,9 +456,9 @@ static ssize_t new_password_store(struct kobject *kobj, sprintf(pwd_type, "mhdp%d", setting->index); } else if (setting == tlmi_priv.pwd_nvme) { if (setting->level == TLMI_LEVEL_USER) - sprintf(pwd_type, "unvp%d", setting->index); + sprintf(pwd_type, "udrp%d", setting->index); else - sprintf(pwd_type, "mnvp%d", setting->index); + sprintf(pwd_type, "adrp%d", setting->index); } else { sprintf(pwd_type, "%s", setting->pwd_type); } @@ -1519,6 +1519,10 @@ static int tlmi_analyze(void) if (!tlmi_priv.pwd_nvme) goto fail_clear_attr; + /* Set default hdd/nvme index to 1 as there is no device 0 */ + tlmi_priv.pwd_hdd->index = 1; + tlmi_priv.pwd_nvme->index = 1; + if (tlmi_priv.pwdcfg.core.password_state & TLMI_HDD_PWD) { /* Check if PWD is configured and set index to first drive found */ if (tlmi_priv.pwdcfg.ext.hdd_user_password || From patchwork Wed May 17 18:19:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13245518 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4402C77B7F for ; Wed, 17 May 2023 18:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbjEQSUF (ORCPT ); Wed, 17 May 2023 14:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjEQSUD (ORCPT ); Wed, 17 May 2023 14:20:03 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E27201708; Wed, 17 May 2023 11:20:01 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 5A1995C00CF; Wed, 17 May 2023 14:20:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 17 May 2023 14:20:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684347601; x= 1684434001; bh=+82eXvQj/5RebZRCTI0l45z9r2QlOLsinwQcEFJrwa8=; b=c cAn1S9xi5hKJORFlrRzdSxw9wBU18ZAr2cHLoTvZHd1QmNEmYDSegPDVMX+WeGO3 pqYDicdACEsmJ4HYI3p3LkTf+IqGJZA9xFPhu2enhspXNiAa55hc2Oc3G2GDIv+p noZZ60T3YQv1vPkGz6I/KxLTR29pFNCsU42IunRk7mqmXOHax5DKAXP88JLVGkfA FFfU6vDM8EIjVYzmsq7Xv2BlBiTdsnP1S67UFYC+/+7B+lXk8ThfKVxd1eiK+vqf yfkzm6v+BHAH5b8KOYicNi89WygrbJjHuYcA3aGedUJ956QDU3RcVOqsp4VFyXtV 5qHTsJ9LrNMsaAhmFc3VQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1684347601; x= 1684434001; bh=+82eXvQj/5RebZRCTI0l45z9r2QlOLsinwQcEFJrwa8=; b=h HVnbXq6wQRbOxW8gXAqCpZ2hAT6GLFTzfWxX/9dw2DLRYqYCbF1+LnzhXZS2eav5 otz/SE0aun5qV1pJBPpfi/wjSdJze//ASz6SD6yAUZlKxKDxa1n6dOLHPY0j4656 N28CdbHkHR67zGe6Gw6fhMeuUvDFWZ9vi/MecaCjvyEl5W7ZJJcRKXIYbbH7T2tz jTLT64jyDqQt1BtVVFRDr0jrtZ63gSupre+KgxTR2OQ74Zv1aFQeV+A3xVjUuJtX j0uVyXAxcnNgWbMdMFUf16oFf9DbQjCd/eQL+IV1QEgofqn7M+CaA24v9FFzKBUs TQSvbDGOHfHv1LM7C86MA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeiuddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 May 2023 14:20:00 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] platform/x86: think-lmi: Don't display unnecessary authentication settings Date: Wed, 17 May 2023 14:19:45 -0400 Message-Id: <20230517181945.3725-4-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> References: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org If Opcode support is available (which is the standard for all platforms going forward) then there is no need to have the encoding and kbdlang attributes visible Signed-off-by: Mark Pearson --- drivers/platform/x86/think-lmi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index 2d95b1a199fa..46500707f939 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -879,6 +879,12 @@ static umode_t auth_attr_is_visible(struct kobject *kobj, return 0; } + /* Don't display un-needed settings if opcode available */ + if ((attr == &auth_encoding.attr || + attr == &auth_kbdlang.attr) && + tlmi_priv.opcode_support) + return 0; + return attr->mode; }