From patchwork Mon Aug 5 13:48:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 170568 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4322611ile; Mon, 5 Aug 2019 06:51:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ5N1vaY9OKjgIhhPW7zJnAsW/pwgrodReCIR1Rt8EYWcVruMLbTxi1bN5q+UBZpBsJ0Kr X-Received: by 2002:a65:504c:: with SMTP id k12mr138446395pgo.252.1565013077035; Mon, 05 Aug 2019 06:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565013077; cv=none; d=google.com; s=arc-20160816; b=NMPez+b4XJp56k4gRYTRLP8C+ldRayyne5k9HESRIme1F9dgpsECvSscXf5YMaS75v /16JypiRVSaspnWr0M7cg5hW/DYAKbj3maxtGkJUL+0PYq+gXkYdMxyPUF2UCeIDBhRM ugOU9RKQ0e3OECpF2YLVOaBiuiuntjtE25DouUdEan3+bzzkr1FKm2y/6fUHAXcUAuZ+ aRpMDUtY6yJxpnDCsdUePPetszWRTxaosItTLm1u15NgXGrhBA5hrPh9MA/eU4yVd096 44CwFKMMCmqNZ7VP7D6QqKOy02eVv9iJV+IWwmLc0qvWgqEL2uyWHmNDulV3gB7mQZ2A f2Yg== 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=4DfdfPcYI1f1BRFLqGo9O0dOPpkG7/tOAEw41Jv3D+o=; b=KJBzRuM6Dg9CwzLqjl3PrsMki3v/Jgsvaf/aBn8BYmt3ZomcDOmhDTcEgD8AMS4sBd eQytvBqGLuThsvXD9RpLXeREP8Rm2wJH5OU8JUb0AMuPpgHvdidMCFLzzApW6aq/Nvtd o07xTXlHTZjf7R99aqLM/p6bBP9ty5vGSCifJ8Vr6nJwlVYaiV4NsvC3ueTZIzn2PKiu /SWmkpQF+pP4iKR38VWqYVU/A/GtU39JqkK23JpN7v/abRlFExXK/b2js2wrDF3jUEu/ u1a59RMrJN4QUBwAQBYEGMyqTMWSV8R2RuasnzhQXcQOIKZXupF0Fn8qYtQsJ1h/icX5 bxRA== 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 q16si44409477pgv.140.2019.08.05.06.51.16; Mon, 05 Aug 2019 06:51:17 -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 S1730685AbfHENvP (ORCPT + 29 others); Mon, 5 Aug 2019 09:51:15 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44492 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729625AbfHENu1 (ORCPT ); Mon, 5 Aug 2019 09:50:27 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0636237F57F35AD326B3; Mon, 5 Aug 2019 21:50:24 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Mon, 5 Aug 2019 21:50:15 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 15/15] scsi: hisi_sas: Consolidate internal abort calls in LU reset operation Date: Mon, 5 Aug 2019 21:48:12 +0800 Message-ID: <1565012892-75940-16-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1565012892-75940-1-git-send-email-john.garry@huawei.com> References: <1565012892-75940-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: Luo Jiaxing In hisi_sas_lu_reset(), we call internal abort for SAS and SATA device codepaths -> consolidate into a single call. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index acb87b4f9622..d60eaaa4c5e8 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1829,18 +1829,18 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun) struct device *dev = hisi_hba->dev; int rc = TMF_RESP_FUNC_FAILED; + /* Clear internal IO and then lu reset */ + rc = hisi_sas_internal_task_abort(hisi_hba, device, + HISI_SAS_INT_ABT_DEV, 0); + if (rc < 0) { + dev_err(dev, "lu_reset: internal abort failed\n"); + goto out; + } + hisi_sas_dereg_device(hisi_hba, device); + if (dev_is_sata(device)) { struct sas_phy *phy; - /* Clear internal IO and then hardreset */ - rc = hisi_sas_internal_task_abort(hisi_hba, device, - HISI_SAS_INT_ABT_DEV, 0); - if (rc < 0) { - dev_err(dev, "lu_reset: internal abort failed\n"); - goto out; - } - hisi_sas_dereg_device(hisi_hba, device); - phy = sas_get_local_phy(device); rc = sas_phy_reset(phy, 1); @@ -1851,14 +1851,6 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun) } else { struct hisi_sas_tmf_task tmf_task = { .tmf = TMF_LU_RESET }; - rc = hisi_sas_internal_task_abort(hisi_hba, device, - HISI_SAS_INT_ABT_DEV, 0); - if (rc < 0) { - dev_err(dev, "lu_reset: internal abort failed\n"); - goto out; - } - hisi_sas_dereg_device(hisi_hba, device); - rc = hisi_sas_debug_issue_ssp_tmf(device, lun, &tmf_task); if (rc == TMF_RESP_FUNC_COMPLETE) hisi_sas_release_task(hisi_hba, device);