Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp235986pxu; Fri, 4 Dec 2020 01:52:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJztcG8CaDnMWbvNxO9P4e417t5bhvAHUj2tLvBpvPdO8bLxKYRiXTeZcjKHPiOZxFEKCvHq X-Received: by 2002:a17:907:435c:: with SMTP id oc20mr6533791ejb.286.1607075556989; Fri, 04 Dec 2020 01:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607075556; cv=none; d=google.com; s=arc-20160816; b=ItAIvU1YawKpmi/wUVxe17rAfgnVWQ0DLxvGGzNjD7KZmb/3+Ggg9OfuIjihMqAydC B305mNk7nkslAndqIvEmA4ZNPcqzyMOcSlW8dTStIsUZC/oS24Q9MlolqtNKRRu2EDEp MasBxWywPVzUsFhqn7ofoKGVj9jiOYRIIzO3x23sNXQvOg+KUnWztyrj5i4p6iBXERLb V25KdMeMMbKMrGw/g4v5joXp5iR8JEmsk1F4rXAsrnSrUXyc5p8fm28qEt4X8bGbpoQr wHlQsPflbrfKW57qqjRmzS49Q1F4CKXX2ylSCc6me5S7aZVrJQJESKnw92b7n3x/9V9a 34tA== 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=aoqYrBohOJ37BJyfxY7DmuTy16fDjQJhdc6Z41MpxpM=; b=j8EyhRCBmisf/NkCl98Mtkt6X+Z6D9kkHDOwBE6bZh4l1pUOIYzK4KbQchTED7foeS XYb7CWKcob/ZwhSwaVKQB8s3b2AEJ4YIpLE15KRrkO2zVtXMrK+NRqRuCXVYsVLtX+g1 oc1g5vc+Ngvq5cvGIKOs1xTIrnz1URPvVqlb+V1Z2U+DcB5SrrvNIErvYRCZHBGpaqZy AheT1gjI5uioBOBKDKd1GdEZi2uyMRwNoMV+0qcVO6Hy/Yo8dFo2iZtKxSoJ/Z/NDn78 OI6DpbNNcf9JwV3Hs+WUVD6JAmzj8Pi+EEx3yAGz7wVuVi0PIR13M+M02V/jgaGglpsD FYbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a29si2619628edm.401.2020.12.04.01.52.14; Fri, 04 Dec 2020 01:52:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387823AbgLDJu5 (ORCPT + 99 others); Fri, 4 Dec 2020 04:50:57 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:37590 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726330AbgLDJuz (ORCPT ); Fri, 4 Dec 2020 04:50:55 -0500 X-UUID: 12cbecf8c4524b35a02dd78ffcf03196-20201204 X-UUID: 12cbecf8c4524b35a02dd78ffcf03196-20201204 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1381051746; Fri, 04 Dec 2020 17:50:10 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 4 Dec 2020 17:50:06 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 4 Dec 2020 17:50:06 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v3 5/8] scsi: ufs: Add error history for abort event in UFS Device W-LUN Date: Fri, 4 Dec 2020 17:50:04 +0800 Message-ID: <20201204095007.20639-6-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201204095007.20639-1-stanley.chu@mediatek.com> References: <20201204095007.20639-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add error history for abort event in UFS Device W-LUN. Besides, use specified value as parameter of ufshcd_update_reg_hist() to identify the aborted tag or LUNs. Reviewed-by: Can Guo Signed-off-by: Stanley Chu --- drivers/scsi/ufs/ufshcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index c2f611516ea7..922d68bca345 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6738,8 +6738,10 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) * To avoid these unnecessary/illegal step we skip to the last error * handling stage: reset and restore. */ - if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN) + if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN) { + ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, lrbp->lun); return ufshcd_eh_host_reset_handler(cmd); + } ufshcd_hold(hba, false); reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); @@ -6763,7 +6765,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) */ scsi_print_command(hba->lrb[tag].cmd); if (!hba->req_abort_count) { - ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, 0); + ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, tag); ufshcd_print_host_regs(hba); ufshcd_print_host_state(hba); ufshcd_print_pwr_info(hba); -- 2.18.0