Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp866131pxu; Thu, 26 Nov 2020 14:26:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNcyIsmNcGGk0Neb/zDG0XnYYP2HPjP6SFtqspQkYVUg9xbvENIxyyPeLGEk3oO8NIZxFQ X-Received: by 2002:a05:6402:149a:: with SMTP id e26mr4699373edv.232.1606429567282; Thu, 26 Nov 2020 14:26:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606429567; cv=none; d=google.com; s=arc-20160816; b=xSuu13qbRWzh99+gBBV+PyrvoGUvncFprugFprgYM89Wud7IqTdAs3Ckjpvp2iTk2b 1mMWodQ5VqHlJvpFk0PDA6E9EFqcetcjbL5XlNiohFgzllTMy65bLFBsOpX7r+rwhU8S S/+meRIPgcm3nyHVXe0BeZRQk243HaavK78AoUvkccgHTNEPzOPmlRrP5K4O0t0NrHnU mlvqqJz/S+w4AmrBgBbLNAbc5t/fHZRgAr9Phj+r96pFxERpWxEHiaV9gO5g7FFa+/tr n0xvaJ8rODHb6C8QnZt12IfmNPkPuBwqtY3maPmH/N4/wqlf+yupZiHBlsYlQTMWC88k wL0w== 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=pykno9T4V7U0qK/ZlKikYr5AOkdY65aUgEaCVzC/Plg=; b=gcJ6K+xM5snmV7kj973W8UpQ0G2QdsVoBhBOIkmD9ACf/wBn5na9OT56nNSkClsiIb Xn9pMVzIQmZk4OOsXETLzzrFd8fUe2WpoJDcXRebxhFeKEmo9g3IvolODwfOjS8QvaYB 9eSdn7pcniFf8sZFsL4yRm1ONaRRhA9yzUksQuz1MtbWp3PZhJ6Qp8PweAqSVEzzk8+S /h8yDIUYAbu3+bsYy1ms+b8+zQBkWr/imDHe9ZKcRUQiyY83w+LM9m8pVZZ01qIUodVU btC8mnXtGfE6+GmJL9eAwVmDLXGtdMkpjH33GR0VbyyYwXXzuQIxZWDxkXNtfoau4mlD 47sw== 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 d2si4610521ejm.675.2020.11.26.14.25.36; Thu, 26 Nov 2020 14:26:07 -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 S1732463AbgKZFis (ORCPT + 99 others); Thu, 26 Nov 2020 00:38:48 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:43858 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732307AbgKZFir (ORCPT ); Thu, 26 Nov 2020 00:38:47 -0500 X-UUID: 94748ba0c6a941adaf49993656acca43-20201126 X-UUID: 94748ba0c6a941adaf49993656acca43-20201126 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] 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 574881674; Thu, 26 Nov 2020 13:38:42 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 26 Nov 2020 13:38:39 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 26 Nov 2020 13:38:40 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v1 1/3] scsi: ufs: Add error history for abort event in UFS Device W-LUN Date: Thu, 26 Nov 2020 13:38:37 +0800 Message-ID: <20201126053839.25889-2-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201126053839.25889-1-stanley.chu@mediatek.com> References: <20201126053839.25889-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 130BC8D7BEA1DFFC31F184632A009456CB0D0F6DA020AB6400F2F83B92F318792000:8 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. 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 0e5473d4699b..28e4def13f21 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6742,8 +6742,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); @@ -6767,7 +6769,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