]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: Make sg_tablesize consistent value
authorXiang Chen <chenxiang66@hisilicon.com>
Thu, 6 Dec 2018 13:34:42 +0000 (21:34 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: https://bugs.launchpad.net/bugs/1810457
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>
(cherry picked from commit 6db831f4ef764ca19d7300d56ab9455af3cb930d)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index 19e6a00b3cc89d464e585586b3744b63b908dece..f4744e06a239ffd8ec8b40e8447c7c63c97e4543 100644 (file)
@@ -2415,7 +2415,6 @@ int hisi_sas_probe(struct platform_device *pdev,
        shost->max_lun = ~0;
        shost->max_channel = 1;
        shost->max_cmd_len = 16;
-       shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT);
        if (hisi_hba->hw->slot_index_alloc) {
                shost->can_queue = hisi_hba->hw->max_command_entries;
                shost->cmd_per_lun = hisi_hba->hw->max_command_entries;
index cb1198f0ddde70691337929c5e83dd0bb888eb3e..ef23d26b2271faeea7abbcb188f5c269c7e0e3cc 100644 (file)
@@ -1814,7 +1814,7 @@ static struct scsi_host_template sht_v1_hw = {
        .change_queue_depth     = sas_change_queue_depth,
        .bios_param             = sas_bios_param,
        .this_id                = -1,
-       .sg_tablesize           = SG_ALL,
+       .sg_tablesize           = HISI_SAS_SGE_PAGE_CNT,
        .max_sectors            = SCSI_DEFAULT_MAX_SECTORS,
        .use_clustering         = ENABLE_CLUSTERING,
        .eh_device_reset_handler = sas_eh_device_reset_handler,
index c17dd500fba188100a2ca55a50d770bd084a4438..0341fa72d97e59f897b18356a54a836c2f31d94c 100644 (file)
@@ -3576,7 +3576,7 @@ static struct scsi_host_template sht_v2_hw = {
        .change_queue_depth     = sas_change_queue_depth,
        .bios_param             = sas_bios_param,
        .this_id                = -1,
-       .sg_tablesize           = SG_ALL,
+       .sg_tablesize           = HISI_SAS_SGE_PAGE_CNT,
        .max_sectors            = SCSI_DEFAULT_MAX_SECTORS,
        .use_clustering         = ENABLE_CLUSTERING,
        .eh_device_reset_handler = sas_eh_device_reset_handler,
index 23f40b57b29870d20abad4b1187a36bc9611e2cf..6d584f232204ba110a0b74216b1ffb8d12f484aa 100644 (file)
@@ -2229,7 +2229,7 @@ static struct scsi_host_template sht_v3_hw = {
        .change_queue_depth     = sas_change_queue_depth,
        .bios_param             = sas_bios_param,
        .this_id                = -1,
-       .sg_tablesize           = SG_ALL,
+       .sg_tablesize           = HISI_SAS_SGE_PAGE_CNT,
        .max_sectors            = SCSI_DEFAULT_MAX_SECTORS,
        .use_clustering         = ENABLE_CLUSTERING,
        .eh_device_reset_handler = sas_eh_device_reset_handler,
@@ -2371,7 +2371,6 @@ 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;
-       shost->sg_tablesize = min_t(u16, SG_ALL, HISI_SAS_SGE_PAGE_CNT);
        shost->can_queue = hisi_hba->hw->max_command_entries -
                HISI_SAS_RESERVED_IPTT_CNT;
        shost->cmd_per_lun = hisi_hba->hw->max_command_entries -