Skip to content

Commit 40f0496

Browse files
BobBeckettkeithbusch
authored andcommitted
nvme: respect NVME_QUIRK_DISABLE_WRITE_ZEROES when wzsl is set
The NVM Command Set Identify Controller data may report a non-zero Write Zeroes Size Limit (wzsl). When present, nvme_init_non_mdts_limits() unconditionally overrides max_zeroes_sectors from wzsl, even if NVME_QUIRK_DISABLE_WRITE_ZEROES previously set it to zero. This effectively re-enables write zeroes for devices that need it disabled, defeating the quirk. Several Kingston OM* drives rely on this quirk to avoid firmware issues with write zeroes commands. Check for the quirk before applying the wzsl override. Fixes: 5befc7c ("nvme: implement non-mdts command limits") Cc: [email protected] Signed-off-by: Robert Beckett <[email protected]> Assisted-by: claude-opus-4-6-v1 Signed-off-by: Keith Busch <[email protected]>
1 parent c4cfe8c commit 40f0496

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3419,7 +3419,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
34193419

34203420
ctrl->dmrl = id->dmrl;
34213421
ctrl->dmrsl = le32_to_cpu(id->dmrsl);
3422-
if (id->wzsl)
3422+
if (id->wzsl && !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
34233423
ctrl->max_zeroes_sectors = nvme_mps_to_sectors(ctrl, id->wzsl);
34243424

34253425
free_data:

0 commit comments

Comments
 (0)