提交 1cc9991a 编写于 作者: C chenxiang 提交者: Xie XiuQi

scsi: hisi_sas: fix some small bugs related to parameters of scsi_shot and scsi_host_template

For v1/v3 hw, need to fill shost->can_queue with max_command_entries-96. And
also in scsi layer, it will assign sht->can_queue to shost->can_queue, which
will be covered by shost->can_queue in hisi_sas_probe() or hisi_sas_v3_probe(),
so it is no need to assign sht->can_queue in scsi_host_template.

Fixes: 7cca9a0fa469 ("scsi: hisi_sas: Use block layer tag instead of IPTT
defined in LLDD")
Signed-off-by: NXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: NJohn Garry <john.garry@huawei.com>
上级 8d5d9796
...@@ -2356,8 +2356,15 @@ int hisi_sas_probe(struct platform_device *pdev, ...@@ -2356,8 +2356,15 @@ int hisi_sas_probe(struct platform_device *pdev,
shost->max_channel = 1; shost->max_channel = 1;
shost->max_cmd_len = 16; shost->max_cmd_len = 16;
shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT); shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT);
shost->can_queue = hisi_hba->hw->max_command_entries; if (hisi_hba->hw->slot_index_alloc) {
shost->cmd_per_lun = hisi_hba->hw->max_command_entries; shost->can_queue = hisi_hba->hw->max_command_entries;
shost->cmd_per_lun = hisi_hba->hw->max_command_entries;
} else {
shost->can_queue = hisi_hba->hw->max_command_entries -
HISI_SAS_RESERVED_IPTT_CNT;
shost->cmd_per_lun = hisi_hba->hw->max_command_entries -
HISI_SAS_RESERVED_IPTT_CNT;
}
sha->sas_ha_name = DRV_NAME; sha->sas_ha_name = DRV_NAME;
sha->dev = hisi_hba->dev; sha->dev = hisi_hba->dev;
......
...@@ -1807,7 +1807,6 @@ static struct scsi_host_template sht_v1_hw = { ...@@ -1807,7 +1807,6 @@ static struct scsi_host_template sht_v1_hw = {
.scan_start = hisi_sas_scan_start, .scan_start = hisi_sas_scan_start,
.change_queue_depth = sas_change_queue_depth, .change_queue_depth = sas_change_queue_depth,
.bios_param = sas_bios_param, .bios_param = sas_bios_param,
.can_queue = 1,
.this_id = -1, .this_id = -1,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.max_sectors = SCSI_DEFAULT_MAX_SECTORS, .max_sectors = SCSI_DEFAULT_MAX_SECTORS,
......
...@@ -3560,7 +3560,6 @@ static struct scsi_host_template sht_v2_hw = { ...@@ -3560,7 +3560,6 @@ static struct scsi_host_template sht_v2_hw = {
.scan_start = hisi_sas_scan_start, .scan_start = hisi_sas_scan_start,
.change_queue_depth = sas_change_queue_depth, .change_queue_depth = sas_change_queue_depth,
.bios_param = sas_bios_param, .bios_param = sas_bios_param,
.can_queue = 1,
.this_id = -1, .this_id = -1,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.max_sectors = SCSI_DEFAULT_MAX_SECTORS, .max_sectors = SCSI_DEFAULT_MAX_SECTORS,
......
...@@ -2135,7 +2135,6 @@ static struct scsi_host_template sht_v3_hw = { ...@@ -2135,7 +2135,6 @@ static struct scsi_host_template sht_v3_hw = {
.scan_start = hisi_sas_scan_start, .scan_start = hisi_sas_scan_start,
.change_queue_depth = sas_change_queue_depth, .change_queue_depth = sas_change_queue_depth,
.bios_param = sas_bios_param, .bios_param = sas_bios_param,
.can_queue = 1,
.this_id = -1, .this_id = -1,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.max_sectors = SCSI_DEFAULT_MAX_SECTORS, .max_sectors = SCSI_DEFAULT_MAX_SECTORS,
...@@ -2286,7 +2285,8 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2286,7 +2285,8 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT); shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT);
shost->can_queue = hisi_hba->hw->max_command_entries - shost->can_queue = hisi_hba->hw->max_command_entries -
HISI_SAS_RESERVED_IPTT_CNT; HISI_SAS_RESERVED_IPTT_CNT;
shost->cmd_per_lun = hisi_hba->hw->max_command_entries; shost->cmd_per_lun = hisi_hba->hw->max_command_entries -
HISI_SAS_RESERVED_IPTT_CNT;
sha->sas_ha_name = DRV_NAME; sha->sas_ha_name = DRV_NAME;
sha->dev = dev; sha->dev = dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册