@@ -62,6 +62,7 @@ static struct scsi_host_template aic94xx_sht = {
.track_queue_depth = 1,
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
+ .nr_reserved_cmds = 2,
};
static int asd_map_memio(struct asd_ha_struct *asd_ha)
@@ -2442,6 +2442,10 @@ int hisi_sas_probe(struct platform_device *pdev,
shost->can_queue = HISI_SAS_MAX_COMMANDS;
shost->cmd_per_lun = HISI_SAS_MAX_COMMANDS;
} else {
+ /*
+ * Intentionally use HISI_SAS_UNRESERVED_IPTT for .can_queue until
+ * every sas_task we're sent has a request associated.
+ */
shost->can_queue = HISI_SAS_UNRESERVED_IPTT;
shost->cmd_per_lun = HISI_SAS_UNRESERVED_IPTT;
}
@@ -1762,6 +1762,7 @@ static struct scsi_host_template sht_v1_hw = {
.host_reset = hisi_sas_host_reset,
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
+ .nr_reserved_cmds = 2,
};
static const struct hisi_sas_hw hisi_sas_v1_hw = {
@@ -3580,6 +3580,7 @@ static struct scsi_host_template sht_v2_hw = {
.host_tagset = 1,
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
+ .nr_reserved_cmds = 2,
};
static const struct hisi_sas_hw hisi_sas_v2_hw = {
@@ -3247,6 +3247,7 @@ static struct scsi_host_template sht_v3_hw = {
.host_tagset = 1,
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
+ .nr_reserved_cmds = 2,
};
static const struct hisi_sas_hw hisi_sas_v3_hw = {
@@ -4859,6 +4860,10 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
shost->max_lun = ~0;
shost->max_channel = 1;
shost->max_cmd_len = 16;
+ /*
+ * Intentionally use HISI_SAS_UNRESERVED_IPTT for .can_queue until
+ * every sas_task we're sent has a request associated.
+ */
shost->can_queue = HISI_SAS_UNRESERVED_IPTT;
shost->cmd_per_lun = HISI_SAS_UNRESERVED_IPTT;
@@ -179,6 +179,7 @@ static struct scsi_host_template isci_sht = {
.track_queue_depth = 1,
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
+ .nr_reserved_cmds = 2,
};
static struct sas_domain_function_template isci_transport_ops = {
@@ -56,6 +56,7 @@ static struct scsi_host_template mvs_sht = {
.track_queue_depth = 1,
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
+ .nr_reserved_cmds = 2,
};
static struct sas_domain_function_template mvs_transport_ops = {
@@ -470,6 +471,10 @@ static void mvs_post_sas_ha_init(struct Scsi_Host *shost,
else
can_queue = MVS_CHIP_SLOT_SZ;
+ /*
+ * Carve out MVS_RSVD_SLOTS slots internally until every sas_task we're sent
+ * has a request associated.
+ */
can_queue -= MVS_RSVD_SLOTS;
shost->sg_tablesize = min_t(u16, SG_ALL, MVS_MAX_SG);
@@ -125,6 +125,7 @@ static struct scsi_host_template pm8001_sht = {
.map_queues = pm8001_map_queues,
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
+ .nr_reserved_cmds = 2,
};
/*
@@ -1214,7 +1215,10 @@ static int pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha)
max_out_io = pm8001_ha->main_cfg_tbl.pm80xx_tbl.max_out_io;
ccb_count = min_t(int, PM8001_MAX_CCB, max_out_io);
-
+ /*
+ * Intentionally use ccb_count - PM8001_RESERVE_SLOT for .can_queue
+ * until every sas_task we're sent has a request associated.
+ */
shost->can_queue = ccb_count - PM8001_RESERVE_SLOT;
pm8001_ha->rsvd_tags = bitmap_zalloc(PM8001_RESERVE_SLOT, GFP_KERNEL);