From patchwork Mon Jun 7 09:29:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 455274 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp2590171jae; Mon, 7 Jun 2021 02:35:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb3+xQ2iXrbAgn6vHLa29nLVMUCfD4fqD8th1N6QE83PetrtW5J+sC7jcc3vTdqq3EU/t+ X-Received: by 2002:a17:906:a293:: with SMTP id i19mr16454208ejz.311.1623058504932; Mon, 07 Jun 2021 02:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623058504; cv=none; d=google.com; s=arc-20160816; b=ok6XMOIYYYptdRj3zhHNozMMoNG54ZCCql+FUOA6zqsSNgobrYWQkg92R/MTApUs3j 6nXEwOgSHzhenm2OWp0Ki8O5gPpY856aznUvPD/7a/jsGQs2KrmVZSsG7yqGWOgkJkAz EW7symqPtvAKsfFUClAuLFtBTQXm4HuaKQCfJwre6UBgur5eLCv+C0R7BnHS0jqh3bIP q+tJzMNvGwoHPNRxdUDJWsgPXIj8jNjaGZOzWrhxfj1YBe+v4Jp3ghj0TstBdlCCHUfW BdJIEwgbpJVc2gJeodSS8YA16FEb/OiHSDT3v78l3SnN9f0wROyEuvK8FB73qw89IYbl QqHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=2qWXWPKqq1WgtpF/9vhdbOavpIDASh9NOIh/4K2dM5g=; b=cuHksNzF8Z5ZvVXN6/wuq6rpkVTqHBN4uVxnNcxHwDMj+BA3N1OYi0drVnz9SXjLlT 8GBDdZTZFwG5yc1b9DhmB7fOKKqjTX9fKMQZV0PlPj3oXj5sQ51ZrFepv80lzFaKW7nT zioq67K5nQcW6OYESBpQRkJmgdACYaLJ2DIVK/EM1q//W+Ufgc2ey2CxabJ/cT1a+uoo EyJSHpNDWv5ClLCY9/a3zQMDGAquAvBJJKv8QXDBCVN3+k1Y6inQ7eg8ziKD74Sg33Om EEgpH8Y3Rri4bKQi4ADtaajwDT9lf3gdb8yVtZSSjtbXMSn4CmclBQ42ybv4Tcl3t8my HdLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si12128395ejb.163.2021.06.07.02.35.04 for ; Mon, 07 Jun 2021 02:35:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbhFGJgU (ORCPT ); Mon, 7 Jun 2021 05:36:20 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3162 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230516AbhFGJgP (ORCPT ); Mon, 7 Jun 2021 05:36:15 -0400 Received: from fraeml710-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Fz7D75Pn4z6H6q6; Mon, 7 Jun 2021 17:21:43 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml710-chm.china.huawei.com (10.206.15.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 7 Jun 2021 11:34:23 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 7 Jun 2021 10:34:21 +0100 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 5/5] scsi: hisi_sas: Speed up error handling when internal abort timeout occurs Date: Mon, 7 Jun 2021 17:29:39 +0800 Message-ID: <1623058179-80434-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1623058179-80434-1-git-send-email-john.garry@huawei.com> References: <1623058179-80434-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing If an internal task abort timeout occurs, the controller has developed a fault, and needs to be reset to be recovered. When this occurs during error handling, the current policy is to allow error handling to continue, and the inevitable nexus ha reset will handle the required reset. However various steps of error handling need to taken before this happens. These also involve some level of HW interaction, which will also fail with various timeouts. Speed up this process by recording a HW fault bit for an internal abort timeout - when this is set, just automatically error any HW interaction, and essentially go straight to clear nexus ha (to reset the controller). Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ++++++ 2 files changed, 7 insertions(+) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 8f2492d0d49e..436d174f2194 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -38,6 +38,7 @@ #define HISI_SAS_RESET_BIT 0 #define HISI_SAS_REJECT_CMD_BIT 1 #define HISI_SAS_PM_BIT 2 +#define HISI_SAS_HW_FAULT_BIT 3 #define HISI_SAS_MAX_COMMANDS (HISI_SAS_QUEUE_SLOTS) #define HISI_SAS_RESERVED_IPTT 96 #define HISI_SAS_UNRESERVED_IPTT \ diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 0ad861aa5bb6..3a903e8e0384 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1616,6 +1616,7 @@ static int hisi_sas_controller_reset(struct hisi_hba *hisi_hba) } hisi_sas_controller_reset_done(hisi_hba); + clear_bit(HISI_SAS_HW_FAULT_BIT, &hisi_hba->flags); dev_info(dev, "controller reset complete\n"); return 0; @@ -2079,6 +2080,9 @@ _hisi_sas_internal_task_abort(struct hisi_hba *hisi_hba, if (!hisi_hba->hw->prep_abort) return TMF_RESP_FUNC_FAILED; + if (test_bit(HISI_SAS_HW_FAULT_BIT, &hisi_hba->flags)) + return -EIO; + task = sas_alloc_slow_task(GFP_KERNEL); if (!task) return -ENOMEM; @@ -2109,6 +2113,8 @@ _hisi_sas_internal_task_abort(struct hisi_hba *hisi_hba, if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) { struct hisi_sas_slot *slot = task->lldd_task; + set_bit(HISI_SAS_HW_FAULT_BIT, &hisi_hba->flags); + if (slot) { struct hisi_sas_cq *cq = &hisi_hba->cq[slot->dlvry_queue];