]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: add the new Self-test Code of Device Self-test command
authorFrancis Pravin <francis.p@samsung.com>
Thu, 9 Jan 2025 12:54:01 +0000 (18:24 +0530)
committerDaniel Wagner <wagi@monom.org>
Thu, 9 Jan 2025 13:23:55 +0000 (14:23 +0100)
Add the new Self-test Code (SCT) Host-Initiated Refresh operation support
to Device Self-test command. Also, add it in the Device Self-test Log Page.
TP4058 - Environmental Extremes Management.

Signed-off-by: Francis Pravin <francis.p@samsung.com>
nvme-print-stdout.c
nvme.c

index b37f2dbf0ab0a465d7a10aecd9be2f8c8383aa96..a1b9573622100e844604371aa3b7345bd4caea89 100644 (file)
@@ -4341,6 +4341,9 @@ static void stdout_self_test_result(struct nvme_st_result *res)
                case NVME_ST_CODE_EXTENDED:
                        printf(" Extended device self-test operation");
                        break;
+               case NVME_ST_CODE_HOST_INIT:
+                       printf(" Host-Initiated Refresh operation");
+                       break;
                case NVME_ST_CODE_VS:
                        printf(" Vendor specific");
                        break;
diff --git a/nvme.c b/nvme.c
index 9b4f335a342d62c67c57d635adc11ac82c933d18..36a9b7a98c851bb6ede476ec43a8850fa51589cd 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4429,6 +4429,7 @@ static int device_self_test(int argc, char **argv, struct command *cmd, struct p
                "0h Show current state of device self-test operation\n"
                "1h Start a short device self-test operation\n"
                "2h Start a extended device self-test operation\n"
+               "3h Start a Host-Initiated Refresh operation\n"
                "eh Start a vendor specific device self-test operation\n"
                "fh Abort the device self-test operation";
        const char *wait = "Wait for the test to finish";
@@ -4501,6 +4502,8 @@ static int device_self_test(int argc, char **argv, struct command *cmd, struct p
                        printf("Extended Device self-test started\n");
                else if (cfg.stc == NVME_ST_CODE_SHORT)
                        printf("Short Device self-test started\n");
+               else if (cfg.stc == NVME_ST_CODE_HOST_INIT)
+                       printf("Host-Initiated Refresh started\n");
 
                if (cfg.wait && cfg.stc != NVME_ST_CODE_ABORT)
                        err = wait_self_test(dev);