[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210203065346.26606-1-dh0421.hwang@samsung.com>
Date: Wed, 3 Feb 2021 15:53:46 +0900
From: DooHyun Hwang <dh0421.hwang@...sung.com>
To: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
alim.akhtar@...sung.com, avri.altman@....com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, stanley.chu@...iatek.com,
cang@...eaurora.org, asutoshd@...eaurora.org, beanhuo@...ron.com,
jaegeuk@...nel.org, adrian.hunter@...el.com, satyat@...gle.com
Cc: grant.jung@...sung.com, jt77.jang@...sung.com,
junwoo80.lee@...sung.com, jangsub.yi@...sung.com,
sh043.lee@...sung.com, cw9316.lee@...sung.com,
sh8267.baek@...sung.com, wkon.kim@...sung.com,
DooHyun Hwang <dh0421.hwang@...sung.com>
Subject: [PATCH] scsi: ufs: Add total count for each error history
Since the total error history count is unknown because the error history
records only the number of UFS_EVENT_HIST_LENGTH, add a member to count
each error history.
Signed-off-by: DooHyun Hwang <dh0421.hwang@...sung.com>
---
drivers/scsi/ufs/ufshcd.c | 3 +++
drivers/scsi/ufs/ufshcd.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index fb32d122f2e3..7ebc892553fc 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -437,6 +437,8 @@ static void ufshcd_print_evt(struct ufs_hba *hba, u32 id,
if (!found)
dev_err(hba->dev, "No record of %s\n", err_name);
+ else
+ dev_err(hba->dev, "%s: total count=%u\n", err_name, e->count);
}
static void ufshcd_print_evt_hist(struct ufs_hba *hba)
@@ -4544,6 +4546,7 @@ void ufshcd_update_evt_hist(struct ufs_hba *hba, u32 id, u32 val)
e->val[e->pos] = val;
e->tstamp[e->pos] = ktime_get();
e->pos = (e->pos + 1) % UFS_EVENT_HIST_LENGTH;
+ e->count++;
ufshcd_vops_event_notify(hba, id, &val);
}
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index aa9ea3552323..df28d3fc89a5 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -450,6 +450,7 @@ struct ufs_event_hist {
int pos;
u32 val[UFS_EVENT_HIST_LENGTH];
ktime_t tstamp[UFS_EVENT_HIST_LENGTH];
+ u32 count;
};
/**
--
2.29.0
Powered by blists - more mailing lists