Skip to content

Commit 6db831f

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: Make sg_tablesize consistent value
Sht->sg_tablesize is set in the driver, and it will be assigned to shost->sg_tablesize in SCSI mid-layer. So it is not necessary to assign shost->sg_table one more time in the driver. In addition to the change, change each scsi_host_template.sg_tablesize to HISI_SAS_SGE_PAGE_CNT instead of SG_ALL. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 6e1b731 commit 6db831f

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,6 @@ int hisi_sas_probe(struct platform_device *pdev,
24102410
shost->max_lun = ~0;
24112411
shost->max_channel = 1;
24122412
shost->max_cmd_len = 16;
2413-
shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT);
24142413
if (hisi_hba->hw->slot_index_alloc) {
24152414
shost->can_queue = hisi_hba->hw->max_command_entries;
24162415
shost->cmd_per_lun = hisi_hba->hw->max_command_entries;

drivers/scsi/hisi_sas/hisi_sas_v1_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ static struct scsi_host_template sht_v1_hw = {
18161816
.change_queue_depth = sas_change_queue_depth,
18171817
.bios_param = sas_bios_param,
18181818
.this_id = -1,
1819-
.sg_tablesize = SG_ALL,
1819+
.sg_tablesize = HISI_SAS_SGE_PAGE_CNT,
18201820
.max_sectors = SCSI_DEFAULT_MAX_SECTORS,
18211821
.use_clustering = ENABLE_CLUSTERING,
18221822
.eh_device_reset_handler = sas_eh_device_reset_handler,

drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3578,7 +3578,7 @@ static struct scsi_host_template sht_v2_hw = {
35783578
.change_queue_depth = sas_change_queue_depth,
35793579
.bios_param = sas_bios_param,
35803580
.this_id = -1,
3581-
.sg_tablesize = SG_ALL,
3581+
.sg_tablesize = HISI_SAS_SGE_PAGE_CNT,
35823582
.max_sectors = SCSI_DEFAULT_MAX_SECTORS,
35833583
.use_clustering = ENABLE_CLUSTERING,
35843584
.eh_device_reset_handler = sas_eh_device_reset_handler,

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ static struct scsi_host_template sht_v3_hw = {
22312231
.change_queue_depth = sas_change_queue_depth,
22322232
.bios_param = sas_bios_param,
22332233
.this_id = -1,
2234-
.sg_tablesize = SG_ALL,
2234+
.sg_tablesize = HISI_SAS_SGE_PAGE_CNT,
22352235
.max_sectors = SCSI_DEFAULT_MAX_SECTORS,
22362236
.use_clustering = ENABLE_CLUSTERING,
22372237
.eh_device_reset_handler = sas_eh_device_reset_handler,
@@ -2373,7 +2373,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
23732373
shost->max_lun = ~0;
23742374
shost->max_channel = 1;
23752375
shost->max_cmd_len = 16;
2376-
shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT);
23772376
shost->can_queue = hisi_hba->hw->max_command_entries -
23782377
HISI_SAS_RESERVED_IPTT_CNT;
23792378
shost->cmd_per_lun = hisi_hba->hw->max_command_entries -

0 commit comments

Comments
 (0)