From patchwork Mon Jul 13 08:04:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 235364 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2622782ilg; Mon, 13 Jul 2020 01:08:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEfigjxoOUbM2FdG3ENK08EbrGP/j9m0e4wV+RouiWdFNQpdpOuLgZIh9rvJQbnIEV3wVL X-Received: by 2002:a05:6402:1c86:: with SMTP id cy6mr75288437edb.30.1594627728178; Mon, 13 Jul 2020 01:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594627728; cv=none; d=google.com; s=arc-20160816; b=bR+xEbCYdeLUBWy+Euc3iA4LXXX2KK8iZ9EdzXvGvY1zbQRwdmmxvulpsQSIzv46Yu zIPIxlvwm6HQHDDKTSg5IQjFhuQw9IIqp/NPxrRRZ3NuEBHZiLhCxrgrRu1aIVmwFpqQ kC3HynPUb5ZXxu1+qLCFsAozx//aFsxmpdUvfXuyEOqae1FcQFVEOwNh05wYekEcNBrU bXO5JUDBJMuThJ7HnXmtC1zX55W+/0lf5ZQUWoikgWhaJzp8Agsgox9Q8Rs3SpE/nf6l u5c2eYO8fGmKqdgRqcWUzc5vn0IORApJ0g4eVDD/hJvHmbi5CZ2oIQm5XlXHV2S92t04 67Og== 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=n29CZO97X4sP4h8+VSRdMDNJH5sTZ5008ArQWzC2z8o=; b=TzJWptSX2F7S+k4rdsJ7H8qP88R8qYFBNNfI+dVcOLV7NKJmKi71dMUEpG2gl6jQkZ RWugswM+97qgIXJsvJBwdsWunGp4xxSmLeMQT2XLKP9w5orn+3DasNNsE15Wfl5EcN8x JbbYkApiTOVKcjh8GoBR7nxZwsSftcDlvLNks/q97Kiv498eFhw3oC7CR3UQ1fEjKyAU M/0KMn8tG8TFaHE2TMa2LhyvdZujzapxoZfNexLysSRT/c1IUU7eK51ozq/yZ99r/CId PpnKJKA1L+mbrawh16SYcMs1sKw/EkwW8LgJR8tu+zbdhWTB2OWxm8YHs4RrC53B7d6j /fNA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si8899890ejx.722.2020.07.13.01.08.48 for ; Mon, 13 Jul 2020 01:08:48 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729197AbgGMIIn (ORCPT ); Mon, 13 Jul 2020 04:08:43 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7841 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728974AbgGMIIi (ORCPT ); Mon, 13 Jul 2020 04:08:38 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id AD91AC4288777DB34407; Mon, 13 Jul 2020 16:08:35 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Mon, 13 Jul 2020 16:08:27 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH 1/2] scsi: hisi_sas: Directly trigger SCSI error handling for completion errors Date: Mon, 13 Jul 2020 16:04:30 +0800 Message-ID: <1594627471-235395-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1594627471-235395-1-git-send-email-john.garry@huawei.com> References: <1594627471-235395-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing We used timeout mechanism of SCSI mid-layer to trigger some IO's error handle, this type of abnormal IO require driver to enter error handle to clear the residue in the hardware. But timeout mechanism caught error handle time to be longer, some threads need to wait for tens of seconds until block layer detect timeout and wake up SCSI error handle thread. So we try to trigger error handling directly for some specific IOs to save time. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 4 +++- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 +++- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 2e1718f9ade2..53e1f517efe9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1258,8 +1258,10 @@ static void slot_complete_v1_hw(struct hisi_hba *hisi_hba, !(cmplt_hdr_data & CMPLT_HDR_RSPNS_XFRD_MSK)) { slot_err_v1_hw(hisi_hba, task, slot); - if (unlikely(slot->abort)) + if (unlikely(slot->abort)) { + sas_task_abort(task); return; + } goto out; } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index e7e7849a4c14..4151b2c04923 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -2404,8 +2404,10 @@ static void slot_complete_v2_hw(struct hisi_hba *hisi_hba, error_info[0], error_info[1], error_info[2], error_info[3]); - if (unlikely(slot->abort)) + if (unlikely(slot->abort)) { + sas_task_abort(task); return; + } goto out; } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 3e6b78a1f993..d2488d27ff8f 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2235,8 +2235,10 @@ static void slot_complete_v3_hw(struct hisi_hba *hisi_hba, dw0, dw1, complete_hdr->act, dw3, error_info[0], error_info[1], error_info[2], error_info[3]); - if (unlikely(slot->abort)) + if (unlikely(slot->abort)) { + sas_task_abort(task); return; + } goto out; }