Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10705307imu; Thu, 6 Dec 2018 05:34:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/WH/+HZIa7v6UPYg1SAxqF++ALDTlOJ22Ox7uwS54+M9yWW0moAnuAjnRmAtgoyZmLuYdUk X-Received: by 2002:a17:902:ba89:: with SMTP id k9mr28668433pls.189.1544103299600; Thu, 06 Dec 2018 05:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544103299; cv=none; d=google.com; s=arc-20160816; b=TfOa0muKk4uAKufalN/Xn6A41fZmQgd9gqqA7D3trnZCGAIXwuLpEKLQpI91YcXAAR M8aNH1JnDIB4FRQbJ1YTKaz4ZWlYb26KiEJyr2ec5GLFxjgthymRXcPzldnQaacDeMlK +e/+Vmcifr/jzYCAUEwNrZCeYBTPKTvfPbMab28u5w0kx8mwqxu3QSo79h/+KoX4AhgO 1FgmsqjNtxgEozaoKLNdpmkdRnvBm2IwITEnl7SUTwQidxcJXYJs4MBAtc38iaPnzJ6O nC7FOdbAs8L3PXKGnFITqDmbjDfU5Rwh7klf+Fp2vMxdV7Sq82bzxBy1mBFErEPj5JpS YYjg== 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=C07xmZ+OfmnM3GvxXRd22M3LDEZrDAKpGxI7p6gioZQ=; b=ZkBW5dQuqq9kQ6gi6aOTfOT3+sOfTRzSOxERX7NbJ+AqXWS6CwyhtO33HydaNmUAVh PvbpJ+F1EY60XtxNqicpiZwNPRcKbGS2UR/jZAo+oVHFKFtXrnC6EFMWwvQj+6KmeFxM /YKjTelGr5wKGiFw7sYcOdd/zT1dxN55EsRe6TCie5K0g2dOT7EPLe+JCOicexUSOIcM l1YXSI5ZWzIM1gWVRqE+y2WrJQTtsgjc4ytovy/KX3HMly20t96xbvCZqSP/BhE/2CI9 6zlE8nIS+Qq+fV+MyPPDE5e1Y+iTbeP6cVufm3Me9OlpIiWL9KocOTCHf7D82K1V+Wao Q5gg== 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 m3si291840pgc.232.2018.12.06.05.34.43; Thu, 06 Dec 2018 05:34:59 -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 S1729712AbeLFNdq (ORCPT + 99 others); Thu, 6 Dec 2018 08:33:46 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:60232 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728346AbeLFNdh (ORCPT ); Thu, 6 Dec 2018 08:33:37 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id CC9CF1130B144; Thu, 6 Dec 2018 21:33:27 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.408.0; Thu, 6 Dec 2018 21:33:20 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH v4 3/5] scsi: hisi_sas: Make sg_tablesize consistent value Date: Thu, 6 Dec 2018 21:34:42 +0800 Message-ID: <1544103284-100497-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1544103284-100497-1-git-send-email-john.garry@huawei.com> References: <1544103284-100497-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain 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(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 95350fd..eed7fc5 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 7186648..107f7c9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1816,7 +1816,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 8580c71..8760987 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3578,7 +3578,7 @@ static void wait_cmds_complete_timeout_v2_hw(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_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 59b5f64..44781e3 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2231,7 +2231,7 @@ static ssize_t intr_coal_count_v3_hw_store(struct device *dev, .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, @@ -2373,7 +2373,6 @@ static ssize_t intr_coal_count_v3_hw_store(struct device *dev, 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 - -- 1.9.1