From patchwork Mon Sep 24 15:06:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 147365 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp836687lji; Mon, 24 Sep 2018 08:09:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV60QhKrUu0dIg9IXO56ivqYR/xzHdTR9s+tuY2sOaBwQd2mgy28s3BDLGWdQWL2BBNHOj5po X-Received: by 2002:a17:902:b189:: with SMTP id s9-v6mr11131785plr.188.1537801799157; Mon, 24 Sep 2018 08:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537801799; cv=none; d=google.com; s=arc-20160816; b=XyhhstuqVWMGcAiVxtQuxqqEfsPhmDrOX4PVsbmdYPO44eh0+PfweR/m4XtM6Oc6dT GmnQQtpC5jSBL7qIF7SZN/Cl935D448uHiJr3qNZnWChDsHK9oowC6aay7BYSeXOCdUk ERXGxrLY89SMSqVwx9f6LmIAuScb6zB2n+OUI5uV0X2EhkyuOiiJGIEadMkcGJaT2+zy NSaAvNKKlauqO/RwV2p2s9pMml7LK8Yq/iU3ArAj4RKx0SorGeIvmQhZCTykhglB4nxT q9MX688pwUzi/TjZouv02kHHzqd8KerHOhJVrq3cemdT/GMsvb+MnzQoICew+ppGXZKl 6hTg== 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=SyzWL9sN5uZxIizhdMp3h6PbHJsATfZ6VywgtfQ1uPo=; b=tuTOt2mwt8DqEuXcHuUZef6u3F0M2n6vlxdqNeZIKfa1iIqTSxRULKEZgvtJUVnEMN qXFYyrYCkdJ8KfqCwXnPS2+YlV0vArV643tEft7l4h82afz3CNFziNQcYeNs9D3UHS2s XtfSzLHHAZlU7Adu6LvqYAZ1keBGzD6FHcyoIF05H95geGFfZLUetkgZ/0Qg8hjtG38F dDBwN7x7jAqKTQFy+nrrys0g4Vhjm837rYIM+yWqqyGuf1+GgSJwpe3BoiUl8kI0mCMG YJrjqzdhKecDdpwVQ/dPKtQhGWtMqKCQ15untMfYA2wd0dKdlXNp/Cv3fh6vRb2X7XiQ YDeQ== 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 i21-v6si34379770pgg.513.2018.09.24.08.09.58; Mon, 24 Sep 2018 08:09:59 -0700 (PDT) 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 S2387526AbeIXVMd (ORCPT + 32 others); Mon, 24 Sep 2018 17:12:33 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12683 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729102AbeIXVMd (ORCPT ); Mon, 24 Sep 2018 17:12:33 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E7E5B6DFF0AA5; Mon, 24 Sep 2018 23:09:38 +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.399.0; Mon, 24 Sep 2018 23:09:33 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 7/7] scsi: hisi_sas: Update v3 hw AIP_LIMIT and CFG_AGING_TIME register values Date: Mon, 24 Sep 2018 23:06:34 +0800 Message-ID: <1537801594-207139-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1537801594-207139-1-git-send-email-john.garry@huawei.com> References: <1537801594-207139-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 Update registers as follows: - Default value of AIP timer is 1ms, and it is easy for some expanders to cause IO error. Change the value to max value 65ms to avoid IO error for those expanders. - A CQ completion will be reported by HW when 4 CQs have occurred or the aging timer expires, whichever happens first. Sor serial IO scenario, it will still wait 8us for every IO before it is reported. So in the situation, the performance is poor. So to improve it, change the limit time to the least value. For other scenario, it does little affect to the performance. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index f30c4e4..bd4ce38 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -127,6 +127,7 @@ #define PHY_CTRL_RESET_OFF 0 #define PHY_CTRL_RESET_MSK (0x1 << PHY_CTRL_RESET_OFF) #define SL_CFG (PORT_BASE + 0x84) +#define AIP_LIMIT (PORT_BASE + 0x90) #define SL_CONTROL (PORT_BASE + 0x94) #define SL_CONTROL_NOTIFY_EN_OFF 0 #define SL_CONTROL_NOTIFY_EN_MSK (0x1 << SL_CONTROL_NOTIFY_EN_OFF) @@ -431,6 +432,7 @@ static void init_reg_v3_hw(struct hisi_hba *hisi_hba) (u32)((1ULL << hisi_hba->queue_count) - 1)); hisi_sas_write32(hisi_hba, CFG_MAX_TAG, 0xfff0400); hisi_sas_write32(hisi_hba, HGC_SAS_TXFAIL_RETRY_CTRL, 0x108); + hisi_sas_write32(hisi_hba, CFG_AGING_TIME, 0x1); hisi_sas_write32(hisi_hba, INT_COAL_EN, 0x1); hisi_sas_write32(hisi_hba, OQ_INT_COAL_TIME, 0x1); hisi_sas_write32(hisi_hba, OQ_INT_COAL_CNT, 0x1); @@ -495,6 +497,7 @@ static void init_reg_v3_hw(struct hisi_hba *hisi_hba) /* used for 12G negotiate */ hisi_sas_phy_write32(hisi_hba, i, COARSETUNE_TIME, 0x1e); + hisi_sas_phy_write32(hisi_hba, i, AIP_LIMIT, 0x2ffff); } for (i = 0; i < hisi_hba->queue_count; i++) {