Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2748465rwd; Fri, 26 May 2023 10:35:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58h4/o7BLYcfdwtTahrxQ84oFp85ct2C2zXlNzEsmJcSwsqeRu8OI4ZxOlQ9E5G8RuUAFe X-Received: by 2002:a05:6a20:43a5:b0:10f:5fc:80d5 with SMTP id i37-20020a056a2043a500b0010f05fc80d5mr37038pzl.35.1685122538888; Fri, 26 May 2023 10:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685122538; cv=none; d=google.com; s=arc-20160816; b=zQJKBS0+Z2ix+R4KTDQRl++APD7drV34u0xzhyRc7I9H2+6aHvfbazIFOPnFSAYWiB c8UlIrpQqVVkEmSmgR6y1XOFWwx39lht7XFR6fnYddd6Kwtg5AvX+JWTTZEy9uJnTayN bai1dS1S0tFterG+lCvH0Vh4dCPEg6dwIaHIZUuDvHRrdVcskzhIHdH8SMDrLC5xGKXI gCgay4cWnAwskxOuQaAvGc090g7PR+WyJRcqrQzQfa0TGs2MZHt7Jsh3OHYgTgsvkpZz mLQ3o1BQoN62O8RCKbQojymEIxkVD+jwmcPHMbsYrLE2u3DUwsysIZj1Vl7LP1y37wx3 K+YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=Gv5qXDxaPiGyrdXH4F6xJJKqVcwExZ70ZDGntPIt+Vc=; b=gpJiQ4+BCTYHaS7TDoJejfLu13cYxI6j6KY64dQJ/BQrY7IJu7vU4QcP+LRI0wi5tH 5oZl4BNr2kRv2ZnUCE9XTEf6eGypIGV5P8YIHTo0vX8Mi7m/u6zBuhHybrpVMXB56RRW 1PgCLdPqZfmfJOElIf4iqOXkbJueioHqszPWFpVPUb07kawbGyUlhzKwqyTnxfA5uQJM fNj6R8MRpmWC/bpF+EEQVkqM838lXNnMtFAQAgSQaj4urnnLvd8TE/9X2VqI0VQdxaJy Z2i8WIMRu4DO6DaIDlL2YmgF0XX9myWPAmOP+A4jUSvs8JIIhXo2onepl5vNhGNp7Zov uFpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=pC0CKWpN; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=T5lAchV0; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j21-20020a637a55000000b0053b8f59ac25si819020pgn.194.2023.05.26.10.35.26; Fri, 26 May 2023 10:35:38 -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=@squebb.ca header.s=fm2 header.b=pC0CKWpN; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=T5lAchV0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242416AbjEZRR0 (ORCPT + 99 others); Fri, 26 May 2023 13:17:26 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, 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 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 || -- 2.40.1