From patchwork Sat Dec 5 11:58:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanley Chu X-Patchwork-Id: 11953037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9B48C4361A for ; Sat, 5 Dec 2020 12:00:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A79BA23102 for ; Sat, 5 Dec 2020 12:00:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A79BA23102 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=B0/2JgrOo64X0ljwT8bGmb1TaxXPDh4rpz+YuesN/gg=; b=Jh4F8/J7ARXy27PFgiX8mA7BX Jkp9UmGXtTXKJ4WRjTTU0tZzZXrFiCaZCSwas4nbx0OVsE73bhQwUmiQ0kCxNXO2F/PQ2tus9T0gb DTkPt6SOJ3z5BZn5JGQGQO482lultNyBSPQaxOjA6i4U/7m+JFEXSCl6+QPFoUoBlw1vgbvfmehpc GcflyvUAWkkLcDmBTMRbgBu0UgjJrbH3KV+5PGI/PbxVBKfv+CGxa7MNa+YVtnZuk/QZayBbbpU9+ 0fKtPH3OioOrSe3KTOid8mQ9uBYs9PhkTnjFP/YtMmEuo1SJY91hBExVtvCw12dSyrOXSOMPWOatD XqezjrVFA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klWDy-00081C-TH; Sat, 05 Dec 2020 11:59:38 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klWDi-0007ve-Cx; Sat, 05 Dec 2020 11:59:24 +0000 X-UUID: 2d75544dbaf84416b1142b3f006ab548-20201205 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=jD8JOKPViqei/S/AK79ldptW6nVHLTVWt5VRTQjjT9A=; b=KMK6G/QLGKLLhXCNLqt7EW3mRau0hE/k+PRWfilLIIGOZ7F3E+MixjXGDbVobv1Z9nq22XHiM8zsV4V3jqHw6YlIkyfPGAx2GfR7tquhpVck5ZZeUdEmezQANQ0JGo+Zv4ovqfh7vcCUmrKYqR88g5JyR92fdBuNd2t3SAbXQLM=; X-UUID: 2d75544dbaf84416b1142b3f006ab548-20201205 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1432110540; Sat, 05 Dec 2020 03:59:12 -0800 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Dec 2020 03:59:11 -0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Dec 2020 19:59:00 +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; Sat, 5 Dec 2020 19:59:02 +0800 From: Stanley Chu To: , , , , Subject: [PATCH v5 1/4] scsi: ufs: Add error history for abort event in UFS Device W-LUN Date: Sat, 5 Dec 2020 19:58:58 +0800 Message-ID: <20201205115901.26815-2-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201205115901.26815-1-stanley.chu@mediatek.com> References: <20201205115901.26815-1-stanley.chu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_065922_686668_5C01363C X-CRM114-Status: GOOD ( 10.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stanley Chu , alice.chao@mediatek.com, bvanassche@acm.org, huadian.liu@mediatek.com, andy.teng@mediatek.com, cc.chou@mediatek.com, chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com, linux-kernel@vger.kernel.org, jiajie.hao@mediatek.com, cang@codeaurora.org, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, matthias.bgg@gmail.com, beanhuo@micron.com, chaotian.jing@mediatek.com, linux-arm-kernel@lists.infradead.org, asutoshd@codeaurora.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Asutosh Das 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);