Re: [PATCH v7 08/19] scsi: detect support for command duration limits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/10/25 5:41 PM, Friedrich Weber wrote:
> Thanks for looking into this, it is definitely a strange problem.
> 
> Considering these drives don't support CDL anyway: Do you think it would
> be possible to provide an "escape hatch" to disable only the CDL checks
> (a module parameter?) so hotplug can work for the user again for their
> device? If I see correctly, disabling just the CDL checks is not
> possible (without recompiling the kernel) -- scsi_mod.dev_flags can be
> used to disable RSOC, but I guess that has other unintended consequences
> too, so a more "targeted" escape hatch would be nice.

Could you test the attached patch ? That should solve the issue.

> 
> Best,
> 
> Friedrich
> 


-- 
Damien Le Moal
Western Digital Research
From c8ec5cf7957690418b7e8888e729f002f9bc7d6e Mon Sep 17 00:00:00 2001
From: Damien Le Moal <dlemoal@xxxxxxxxxx>
Date: Mon, 14 Jul 2025 11:47:12 +0900
Subject: [PATCH] scsi: mpt3sas: Disable CDL probing

Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 2 ++
 drivers/scsi/scsi.c                  | 4 +++-
 include/scsi/scsi_host.h             | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index d7d8244dfedc..626c66528bb1 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -11943,6 +11943,7 @@ static const struct scsi_host_template mpt2sas_driver_template = {
 	.shost_groups			= mpt3sas_host_groups,
 	.sdev_groups			= mpt3sas_dev_groups,
 	.track_queue_depth		= 1,
+	.no_cdl				= 1,
 	.cmd_size			= sizeof(struct scsiio_tracker),
 };
 
@@ -11982,6 +11983,7 @@ static const struct scsi_host_template mpt3sas_driver_template = {
 	.shost_groups			= mpt3sas_host_groups,
 	.sdev_groups			= mpt3sas_dev_groups,
 	.track_queue_depth		= 1,
+	.no_cdl				= 1,
 	.cmd_size			= sizeof(struct scsiio_tracker),
 	.map_queues			= scsih_map_queues,
 	.mq_poll			= mpt3sas_blk_mq_poll,
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 534310224e8f..e13d186bd33c 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,9 @@ 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 for any host declaring lacking support for CDL.
 	 */
-	if (sdev->scsi_level < SCSI_SPC_5) {
+	if (sdev->scsi_level < SCSI_SPC_5 || hostt->no_cdl) {
 		sdev->cdl_supported = 0;
 		return;
 	}
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index c53812b9026f..5c59e64f76b8 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -462,6 +462,9 @@ 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. */
+	unsigned no_cdl:1;
+
 	/* True if the host uses host-wide tagspace */
 	unsigned host_tagset:1;
 
-- 
2.50.1


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux