Skip to content

Commit 29f6975

Browse files
committed
nvme: implement support for relaxed effects
NVM Express TP4167 provides a way for controllers to report a relaxed execution constraint. Specifically, it notifies of exclusivity for IO vs. admin commands instead of grouping these together. If set, then we don't need to freeze IO in order to execute that admin command. The freezing distrupts IO processes, so it's nice to avoid that if the controller tells us it's not necessary. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 79bd7ea commit 29f6975

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,10 @@ u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u8 opcode)
11531153
effects &= ~NVME_CMD_EFFECTS_CSE_MASK;
11541154
} else {
11551155
effects = le32_to_cpu(ctrl->effects->acs[opcode]);
1156+
1157+
/* Ignore execution restrictions if any relaxation bits are set */
1158+
if (effects & NVME_CMD_EFFECTS_CSER_MASK)
1159+
effects &= ~NVME_CMD_EFFECTS_CSE_MASK;
11561160
}
11571161

11581162
return effects;

include/linux/nvme.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ enum {
646646
NVME_CMD_EFFECTS_NCC = 1 << 2,
647647
NVME_CMD_EFFECTS_NIC = 1 << 3,
648648
NVME_CMD_EFFECTS_CCC = 1 << 4,
649+
NVME_CMD_EFFECTS_CSER_MASK = GENMASK(15, 14),
649650
NVME_CMD_EFFECTS_CSE_MASK = GENMASK(18, 16),
650651
NVME_CMD_EFFECTS_UUID_SEL = 1 << 19,
651652
NVME_CMD_EFFECTS_SCOPE_MASK = GENMASK(31, 20),

0 commit comments

Comments
 (0)