]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ata: libata-scsi: Fix CDL control
authorIgor Pylypiv <ipylypiv@google.com>
Thu, 14 Aug 2025 02:22:56 +0000 (19:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:35 +0000 (16:28 +0200)
commitbfa87a2cafb5966bd5e8c874429e5f388ebad974
tree202c79e0255afc9a4a315d275e1788b205696d23
parent6f5d34088250da46d28d4544a8fb47472511cd36
ata: libata-scsi: Fix CDL control

commit 58768b0563916ddcb73d8ed26ede664915f8df31 upstream.

Delete extra checks for the ATA_DFLAG_CDL_ENABLED flag that prevent
SET FEATURES command from being issued to a drive when NCQ commands
are active.

ata_mselect_control_ata_feature() sets / clears the ATA_DFLAG_CDL_ENABLED
flag during the translation of MODE SELECT to SET FEATURES. If SET FEATURES
gets deferred due to outstanding NCQ commands, the original MODE SELECT
command will be re-queued. When the re-queued MODE SELECT goes through
the ata_mselect_control_ata_feature() translation again, SET FEATURES
will not be issued because ATA_DFLAG_CDL_ENABLED has been already set or
cleared by the initial translation of MODE SELECT.

The ATA_DFLAG_CDL_ENABLED checks in ata_mselect_control_ata_feature()
are safe to remove because scsi_cdl_enable() implements a similar logic
that avoids enabling CDL if it has been enabled already.

Fixes: 17e897a45675 ("ata: libata-scsi: Improve CDL control")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/libata-scsi.c