From 353e6d56cfabe4e52506896de096e82f675dc02e Mon Sep 17 00:00:00 2001 From: Greg Joyce Date: Mon, 20 May 2024 15:02:17 -0500 Subject: [PATCH] sed: perform a tper revert after lsp revert The non-destructive revert was not sufficiently reverting the lsp. A TPER revert is required or the drive is only partially reverted. Signed-off-by: Greg Joyce --- plugins/sed/sedopal_cmd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/sed/sedopal_cmd.c b/plugins/sed/sedopal_cmd.c index 221f62b1..c55d3d0b 100644 --- a/plugins/sed/sedopal_cmd.c +++ b/plugins/sed/sedopal_cmd.c @@ -398,6 +398,14 @@ int sedopal_cmd_revert(int fd) revert_lsp.__pad = 0; rc = ioctl(fd, IOC_OPAL_REVERT_LSP, &revert_lsp); + if (rc == 0) { + /* + * TPER must also be reverted. + */ + rc = ioctl(fd, IOC_OPAL_REVERT_TPR, &revert_lsp.key); + if (rc != 0) + fprintf(stderr, "Error: revert TPR - %d\n", rc); + } #else rc = -EOPNOTSUPP; #endif -- 2.50.1