]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sed-opal: Add STACK_RESET command
authorMilan Broz <gmazyland@gmail.com>
Tue, 10 Mar 2026 09:53:49 +0000 (10:53 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 31 Mar 2026 13:04:00 +0000 (07:04 -0600)
commit499d2d2f4cf9f16634db47b06dee9676611b897f
treeb15a4ec92ad1e613bdd729881793d98c07c47e8f
parent75e75445b9f39029c74d9071073745b5bf5315f4
sed-opal: Add STACK_RESET command

The TCG Opal device could enter a state where no new session can be
created, blocking even Discovery or PSID reset. While a power cycle
or waiting for the timeout should work, there is another possibility
for recovery: using the Stack Reset command.

The Stack Reset command is defined in the TCG Storage Architecture Core
Specification and is mandatory for all Opal devices (see Section 3.3.6
of the Opal SSC specification).

This patch implements the Stack Reset command. Sending it should clear
all active sessions immediately, allowing subsequent commands to run
successfully. While it is a TCG transport layer command, the Linux
kernel implements only Opal ioctls, so it makes sense to use the
IOC_OPAL ioctl interface.

The Stack Reset takes no arguments; the response can be success or pending.
If the command reports a pending state, userspace can try to repeat it;
in this case, the code returns -EBUSY.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Ondrej Kozina <okozina@redhat.com>
Link: https://patch.msgid.link/20260310095349.411287-1-gmazyland@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/opal_proto.h
block/sed-opal.c
include/linux/sed-opal.h
include/uapi/linux/sed-opal.h