platform/x86: think-lmi: Correct NVME index default
authorMark Pearson <mpearson-lenovo@squebb.ca>
Thu, 1 Jun 2023 20:05:51 +0000 (16:05 -0400)
committerHans de Goede <hdegoede@redhat.com>
Thu, 8 Jun 2023 09:00:17 +0000 (11:00 +0200)
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>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230601200552.4396-7-mpearson-lenovo@squebb.ca
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Documentation/ABI/testing/sysfs-class-firmware-attributes
drivers/platform/x86/think-lmi.c

index 4cdba3477176fd89d8e03e67595843d6f7091aef..1b3ecae80b3dd02e0ecdddef8796fb40f81bfc07 100644 (file)
@@ -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
index 71bbe169c77ead75ef62149e85ba481aa7f19f80..2aaaee879488878b499ed28e1bef7ca6a7f59aee 100644 (file)
@@ -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 ||