scsi: megaraid_sas: Limit device queue depth to controller queue depth

The driver currently assigns a pre-defined queue depth when the
firmware-provided device queue depth is greater than the controller queue
depth.

Use the controller queue depth if the reported target queue depth is too
large.

Link: https://lore.kernel.org/r/20200508083838.22778-2-chandrakanth.patil@broadcom.com
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Kashyap Desai 2020-05-08 14:08:34 +05:30 committed by Martin K. Petersen
parent 79e3520f82
commit 6c205a66d6
1 changed files with 3 additions and 3 deletions

View File

@ -1982,9 +1982,9 @@ static void megasas_set_fw_assisted_qd(struct scsi_device *sdev,
if (is_target_prop) { if (is_target_prop) {
tgt_device_qd = le32_to_cpu(instance->tgt_prop->device_qdepth); tgt_device_qd = le32_to_cpu(instance->tgt_prop->device_qdepth);
if (tgt_device_qd && if (tgt_device_qd)
(tgt_device_qd <= instance->host->can_queue)) device_qd = min(instance->host->can_queue,
device_qd = tgt_device_qd; (int)tgt_device_qd);
} }
if (instance->enable_sdev_max_qd && interface_type != UNKNOWN_DRIVE) if (instance->enable_sdev_max_qd && interface_type != UNKNOWN_DRIVE)