From patchwork Fri Dec 8 17:16:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 121208 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp867660qgn; Fri, 8 Dec 2017 08:35:11 -0800 (PST) X-Google-Smtp-Source: AGs4zManKSjW8yxgoY2dHW57dD1++vb0ZU12Z23BTtRfzV42BcJZ7l4u/Wm2wLNVi0E7Rk/9DXsf X-Received: by 10.84.215.2 with SMTP id k2mr30527109pli.60.1512750911900; Fri, 08 Dec 2017 08:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512750911; cv=none; d=google.com; s=arc-20160816; b=PvcTD3QDYURXYE+9XYEDHCiXuMcdZhmyJhBhkQQRYGwag/ocTWAI1IjpatvxYnAaXc 0eklhMzVN1pcqbpA2OWT7Vh2HpprreiSJ16tcXrUuNB/djTWUoIMy5u0f9rOqPob2u8G mR7wDoLJ4lEhDqp52nDtCssV0BCdh6TOHik+HKk2JZZLe2bhTyBXDOCnzmeRbrsZChH3 WnExNREJeNV9IIETO8YbUEXUE4hkkRrhrbxaW+knWbOdFijfYbP4D727L0bpQE6Lw59v gaXrEdJ14cm/w7oNEwmMMalyfY/YN9GugCcSwgqYNxq7GA71HwdRwfANmRtlkdByBk0p C1yw== 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=YiOjL7HH30f0rDNMtcVu6RGnTSXLnEUATlBqaFT2bLY=; b=yd2vU5tr/gfYe9p2Jmqx+CeEuT9bgQbh+mKdWdgG/1tOu240yEVmYO8+a0D1v8ZCrt oBZhpU+/gsybR5BBhqF8eWEZ1+OBulX5UFAFrn28R7AAXlWszugXyQzMIIlTKVOQGNOL RB/NVt9cSg3PnEY6FhUjnxTyor1KiEaXJXQwFs1I2uX04M6zY5HbYGQV/qCPPqYdI/1I 61w+hW/ljS1y9WF1xQ/q1HqOIw4F/hySgj7EJ7pkMycHK/UqTKNpLQETpBjeHxelY4Xc E840Casg3CHH8vEBmVGrK6LlAwU2hAvRqsbpLjuUapdgwQFleCyHs6X007XvlfZGRtN2 7jiw== 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 i191si5704252pge.391.2017.12.08.08.35.11; Fri, 08 Dec 2017 08:35:11 -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 S1754599AbdLHQfI (ORCPT + 18 others); Fri, 8 Dec 2017 11:35:08 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2232 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754317AbdLHQbE (ORCPT ); Fri, 8 Dec 2017 11:31:04 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 05AF054F52CA1; Sat, 9 Dec 2017 00:30:45 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Sat, 9 Dec 2017 00:30:37 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 06/19] scsi: hisi_sas: modify hisi_sas_dev_gone() for reset Date: Sat, 9 Dec 2017 01:16:37 +0800 Message-ID: <1512753410-50924-7-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1512753410-50924-1-git-send-email-john.garry@huawei.com> References: <1512753410-50924-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 Do a couple of changes for when HISI_SAS_RESET_BIT is set for HBA: - Clearing ITCT is not necessary - Remove internal abort as it will fail during reset Flag sas_dev->dev_type is kept as SAS_PHY_UNUSED. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 64d51a8..e4b3092 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -738,17 +738,19 @@ static void hisi_sas_dev_gone(struct domain_device *device) dev_info(dev, "found dev[%d:%x] is gone\n", sas_dev->device_id, sas_dev->dev_type); - hisi_sas_internal_task_abort(hisi_hba, device, + if (!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) { + hisi_sas_internal_task_abort(hisi_hba, device, HISI_SAS_INT_ABT_DEV, 0); - hisi_sas_dereg_device(hisi_hba, device); + hisi_sas_dereg_device(hisi_hba, device); + + hisi_hba->hw->clear_itct(hisi_hba, sas_dev); + device->lldd_dev = NULL; + memset(sas_dev, 0, sizeof(*sas_dev)); + } - hisi_hba->hw->clear_itct(hisi_hba, sas_dev); if (hisi_hba->hw->free_device) hisi_hba->hw->free_device(sas_dev); - - device->lldd_dev = NULL; - memset(sas_dev, 0, sizeof(*sas_dev)); sas_dev->dev_type = SAS_PHY_UNUSED; }