X86 platform drivers
 help / color / mirror / Atom feed
From: Mark Pearson <mpearson-lenovo@squebb.ca>
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	[thread overview]
Message-ID: <20230601200552.4396-7-mpearson-lenovo@squebb.ca> (raw)
In-Reply-To: <20230601200552.4396-1-mpearson-lenovo@squebb.ca>

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 <mpearson-lenovo@squebb.ca>
---
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 ||
-- 
2.40.1


  parent reply	other threads:[~2023-06-01 20:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 20:05 [PATCH v4 1/8] platform/x86: think-lmi: mutex protection around multiple WMI calls Mark Pearson
2023-06-01 20:05 ` [PATCH v4 2/8] platform/x86: think-lmi: Enable opcode support on BIOS settings Mark Pearson
2023-06-01 20:05 ` [PATCH v4 3/8] platform/x86: think-lmi: Correct System password interface Mark Pearson
2023-06-01 20:05 ` [PATCH v4 4/8] platform/x86: think-lmi: Update password attribute comments Mark Pearson
2023-06-01 20:05 ` [PATCH v4 5/8] platform/x86: think-lmi: Update password fields to use BIT Mark Pearson
2023-06-01 20:05 ` [PATCH v4 6/8] platform/x86: think-lmi: Correct NVME password handling Mark Pearson
2023-06-01 20:05 ` Mark Pearson [this message]
2023-06-01 20:05 ` [PATCH v4 8/8] platform/x86: think-lmi: Don't display unnecessary authentication settings Mark Pearson
2023-06-02 11:12   ` Ilpo Järvinen
2023-06-02 14:58     ` Mark Pearson
2023-06-06  9:33 ` [PATCH v4 1/8] platform/x86: think-lmi: mutex protection around multiple WMI calls Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230601200552.4396-7-mpearson-lenovo@squebb.ca \
    --to=mpearson-lenovo@squebb.ca \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox