Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp289665pxu; Wed, 2 Dec 2020 23:28:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeYSDIxX09fKRhWfNkYoneewuGGzR/q6g3zxddoSkTmvkGTx+xUFJSddm9KnUx+05vj3kZ X-Received: by 2002:a50:a40f:: with SMTP id u15mr1695395edb.307.1606980503746; Wed, 02 Dec 2020 23:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606980503; cv=none; d=google.com; s=arc-20160816; b=eB+cYQYIsBmZdxOB5MOfmuDCDwvh4DMp2GEK8e7ng6xrihNZelWqj6Q7sSHcl+Nvf7 2gD2aLPSDBnVJmtZDRjnxG1MaqyrSYcTL9WZX13y9rZMXCwsV6dcpA+yjiHqgAztW+0J 6m43PcAySXfGqEkNoImSRIlt6M8TzGI4VedVUtQMFpWguy4v6MWncIhOqCnkfSdw2NoJ uCVedeZ1Hgx7ntOEYcQiJJMYIk6LBUihx6E0PhpJjJZOoLYN13VqD/I1oc685Ayxhd/0 L26g6AztClhNGAteSi2mVMDpjup5rHJL9qFJY34M9qEaOLot63lFE29ZefW9Fbeqi2Lt vOFQ== 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=t5rerR3zs0cjYUcfOKcmkveT8vSpF4yXUo9Dmgb81cM=; b=sPPcpkQLrFnsg7Jn/pGnf6bo7jtRntNAjko7Yr4NHMwcASUE2hrqTq/db+xONlsr69 tq2J39/5pp+6na/aR4xqPk12LhgNp4ypE92Mr7sW5yVFkoaXj5jNY1OnPq6SMhx3qTqr tMbYbHHXvhlZI/7xLt+kqOfegTB8vXOOakWJ0QpXAu7Rc3siQqrN5LdyHtF87iw23/BU ZRBdluGv5jDoHpQ7PVng5fowEGv7gHTbnnYNIW7kxEvXOicRYhlIzpjxqPcVm3coclEx /uYVOkQb+3clozq18qOrbe+AQGJJ5sFgzgDWQ1ZU3NGK0l2SjvIa7KjqdFJ9TeQZdURF wCwA== 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 o11si613936ejg.118.2020.12.02.23.28.00; Wed, 02 Dec 2020 23:28:23 -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 S2388115AbgLCHZd (ORCPT + 99 others); Thu, 3 Dec 2020 02:25:33 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:57194 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726085AbgLCHZc (ORCPT ); Thu, 3 Dec 2020 02:25:32 -0500 X-UUID: e6540b5be7c14fdb96486b2d7ab0f167-20201203 X-UUID: e6540b5be7c14fdb96486b2d7ab0f167-20201203 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.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 414784189; Thu, 03 Dec 2020 15:24:48 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Dec 2020 15:24:45 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 3 Dec 2020 15:24:45 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v2 1/3] scsi: ufs: Add error history for abort event in UFS Device W-LUN Date: Thu, 3 Dec 2020 15:24:41 +0800 Message-ID: <20201203072443.6663-2-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201203072443.6663-1-stanley.chu@mediatek.com> References: <20201203072443.6663-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 11a4aad09f3a..7067b86a8e08 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