From patchwork Tue Apr 2 03:55:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiang X-Patchwork-Id: 785067 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03C0E1757D for ; Tue, 2 Apr 2024 03:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712030384; cv=none; b=ISe6D+yyKsWI6an/oLLn2ypxG9wO69IuQ0R5aRJ2yVplmbm4MlwmFtnDZ2xwB0PCHrxQJOErpGoDtb7HAcBTDyRHOnco9XCsXCYFVGkgRA5mA445yWpdXjbKEaHjCenyjCD7HKKzrP3OR5dlpX+P69CsEFGgpZ4d3Dye15uOCJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712030384; c=relaxed/simple; bh=AxW2vImOCAh2HYWzIG6JCt23QG0rOfQjr//ZYZDC7dM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SOVEZxulkM0hDanaSsuKZ8cX+ZadudN6Hr7VkshBpQZGf1x5g28vS3X33EDgDvH6D30mSDpI2FQSjpYulWrgDy7QAYBGu+1V4cJkI1QfxAOAmtrRWVWlrykUgfQT/ZrwaI+fCbcmsZM4eYzvZSpGYq8kK2kpmZuUSgsbviGtA84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=hisilicon.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hisilicon.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4V7vFx4K5Jz1R9nw; Tue, 2 Apr 2024 11:56:53 +0800 (CST) Received: from kwepemd200015.china.huawei.com (unknown [7.221.188.21]) by mail.maildlp.com (Postfix) with ESMTPS id 83AF41A0172; Tue, 2 Apr 2024 11:59:38 +0800 (CST) Received: from huawei.com (10.67.165.2) by kwepemd200015.china.huawei.com (7.221.188.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 2 Apr 2024 11:59:38 +0800 From: chenxiang To: , CC: , Subject: [PATCH v2 1/2] scsi: hisi_sas: Handle the NCQ error returned by D2H frame Date: Tue, 2 Apr 2024 11:55:12 +0800 Message-ID: <20240402035513.2024241-2-chenxiang66@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240402035513.2024241-1-chenxiang66@hisilicon.com> References: <20240402035513.2024241-1-chenxiang66@hisilicon.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd200015.china.huawei.com (7.221.188.21) From: Xiang Chen We find that some disks use D2H frame instead of SDB frame to return NCQ error. Currently, only the I/O corresponding to the D2H frame is processed in this scenario, which does not meet the processing requirements of the NCQ error scenario. So we set dev_status to HISI_SAS_DEV_NCQ_ERR and abort all I/Os of the disk in this scenario. Signed-off-by: Xingui Yang Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 7d2a33514538..34f96cc35342 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2244,7 +2244,15 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task, case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP: if ((dw0 & CMPLT_HDR_RSPNS_XFRD_MSK) && (sipc_rx_err_type & RX_FIS_STATUS_ERR_MSK)) { - ts->stat = SAS_PROTO_RESPONSE; + if (task->ata_task.use_ncq) { + struct domain_device *device = task->dev; + struct hisi_sas_device *sas_dev = device->lldd_dev; + + sas_dev->dev_status = HISI_SAS_DEV_NCQ_ERR; + slot->abort = 1; + } else { + ts->stat = SAS_PROTO_RESPONSE; + } } else if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) { ts->residual = trans_tx_fail_type; ts->stat = SAS_DATA_UNDERRUN; From patchwork Tue Apr 2 03:55:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiang X-Patchwork-Id: 786121 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7629BA3F for ; Tue, 2 Apr 2024 03:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712030383; cv=none; b=OVSO5Vf41MUThH0AML9/cmXstMHME+smGjGsjQFHSImxARzQ9+N9Gg1myCoUVPc5KXplCngflb45eu1k0q+KcOMHNtpOOM8MAykXZda41vRbennLhtw992VvE2fMd2V3PU3aARKStiUMnbdFBlcXp/O857aKoyVxUZNURMvmFIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712030383; c=relaxed/simple; bh=VHW4/JKm5vgh5Tlmep3gWPcKsdnecZxTHjKRKmhti4Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tvcsZ8PMQ76pLo84OyM8Ylcjii/u7oWyf33iNnbjThJHyLUb/hIOenWztoCa8J/DTK/yyAE+DOL3fosYGy9mlwhyTFJc7TEnncZFp6F5h6TRbPM+pqY/shAb2yudkBu/vCVt920AHqaaopnJJ0G4RNzOo7FIz8rDEcElQRgbo98= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=hisilicon.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hisilicon.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4V7vJ708V8z1wnrX; Tue, 2 Apr 2024 11:58:47 +0800 (CST) Received: from kwepemd200015.china.huawei.com (unknown [7.221.188.21]) by mail.maildlp.com (Postfix) with ESMTPS id CB7DC140133; Tue, 2 Apr 2024 11:59:38 +0800 (CST) Received: from huawei.com (10.67.165.2) by kwepemd200015.china.huawei.com (7.221.188.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 2 Apr 2024 11:59:38 +0800 From: chenxiang To: , CC: , Subject: [PATCH v2 2/2] scsi: hisi_sas: Modify the deadline for ata_wait_after_reset() Date: Tue, 2 Apr 2024 11:55:13 +0800 Message-ID: <20240402035513.2024241-3-chenxiang66@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240402035513.2024241-1-chenxiang66@hisilicon.com> References: <20240402035513.2024241-1-chenxiang66@hisilicon.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd200015.china.huawei.com (7.221.188.21) From: Xiang Chen We found that the second parameter of function ata_wait_after_reset() is incorrectly used. We call smp_ata_check_ready_type() to poll the device type until the 30s timeout, so the correct deadline should be (jiffies + 30000). Fixes: 3c2673a09cf1 ("scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset") Signed-off-by: xiabing Signed-off-by: Yihang Li Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 097dfe4b620d..35f8e00850d6 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1797,7 +1797,7 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device) if (dev_is_sata(device)) { struct ata_link *link = &device->sata_dev.ap->link; - rc = ata_wait_after_reset(link, HISI_SAS_WAIT_PHYUP_TIMEOUT, + rc = ata_wait_after_reset(link, jiffies + HISI_SAS_WAIT_PHYUP_TIMEOUT, smp_ata_check_ready_type); } else { msleep(2000);