From patchwork Fri May 26 17:16:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13257212 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 8AF27C7EE2E for ; Fri, 26 May 2023 17:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237100AbjEZRRV (ORCPT ); Fri, 26 May 2023 13:17:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237371AbjEZRRU (ORCPT ); Fri, 26 May 2023 13:17:20 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02FD7194; Fri, 26 May 2023 10:17:15 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 61AA85C01E9; Fri, 26 May 2023 13:17:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 26 May 2023 13:17:15 -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=1685121435; x= 1685207835; bh=Gv5qXDxaPiGyrdXH4F6xJJKqVcwExZ70ZDGntPIt+Vc=; b=p C0CKWpNqJGerMXBQd7yVMiHpRjq1XUr+e6V+f6bYtMBZE1cmegBn02U3g+qSyGoJ Hx2B7Y+aByw1+WTBHCpUDZtEZ/znTLcUJK+s/5fdAuyB3RFmvFitjcryQ3+lq0q7 +yfCDgY8pXMQEaqDl73B5YjCJOyZ46gUluBtwbPQgznR73zAGHwPHWS3s2kIkkRY woN5MoqIBUWH1JZ6BTiB0xRBFP4x35rWNu+IBp9de8tlaEuQaCmWhVEtZnnxZDl2 98HeZokjadrOIHn/rjPg5KDSLAVGPUnKvMHh+U7x6Gxqgv/GeJnb+hhs2+5iLNM1 72jA74yfZ3l3CDjhX5EAA== 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=1685121435; x= 1685207835; bh=Gv5qXDxaPiGyrdXH4F6xJJKqVcwExZ70ZDGntPIt+Vc=; b=T 5lAchV0qJ5Tji1D+4qpY9b/cXd1Nf2a9QK9JxnY7Kryfaojf1R8C+IrwI1fJfaiB 5jZ9PfkO0zxraOCPpuW8ok3foC/T5Dx4D101s0X00g9to2Im7soLi7rkfoV4cyDt 2F/c9P4p0IiLRIZxdWqS/3im7Q4XBSShqnfYqHLCJAfwuIghjtlKA9SBiDrvY/WQ hls8ftc0cROQyEAi1u9TRJw8DDEf3dn5zFzXr7BlRZU9Z5Kfms4x1xkAn9BfGrvS vh76NzBhjLl1+m2C8O5X99PeH5/9nWgW5aGvHtx9MXkxttSnjDF7a/Zqu5sWLKvy LI3glnHeGkxG2cHHtVEcw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejledguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 26 May 2023 13:17:14 -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 v3 3/5] platform/x86: think-lmi: Correct NVME password handling Date: Fri, 26 May 2023 13:16:56 -0400 Message-Id: <20230526171658.3886-3-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230526171658.3886-1-mpearson-lenovo@squebb.ca> References: <20230526171658.3886-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 --- Changes in v2 & v3: None. Version bumped in series 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 c7e98fbe7c3d..1c02958035ad 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); } @@ -1524,6 +1524,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 ||