From patchwork Wed Nov 21 14:24:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 151697 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1992415ljp; Wed, 21 Nov 2018 06:24:09 -0800 (PST) X-Google-Smtp-Source: AJdET5ff/ILPkpiIo8OsX0SCP9CiJFSbl6f5PQggTUrQfMhXyJBRbwjZ7YconI44aLApDDtoG+67 X-Received: by 2002:a62:5ac3:: with SMTP id o186-v6mr7243834pfb.40.1542810248879; Wed, 21 Nov 2018 06:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542810248; cv=none; d=google.com; s=arc-20160816; b=o2ykGzYF9bmb2JYTb1sOPmWjYpdn9b1QZIL34W8xk0faXxNaxWPK9iRN3jHCjdy6Ls H+msGSFJ6r0wruDepkDSTW0JekeM59aW7PhIZlQYjTPXDXQrcAQ3IKidPRtnyitSZRVm x5fXu0mM7OkBYQtSLNf0q5F34bqnHiJOy1+mLpUYg548H62P1eGMIedNqbd0XhQGZcS9 pZDp9/FL2FJcWfr2QVpzkVk/6ykR9JEOPO10AK/pTjqVuMsn1Owx7m+OmmuLK2z1omyo 6zW5EYgJgHm7hP/fFdXSH7a4hp13yAM7Ex/9G5d9QHxzH8WO+VhmzucSQKH5RWddPBrf WmqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=5GpDUlmiavlyxymGlYkCl46oA0Dw0POraZbVpzJ/6Mk=; b=e6zE7R7kPeAe4YDcHWsQKNfePOn83Baq8JTx8N31vAnnnWBuc3Fv9f+ZJVnxwyHl2o gFVSxPtF7nXOvLz8GaAIa3wWaai9fGPcK5Za4Dkny4rnY7551SX3b8tBjQ7Tg0FCtobS TBvpxFXfclP49JgADJXglysmVZLIjT9mf44rA9L3k8IvIIPZGJVUmBoEpu7V6xXf+9AA +0fviwOu+r0C87xDGPjFEbdz0Wrob+uw3vIg+SITFaWxILWuPsJgGY7S/6ej5AXH7HE3 Ut+QBxFAJ5N25xBoxFDOftDjC5lf44/NwbOEa4+3QObUsmrrkXLIQkz6ALF8a9U+AfOL rNkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x74si28118823pfe.23.2018.11.21.06.23.58; Wed, 21 Nov 2018 06:24:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730577AbeKVA6G (ORCPT + 32 others); Wed, 21 Nov 2018 19:58:06 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:15570 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727681AbeKVA6F (ORCPT ); Wed, 21 Nov 2018 19:58:05 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7B2ED7A147CE3; Wed, 21 Nov 2018 22:23:17 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Wed, 21 Nov 2018 22:23:12 +0800 From: John Garry To: , CC: , , , , , Xiang Chen , John Garry Subject: [PATCH v2 2/3] scsi: hisi_sas: Make sg_tablesize consistent value Date: Wed, 21 Nov 2018 22:24:32 +0800 Message-ID: <1542810273-134731-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1542810273-134731-1-git-send-email-john.garry@huawei.com> References: <1542810273-134731-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen 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 Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 2 +- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 2 +- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +-- 4 files changed, 3 insertions(+), 5 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index d13a662..cbda48e 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2410,7 +2410,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; diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index d24342b..2d035cc 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1815,7 +1815,7 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba) .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, diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index e78a97e..79e58a7 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3570,7 +3570,7 @@ struct device_attribute *host_attrs_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, diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 7e2b020..8a08078 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2224,7 +2224,7 @@ struct device_attribute *host_attrs_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, @@ -2366,7 +2366,6 @@ struct device_attribute *host_attrs_v3_hw[] = { 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 -