Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 5befc7c26e5a ("nvme: implement non-mdts command limits")
Cc: stable@vger.kernel.org
Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
Assisted-by: claude-opus-4-6-v1
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Robert Beckett and committed by
Keith Busch
40f0496b c4cfe8c3

+1 -1
+1 -1
drivers/nvme/host/core.c
··· 3419 3419 3420 3420 ctrl->dmrl = id->dmrl; 3421 3421 ctrl->dmrsl = le32_to_cpu(id->dmrsl); 3422 - if (id->wzsl) 3422 + if (id->wzsl && !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES)) 3423 3423 ctrl->max_zeroes_sectors = nvme_mps_to_sectors(ctrl, id->wzsl); 3424 3424 3425 3425 free_data: