From: Damien Le Moal <dlemoal@kernel.org>
To: linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sathya Prakash <sathya.prakash@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
MPT-FusionLinux.pdl@broadcom.com
Cc: Friedrich Weber <f.weber@proxmox.com>
Subject: [PATCH 1/2] scsi: Allow SCSI hosts to force-disable CDL support probing
Date: Wed, 23 Jul 2025 14:23:33 +0900 [thread overview]
Message-ID: <20250723052334.32298-2-dlemoal@kernel.org> (raw)
In-Reply-To: <20250723052334.32298-1-dlemoal@kernel.org>
Users in the field have reported issues with Command Duration Limits
(CDL) support probing when hot-plugging ATA devices in enclosures served
by some SAS HBA models. These issues seem to be limited to older HBA
models that are now EOL and not getting any firmware updates.
Given that recovering from these issues sometimes even need a full host
power cycle, allow a low level driver to declare its lack of support for
the CDL feature on ATA devices using the new SCSI host template flag
no_ata_cdl. If a low-level HBA driver sets this flag, scsi_cdl_check()
returns without issuing any command to probe an ATA device and reports
CDL as not supported.
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Fixes: 624885209f31 ("scsi: core: Detect support for command duration limits")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
drivers/scsi/scsi.c | 6 +++++-
include/scsi/scsi_host.h | 6 ++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 534310224e8f..60ec9e8e4d8a 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -649,6 +649,7 @@ static bool scsi_cdl_check_cmd(struct scsi_device *sdev, u8 opcode, u16 sa,
*/
void scsi_cdl_check(struct scsi_device *sdev)
{
+ const struct scsi_host_template *hostt = sdev->host->hostt;
bool cdl_supported;
unsigned char *buf;
@@ -657,8 +658,11 @@ void scsi_cdl_check(struct scsi_device *sdev)
* lower SPC version. This also avoids problems with old drives choking
* on MAINTENANCE_IN / MI_REPORT_SUPPORTED_OPERATION_CODES with a
* service action specified, as done in scsi_cdl_check_cmd().
+ * Also ignore CDL support with ATA devices for any host declaring
+ * lacking support for this feature.
*/
- if (sdev->scsi_level < SCSI_SPC_5) {
+ if (sdev->scsi_level < SCSI_SPC_5 ||
+ (sdev->is_ata && hostt->no_ata_cdl)) {
sdev->cdl_supported = 0;
return;
}
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index c53812b9026f..b815cc012f2c 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -462,6 +462,12 @@ struct scsi_host_template {
/* True if the controller does not support WRITE SAME */
unsigned no_write_same:1;
+ /*
+ * True if the controller does not support Command Duration Limits on
+ * ATA devices.
+ */
+ unsigned no_ata_cdl:1;
+
/* True if the host uses host-wide tagspace */
unsigned host_tagset:1;
--
2.50.1
next prev parent reply other threads:[~2025-07-23 5:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 5:23 [PATCH 0/2] Disable CDL probing on ATA with mpt2sas and mpt3sas Damien Le Moal
2025-07-23 5:23 ` Damien Le Moal [this message]
2025-07-23 5:23 ` [PATCH 2/2] scsi: mpt3sas: Disable Command Duration Limit Probing Damien Le Moal
2025-07-24 12:01 ` [PATCH 0/2] Disable CDL probing on ATA with mpt2sas and mpt3sas Friedrich Weber
2025-07-24 13:10 ` Damien Le Moal
2025-07-30 10:44 ` Friedrich Weber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250723052334.32298-2-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=MPT-FusionLinux.pdl@broadcom.com \
--cc=f.weber@proxmox.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=suganath-prabu.subramani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.