Skip to content

Commit

Permalink
nvme: add the new Self-test Code of Device Self-test command
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
francispravin5 authored and igaw committed Jan 9, 2025
1 parent c164a0f commit 5f3a369
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5f3a369

Please sign in to comment.