From c8ec5cf7957690418b7e8888e729f002f9bc7d6e Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Mon, 14 Jul 2025 11:47:12 +0900 Subject: [PATCH] scsi: mpt3sas: Disable CDL probing Signed-off-by: Damien Le Moal --- 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