From patchwork Thu Apr 11 12:46:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162066 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7378090jan; Thu, 11 Apr 2019 05:48:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzb+YYQpqkkjmx3TKQyyt89X/rKN/h4MI0Bfu0Mcg7BupUd3Fv5CZZ+fwwckq8spPIAXd4h X-Received: by 2002:a17:902:b089:: with SMTP id p9mr25152262plr.185.1554986894965; Thu, 11 Apr 2019 05:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986894; cv=none; d=google.com; s=arc-20160816; b=OjeTIgqDF/eG+zbAPYSq3rDbLoJJNP2o53VlE7HGCzb+K9KXLiN024wRZ8M1uDPDaD 1ELK0B9rb2x15z/vPkJ+iDQ8Lhg228AWE9NnaUsIC4F6nnchNsCphSU2H1GxFZ2QNykO lAN9ZGV0jjJWGkJT9zzEpjLEXCcWcfoYu58HCMl7muAvy25dBfHWo6TuLhpzRupPv8mi 0h3BLL94DBrIwF0/xhTRK5saVpQ6nZWvRSDyueui5tWhzzMC6zPih+vLJRjdQAO7NIAX oo9zZBImyEmGtxwTIVmxtQgW2JMKL3R2X0viOoh/xdKHaNfwKL8lgUkslDrkLQpDuvHr RwLw== 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=MJ8PDENSE2AMjMRy0Qo2jIRIrsnorkp0eiLOqU78jIw=; b=vjQ8szx10lKcd6pdQMhHCClpRmJd63ozsTtO5r3ZEtG5xyjXSSZ4geDgTyDoEwzLJd Vbs1dEWWp2zb9Z9S41iJlCigcJES2iPVnW6gVqbWlnWm9ZfJsLAOYvR8sIShDmP3czVx iO5UgxQYpF9eLnTHNBJc/ZwhvyiqPSE4Ulaf2d2arVdYNm4RGLJaL4F/aM/WIp4JLtfK X0iJ0yHST6kIoEE3pDVJxduZdStcvczg2uCrC/FhIzL5Fxs2fKU3zRVa5HMwfc7Ufp1P BZ3XzBod2SpTyRdtgVuFXV/F/Br/4djZsi2vCnnseRBenoXnf+UuioRhky0KGJZTGtHQ ziyQ== 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 e5si14029109plb.249.2019.04.11.05.48.14; Thu, 11 Apr 2019 05:48:14 -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 S1727019AbfDKMr4 (ORCPT + 31 others); Thu, 11 Apr 2019 08:47:56 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6165 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726585AbfDKMrc (ORCPT ); Thu, 11 Apr 2019 08:47:32 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D5A563E6FF00AA29964B; Thu, 11 Apr 2019 20:47:29 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:20 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 7/9] scsi: hisi_sas: Don't hard reset disk during controller reset Date: Thu, 11 Apr 2019 20:46:42 +0800 Message-ID: <1554986804-233706-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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 the function of hisi_sas_init_device(), we added ops->hardreset() to clear affiliation of STP target port or handle [STP pending] state. Function hisi_sas_init_device() will be called when a device is found or during controller reset. At controller reset, we call hisi_sas_init_device() to re-init the disks, so calling hardreset() is unnecessary and it also will cause some delay at controller reset. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index ede812759991..c02cf78a20c7 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -754,7 +754,8 @@ static int hisi_sas_init_device(struct domain_device *device) * STP target port */ local_phy = sas_get_local_phy(device); - if (!scsi_is_sas_phy_local(local_phy)) { + if (!scsi_is_sas_phy_local(local_phy) && + !test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) { unsigned long deadline = ata_deadline(jiffies, 20000); struct sata_device *sata_dev = &device->sata_dev; struct ata_host *ata_host = sata_dev->ata_host;