From patchwork Mon Dec 3 12:09:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 152693 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6730798ljp; Mon, 3 Dec 2018 04:08:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/VADIzjfFPntRQxBzkNlgUSU8A5DKJutq01wHGa2kirWUCxJH8+xSwsTirySRQ0MrCgPr5D X-Received: by 2002:a63:484c:: with SMTP id x12mr12895658pgk.375.1543838920941; Mon, 03 Dec 2018 04:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543838920; cv=none; d=google.com; s=arc-20160816; b=NKRn/Qu9XbBCim3LrUf733N43FN3cHafcL7oFzD9MybK4xOYfUzVAJlxpMB+jxQj71 yd9zJz6TwjWLKfZDszgB3NvuUSDXlAJV36Iyq9bK6Vw7Zg4ldXW5QkjVk2ZTQB2Slr1/ 5v217vu1yYvQmxNYEx0aDa1uoetZJ6rJwBaEVzPsUVVv1gS1xJcSjt4/zoQfryZzF6kL MZLjE+sYfj8bZj5C+5eHsD4rB/rgMLuYSdY7zDjWik2XFgwUq0Z2xnDeTP5bXmOD64LR /xKMuMDJGy1y3k5Y3UqtMA2ppJMKLJgGoR8tMXZ9oDgoDRUPCnYn2K752YmkTAiKh8KR wH+Q== 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=g+4r7aRdJjCrR2O7E2Md0T+ZTAaNy2Wu5lozIrZ9wuxv8dmGWZfLpLSdaHQ3egGAYN +5EpA7ct0hdogRsH5RQLAQVy0uU0CF9vYS0RERFHwKKNTzZeOWFd5T9fLYwCvd4//6/1 uA1AmVV1BJ0xPJOcoUhplVjE5/tvu0nPJRtdv+0ntu4xt7w3JYDbI59AYI6XZjv/aSi3 jPHdfJjH05y8jKRULc8/GN148gf0rNmkv9fcbQ0142QgtaGgRfY7G9rP4J9FpjkiwkcK y2sUpLurWurfc69XbZI+mGH00aH5sMgrVZcO/Dewg34eQ88MkqFAgM8pWNxze5T88aZq wXeg== 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 q8si16171566pli.284.2018.12.03.04.08.40; Mon, 03 Dec 2018 04:08:40 -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 S1726501AbeLCMJ0 (ORCPT + 32 others); Mon, 3 Dec 2018 07:09:26 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:48924 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725883AbeLCMJZ (ORCPT ); Mon, 3 Dec 2018 07:09:25 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1E24720C8634C; Mon, 3 Dec 2018 20:08:36 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.408.0; Mon, 3 Dec 2018 20:08:27 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH v3 3/4] scsi: hisi_sas: Make sg_tablesize consistent value Date: Mon, 3 Dec 2018 20:09:53 +0800 Message-ID: <1543838994-30028-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1543838994-30028-1-git-send-email-john.garry@huawei.com> References: <1543838994-30028-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 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 -