From patchwork Mon Feb 19 19:13:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 128843 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3801913ljc; Mon, 19 Feb 2018 10:23:54 -0800 (PST) X-Google-Smtp-Source: AH8x227qG1+t8WmJjqGeQJqcFhPly9viJH77mJPKOmVJnlwf/8r8Cg22ZKdPy50NhaoGYh5K2azy X-Received: by 10.98.211.1 with SMTP id q1mr14450542pfg.199.1519064634698; Mon, 19 Feb 2018 10:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519064634; cv=none; d=google.com; s=arc-20160816; b=bTvobTgFIpbBTUfAQHswfj7ef0MnsumVV06SRNbwUv3ZICSVZBC1CRYL+YdFSKSgmG 4ZvQmxrT95QTCmY1HLc7kHBJ0dAnd5O9YZqrWLwDIA8YsX4Acv34Xg6v0Vbkcj8YErQS Cv4YAVcspmwoBsTneBmAlj1TIGnsBBNMCg9nnysfr/uiYdqOXP1GPs82kK97V1qqhudv fxWHmjsQ3SJHyqM/fP/ayPNFKtH7rj9feYYIteCNqF9aKP3yddzEhWeXkWRn8icWbMMR J7OEB540DftgzGFq/oefEkOr0jFnfc3j8l1oNRj11RivUFQ1XWKtUrfccJlRK0zShJf0 K2QQ== 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:arc-authentication-results; bh=T6QuATC+cGhRmbXAvhG564DMRC7TTRpddGvYRM2TSHg=; b=iTzROH9f5CkTly592xvdcdmvvJDE6vA5u/rbOrwjZaaXPucTwYoeMdDA2S8S2I3TVD WpzwLGlzCxZO2ZmInqGDlGCkm7c4f1LjeGlonntmFmo4luonpbYYmHeSKLSU/zN6R58K wxL/LQReJ8GHJrIfNy1GTTYle3b65F+Y6+fsPKjrqsBL7l/PMqEMMY6A92LgATc6xWg1 Btybfe0y5/DFqu4XGuMJ0abuSGjQ0Mwu6MLZVQZG8djZ53XrN2mhMzJgNxogN9ARBjqc wBFqGuWd2g9XkgZZDKa3nSeH9pGK8CexvhAScbQQulvg8BE46zDdXb+BLZ5mIvWxaNJu TMWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 i11si3508430pgq.332.2018.02.19.10.23.54; Mon, 19 Feb 2018 10:23:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753718AbeBSSXx (ORCPT + 1 other); Mon, 19 Feb 2018 13:23:53 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5253 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753439AbeBSSWQ (ORCPT ); Mon, 19 Feb 2018 13:22:16 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 26FE21D94A52D; Tue, 20 Feb 2018 02:22:00 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Tue, 20 Feb 2018 02:21:52 +0800 From: John Garry To: , , , CC: , , , , Xiaofei Tan , John Garry Subject: [PATCH 3/8] scsi: hisi_sas: fix the issue of link rate inconsistency Date: Tue, 20 Feb 2018 03:13:26 +0800 Message-ID: <1519067611-206638-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519067611-206638-1-git-send-email-john.garry@huawei.com> References: <1519067611-206638-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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiaofei Tan In sysfs, there are two files about minimum linkrate, and also two files for maximum linkrate. Take maximum linkrate example, maximum_linkrate_hw is read-only and indicated by the register HARD_PHY_LINKRATE, and maximum_linkrate is read-write and corresponding to the register PROG_PHY_LINK_RATE. But in the function phy_up_v*_hw(), we get *_linkrate value from HARD_PHY_LINKRATE. It is not right. This patch is to fix this issue. Unreferenced PHY-interrupt enum is also removed for v3 hw. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 ++ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 +------- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 +------------ 4 files changed, 4 insertions(+), 20 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 2d4dbed..9d16372 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -683,6 +683,8 @@ static void hisi_sas_phy_init(struct hisi_hba *hisi_hba, int phy_no) phy->hisi_hba = hisi_hba; phy->port = NULL; + phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; + phy->maximum_linkrate = hisi_hba->hw->phy_get_max_linkrate(); sas_phy->enabled = (phy_no < hisi_hba->n_phy) ? 1 : 0; sas_phy->class = SAS; sas_phy->iproto = SAS_PROTOCOL_ALL; diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 679e76f..38bbda9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -873,7 +873,6 @@ static void phy_set_linkrate_v1_hw(struct hisi_hba *hisi_hba, int phy_no, sas_phy->phy->maximum_linkrate = max; sas_phy->phy->minimum_linkrate = min; - min -= SAS_LINK_RATE_1_5_GBPS; max -= SAS_LINK_RATE_1_5_GBPS; for (i = 0; i <= max; i++) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index ab6db50..662d259 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -1603,7 +1603,6 @@ static void phy_set_linkrate_v2_hw(struct hisi_hba *hisi_hba, int phy_no, sas_phy->phy->maximum_linkrate = max; sas_phy->phy->minimum_linkrate = min; - min -= SAS_LINK_RATE_1_5_GBPS; max -= SAS_LINK_RATE_1_5_GBPS; for (i = 0; i <= max; i++) @@ -2684,7 +2683,7 @@ static int prep_abort_v2_hw(struct hisi_hba *hisi_hba, static int phy_up_v2_hw(int phy_no, struct hisi_hba *hisi_hba) { int i, res = IRQ_HANDLED; - u32 port_id, link_rate, hard_phy_linkrate; + u32 port_id, link_rate; struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no]; struct asd_sas_phy *sas_phy = &phy->sas_phy; struct device *dev = hisi_hba->dev; @@ -2723,11 +2722,6 @@ static int phy_up_v2_hw(int phy_no, struct hisi_hba *hisi_hba) } sas_phy->linkrate = link_rate; - hard_phy_linkrate = hisi_sas_phy_read32(hisi_hba, phy_no, - HARD_PHY_LINKRATE); - phy->maximum_linkrate = hard_phy_linkrate & 0xf; - phy->minimum_linkrate = (hard_phy_linkrate >> 4) & 0xf; - sas_phy->oob_mode = SAS_OOB_MODE; memcpy(sas_phy->attached_sas_addr, &id->sas_addr, SAS_ADDR_SIZE); dev_info(dev, "phyup: phy%d link_rate=%d\n", phy_no, link_rate); diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index a1f1868..1ee95ab 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -340,12 +340,6 @@ struct hisi_sas_err_record_v3 { #define HISI_SAS_COMMAND_ENTRIES_V3_HW 4096 #define HISI_SAS_MSI_COUNT_V3_HW 32 -enum { - HISI_SAS_PHY_PHY_UPDOWN, - HISI_SAS_PHY_CHNL_INT, - HISI_SAS_PHY_INT_NR -}; - #define DIR_NO_DATA 0 #define DIR_TO_INI 1 #define DIR_TO_DEVICE 2 @@ -1121,7 +1115,7 @@ static int prep_abort_v3_hw(struct hisi_hba *hisi_hba, static int phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) { int i, res = 0; - u32 context, port_id, link_rate, hard_phy_linkrate; + u32 context, port_id, link_rate; struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no]; struct asd_sas_phy *sas_phy = &phy->sas_phy; struct device *dev = hisi_hba->dev; @@ -1139,10 +1133,6 @@ static int phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) goto end; } sas_phy->linkrate = link_rate; - hard_phy_linkrate = hisi_sas_phy_read32(hisi_hba, phy_no, - HARD_PHY_LINKRATE); - phy->maximum_linkrate = hard_phy_linkrate & 0xf; - phy->minimum_linkrate = (hard_phy_linkrate >> 4) & 0xf; phy->phy_type &= ~(PORT_TYPE_SAS | PORT_TYPE_SATA); /* Check for SATA dev */ @@ -1864,7 +1854,6 @@ static void phy_set_linkrate_v3_hw(struct hisi_hba *hisi_hba, int phy_no, sas_phy->phy->maximum_linkrate = max; sas_phy->phy->minimum_linkrate = min; - min -= SAS_LINK_RATE_1_5_GBPS; max -= SAS_LINK_RATE_1_5_GBPS; for (i = 0; i <= max; i++) From patchwork Mon Feb 19 19:13:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 128844 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3801923ljc; Mon, 19 Feb 2018 10:23:55 -0800 (PST) X-Google-Smtp-Source: AH8x226y49EGd/qUxrKCCmMuOChoCaOA0awpHgmqKSyNGz/KqHNImersfHybHzQb1JSvOtnLh5WS X-Received: by 10.99.182.12 with SMTP id j12mr13272329pgf.113.1519064635731; Mon, 19 Feb 2018 10:23:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519064635; cv=none; d=google.com; s=arc-20160816; b=c4rghFRiZcBrkGl5HmT1l+LWGtidYoTddNcXLYvntpys06gIgR0QFRlgMXu48OKHx/ UQwHKPIkQjRUCMdYTQAcsRSQUrDx/SvZ93azaGs/vGCgl7vlbeRT4PMi0FONbuCJw6bh 80afC9LNpwm0dazEb3sRHN2nd8wsT+7J3uYP78wb5mGingAx1ON32Nkph6KFc+D2OpXS CUV9EIEjAl24sEn/wDPpKe5mvwYoTMZj/xwZEPgz/f3GJus9vqZh0lJdFo+KZ0wsi1r8 EGDLnd024be3dcVdGK9R78//3spAGpZx4KfTJyByhYVVth1Iidr+senA7oJuohQTitdD tsfg== 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:arc-authentication-results; bh=dhQj25UHgAqz0fi2vBcFen4tBEnixxIOY4PNNRKJxgo=; b=pDPTzflBSic6znC3svHOwf0KTWaPgAQ0MIuKmoMlHEHpTgvGal1nI8aYJiSXFmufcY NcpYHUlXdj7v0SLmJDnNqy5FIYrF3T1eDmHw3NCFbfsaez+RksD5ZPwirpjjtKbAG5+B kWaD+nkggkCddQxmS93HwcIHL4NUCC0k57VqqH3BMb3dJSFuqWStWpdu4uVCexXKZxAi wUydlvZY0jywgoz3eya8FFlwH2FyKEKybWZEDdodVDR4sVXcn9zaI5uHmeDnZxn/oKeP 8M6aOX5YN1fBmmID6B+tE+yORzvQWEr/ZyaPAc7B9G0P2MuJK9mT0ECsW+1ujJwfmikR DZmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 i11si3508430pgq.332.2018.02.19.10.23.55; Mon, 19 Feb 2018 10:23:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753729AbeBSSXy (ORCPT + 1 other); Mon, 19 Feb 2018 13:23:54 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5251 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753435AbeBSSWQ (ORCPT ); Mon, 19 Feb 2018 13:22:16 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 099B086F2462D; Tue, 20 Feb 2018 02:22:00 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Tue, 20 Feb 2018 02:21:53 +0800 From: John Garry To: , , , CC: , , , , Xiaofei Tan , John Garry Subject: [PATCH 5/8] scsi: hisi_sas: increase timer expire of internal abort task Date: Tue, 20 Feb 2018 03:13:28 +0800 Message-ID: <1519067611-206638-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519067611-206638-1-git-send-email-john.garry@huawei.com> References: <1519067611-206638-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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiaofei Tan The current 110ms expiry time is not long enough for the internal abort task. The reason is that the internal abort task could be blocked in HW if the HW is retrying to set up link. The internal abort task will be executed only when the retry process finished. The maximum time is 5s for the retry of setting up link. So, the timer expire should be more than 5s. This patch increases it from 110ms to 6s. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 9d16372..9ff8790 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -871,6 +871,7 @@ static void hisi_sas_tmf_timedout(struct timer_list *t) #define TASK_TIMEOUT 20 #define TASK_RETRY 3 +#define INTERNAL_ABORT_TIMEOUT 6 static int hisi_sas_exec_internal_tmf_task(struct domain_device *device, void *parameter, u32 para_len, struct hisi_sas_tmf_task *tmf) @@ -1574,7 +1575,7 @@ static int hisi_sas_query_task(struct sas_task *task) task->task_proto = device->tproto; task->task_done = hisi_sas_task_done; task->slow_task->timer.function = hisi_sas_tmf_timedout; - task->slow_task->timer.expires = jiffies + msecs_to_jiffies(110); + task->slow_task->timer.expires = jiffies + INTERNAL_ABORT_TIMEOUT*HZ; add_timer(&task->slow_task->timer); res = hisi_sas_internal_abort_task_exec(hisi_hba, sas_dev->device_id, From patchwork Mon Feb 19 19:13:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 128837 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3800544ljc; Mon, 19 Feb 2018 10:22:17 -0800 (PST) X-Google-Smtp-Source: AH8x226JlLGHo69KTy/vjHKymWH5m91p0KezxeCVHtbb89a3m1pfrsRypoGKBMjXzh/t4AGsIxUC X-Received: by 10.99.176.15 with SMTP id h15mr13060660pgf.374.1519064537840; Mon, 19 Feb 2018 10:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519064537; cv=none; d=google.com; s=arc-20160816; b=A+uIbXJTlk6bIP9DOzNfCXCS4ApA3PKRig4kaCL7gD7Fj0O0bXr1ZmE+hdmV3NVYW6 O4qC0nIXJ3Emcnmy2Auyc+CIAVPwYX/2GF/11786Hwn+rNw6G4TNgrjG8R6rN9B1BjeJ upmPuyf7hIWmruhPdBX/5icxqCFxF8jJTp/oWsMM6D93aeFbkJ0IfpfIIHZggPRLv/GA TWOgdWzjbvms1K6e30ip6CVmsAOVpCX6MdFRYV6w4iBlL4gnp0KNL0CQPPAaNML3ufHX kD0J/+YYrDRc4jKwa+a4AcT+BRzyetKuHot8jGznqB5ccd6cGCdeT0JUC66Eb8L/b1PJ mkzg== 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:arc-authentication-results; bh=8UAzgAWWlizfrbRx3qWOnEynZ3imRD4cJK0Psd/vlFs=; b=mqYhV2pdWoeR1FaXCoVqRCLG+6D89DSsN7wisN9AK12kdflU7wyeg2VQ46+XXwTfzu Yr0P4W+g39k/U29er0AWHwOLOoIKw/7Q8mHp+4RzVSatidNp6/uzjddqFx+f6r+6EHzn l4V6tuQPAZNyO73ln1Mnxyv4mucujec0SsS8j69aHJPLnVySiQiPltAJP0zjwR9gB5t3 Bm8bv6p3nNo8OleUh9LDNHCjZxQSpL7HZN7ct7tEx/kTSL5cTgEWueEJSQJ/9Y8Vk/DA WcHF3K5y4utGy2YxPIfSJtka4zSO1EpgQAnGNAjYWaV8a5zAyCG1HwsCZWFLMSzZ6Var U3ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 q15si5521004pgc.727.2018.02.19.10.22.17; Mon, 19 Feb 2018 10:22:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbeBSSWQ (ORCPT + 1 other); Mon, 19 Feb 2018 13:22:16 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5249 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753401AbeBSSWN (ORCPT ); Mon, 19 Feb 2018 13:22:13 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E0D9840621D76; Tue, 20 Feb 2018 02:21:59 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Tue, 20 Feb 2018 02:21:53 +0800 From: John Garry To: , , , CC: , , , , Xiang Chen , John Garry Subject: [PATCH 6/8] scsi: hisi_sas: remove unused variable hisi_sas_devices.running_req Date: Tue, 20 Feb 2018 03:13:29 +0800 Message-ID: <1519067611-206638-7-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519067611-206638-1-git-send-email-john.garry@huawei.com> References: <1519067611-206638-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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen The structure element hisi_sas_devices.running_req to count how many commands are active is in effect only ever written in the code, so remove it. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 9 --------- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 3 --- 3 files changed, 13 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index e7fd287..d1153e8 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -175,7 +175,6 @@ struct hisi_sas_device { struct hisi_sas_dq *dq; struct list_head list; u64 attached_phy; - atomic64_t running_req; enum sas_device_type dev_type; int device_id; int sata_idx; diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 9ff8790..88ad8d4 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -200,8 +200,6 @@ void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task, if (task) { struct device *dev = hisi_hba->dev; - struct domain_device *device = task->dev; - struct hisi_sas_device *sas_dev = device->lldd_dev; if (!task->lldd_task) return; @@ -213,9 +211,6 @@ void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task, dma_unmap_sg(dev, task->scatter, task->num_scatter, task->data_dir); - - if (sas_dev) - atomic64_dec(&sas_dev->running_req); } if (slot->buf) @@ -431,8 +426,6 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_sas_dq spin_unlock_irqrestore(&task->task_state_lock, flags); dq->slot_prep = slot; - - atomic64_inc(&sas_dev->running_req); ++(*pass); return 0; @@ -1517,8 +1510,6 @@ static int hisi_sas_query_task(struct sas_task *task) dq->slot_prep = slot; - atomic64_inc(&sas_dev->running_req); - /* send abort command to the chip */ hisi_hba->hw->start_delivery(dq); spin_unlock_irqrestore(&dq->lock, flags_dq); diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 2eb8980..8dd0e6a6 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1407,9 +1407,6 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba, } out: - if (sas_dev) - atomic64_dec(&sas_dev->running_req); - hisi_sas_slot_task_free(hisi_hba, task, slot); sts = ts->stat;