From patchwork Thu Jun 1 20:05:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 102167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp584655vqr; Thu, 1 Jun 2023 13:08:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6c3M8jl7EjY+nwEM1HNqRP3cKesSQqJNChGRNnXCFgatQJJ8FgO/YPU4oTGYwkVtJpEnTa X-Received: by 2002:a17:90a:540e:b0:256:710a:2578 with SMTP id z14-20020a17090a540e00b00256710a2578mr340528pjh.34.1685650087240; Thu, 01 Jun 2023 13:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685650087; cv=none; d=google.com; s=arc-20160816; b=L+zFJtvdEMs3xBIE0x71DEjXcVOVabN/F6GTNWoNCo5lLyn0RBDMkj+kvGVpSwUiGB vjUG9RS+rdrRrVvSRXbbNcHa/mtuPgovwR2QWr6KDUwgJqNKewXYpp56Mbfy4Ly/sBgX tFckIXR58tkOr2VWhPSLlq6xvVHwOGtN0UDWkV4ngEPl16Sgo5IDgAbL7IQa9yUQAdwy N77QZvFwUXlegTfesuWSFzhUV0kn7PP+Ly2wlOtX9/lICm3SwF+sGbJLN/Swh5/iSso6 pjlzqYvRLwJ6CP1hdw14gGSs9AtRkUOHONHdc2Lvu8MaABEMyyfsPxLtf6Bm3bEXTkvB L7qw== 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=dxVy3ktA+8k714kk6B+Z5XPnFHTfcK197zZKcwM4lPc=; b=HKuY51b6o85T0NuwcEh51+t1yrOwi7/2Pe4u34CBxFgpGVs/BDhVcTw/Dl/fsSLP8E ciReh6V7guy9rKRTf+RtCo6sVmPcJyenPdiLr0U+8NWG/nJODYqbMNletZni7mMxz0OL gbwEBSPiTz0dFdz8YP3OkxN/f9PVfMqzk62fJJZULazhQGFF95zYpa8ZxKJq8/tUPTDK ZqhkMFYL8sQwr/RVql/uC/No6nA/BG+WlBt8Jw4ITG2uhzlunLf83HV2ERBqd9P1tFVg UOpkwk4+QRKASytAVxdJ7XrNt1URdDa4LONiczP3/fArJbPcI+NFIaPU2dmFzwZJLUyE zqwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=Lva76V+N; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=LnAG8HDY; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p22-20020a17090b011600b002563e365aeasi1631468pjz.53.2023.06.01.13.07.55; Thu, 01 Jun 2023 13:08:07 -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=Lva76V+N; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=LnAG8HDY; 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 S232014AbjFAUGY (ORCPT + 99 others); Thu, 1 Jun 2023 16:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231724AbjFAUGI (ORCPT ); Thu, 1 Jun 2023 16:06:08 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FEE919A; Thu, 1 Jun 2023 13:06:07 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 856AE320091A; Thu, 1 Jun 2023 16:06:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 01 Jun 2023 16:06:07 -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=1685649966; x= 1685736366; bh=dxVy3ktA+8k714kk6B+Z5XPnFHTfcK197zZKcwM4lPc=; b=L va76V+N+KAZ+6lBIWyzeIKPpaIFxFTDx7itudSnVXPv8WulpZXbFWT1cDdYeuTK7 WIwjrmsKFmlztMmlhWz4YK+7b4uNWC1mK77aUtJAHtGdFPoU8LMVEOjFGX1FuLux XY9dzSdHL5apB8AAY49Cdl1ow03e54l4qACQ6QXUpeiOZT6CiHOxER6z68tmD7/z rrntV+fm9opTs25YBRefT4bZg9kRh18XcCjX5HaH9ym4Rr8qdsYo8XWl0BYm/9Zz xC1pRTXge8lyLEVzxHBboj6xEuzPmysZ6FpAcD83hTIB7tYEEx/sJDasp2rD/PDS AMNvFzw8V0nfZk4KZFHLQ== 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=1685649966; x= 1685736366; bh=dxVy3ktA+8k714kk6B+Z5XPnFHTfcK197zZKcwM4lPc=; b=L nAG8HDYpRtkNtq1K2UW0LLzpc693JnHIhQkMF3+HRjGZTzuG/vBjBsjmhrQMuIrw 2XwsJNbJOUwcIeALitkKSXoOsH6EbYK2xsoHZ8Pk5PxzOW39gM0cFHBb5gYs2xBz R8omuJTbUf4Nx+qc5TzCfhHGiQiccX5nMJilZIpzonDyaPcVlo6PHafeieyczOab UQ3zyywGD4OKHfv09dUb/3yN8h+F4uhVertPp1F7NWoKEPb7dghoHMNCZQHDJLtE JBFPoVDarPz3JVoEUeTKpnM25DYl4tIPUM+DT8/MqOTGPeeY6Y69Bi5nrIfwQmOA Ec9eu95tAugsT2FnaDLGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeluddgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jun 2023 16:06:05 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 7/8] platform/x86: think-lmi: Correct NVME index default Date: Thu, 1 Jun 2023 16:05:51 -0400 Message-Id: <20230601200552.4396-7-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601200552.4396-1-mpearson-lenovo@squebb.ca> References: <20230601200552.4396-1-mpearson-lenovo@squebb.ca> MIME-Version: 1.0 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,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767532225872569283?= X-GMAIL-MSGID: =?utf-8?q?1767532225872569283?= The NVME/HDD index used by WMI starts at 1 so corrected the default appropriately. Note, zero index is still permitted in case it is required on future platforms. Documentation updated correspondingly Signed-off-by: Mark Pearson --- Changes in v4: - New patch. Split out changes into separate commit as requested. - Update documentation. - Details on zero index added to commit message. Documentation/ABI/testing/sysfs-class-firmware-attributes | 4 ++-- drivers/platform/x86/think-lmi.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-firmware-attributes b/Documentation/ABI/testing/sysfs-class-firmware-attributes index 4cdba3477176..1b3ecae80b3d 100644 --- a/Documentation/ABI/testing/sysfs-class-firmware-attributes +++ b/Documentation/ABI/testing/sysfs-class-firmware-attributes @@ -243,8 +243,8 @@ Description: index: Used with HDD and NVME authentication to set the drive index - that is being referenced (e.g hdd0, hdd1 etc) - This attribute defaults to device 0. + that is being referenced (e.g hdd1, hdd2 etc) + This attribute defaults to device 1. certificate, signature, save_signature: These attributes are used for certificate based authentication. This is diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index 71bbe169c77e..2aaaee879488 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -1534,6 +1534,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 ||