* [PATCH] scsi: ufs: Add total count for each error history
[not found] <CGME20210203070741epcas1p20ce8cc24d06b3c82d735dff59f0459de@epcas1p2.samsung.com>
@ 2021-02-03 6:53 ` DooHyun Hwang
2021-02-03 7:27 ` Adrian Hunter
0 siblings, 1 reply; 3+ messages in thread
From: DooHyun Hwang @ 2021-02-03 6:53 UTC (permalink / raw)
To: linux-scsi, linux-kernel, alim.akhtar, avri.altman, jejb,
martin.petersen, stanley.chu, cang, asutoshd, beanhuo, jaegeuk,
adrian.hunter, satyat
Cc: grant.jung, jt77.jang, junwoo80.lee, jangsub.yi, sh043.lee,
cw9316.lee, sh8267.baek, wkon.kim, DooHyun Hwang
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@samsung.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: Add total count for each error history
2021-02-03 6:53 ` [PATCH] scsi: ufs: Add total count for each error history DooHyun Hwang
@ 2021-02-03 7:27 ` Adrian Hunter
2021-02-03 8:00 ` DooHyun Hwang
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Hunter @ 2021-02-03 7:27 UTC (permalink / raw)
To: DooHyun Hwang, linux-scsi, linux-kernel, alim.akhtar, avri.altman,
jejb, martin.petersen, stanley.chu, cang, asutoshd, beanhuo,
jaegeuk, satyat
Cc: grant.jung, jt77.jang, junwoo80.lee, jangsub.yi, sh043.lee,
cw9316.lee, sh8267.baek, wkon.kim
On 3/02/21 8:53 am, DooHyun Hwang wrote:
> 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@samsung.com>
Hi
Please note that the following patch is already queued - see linux-next
commit b6cacaf2044fd9b82e5ceac88d8d17e04a01982f
Author: Adrian Hunter <adrian.hunter@intel.com>
Date: Thu Jan 7 09:25:38 2021 +0200
scsi: ufs: ufs-debugfs: Add error counters
People testing have a need to know how many errors might be occurring over
time. Add error counters and expose them via debugfs.
A module initcall is used to create a debugfs root directory for
ufshcd-related items. In the case that modules are built-in, then
initialization is done in link order, so move ufshcd-core to the top of the
Makefile.
Link: https://lore.kernel.org/r/20210107072538.21782-1-adrian.hunter@intel.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.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;
> };
>
> /**
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] scsi: ufs: Add total count for each error history
2021-02-03 7:27 ` Adrian Hunter
@ 2021-02-03 8:00 ` DooHyun Hwang
0 siblings, 0 replies; 3+ messages in thread
From: DooHyun Hwang @ 2021-02-03 8:00 UTC (permalink / raw)
To: 'Adrian Hunter', linux-scsi, linux-kernel, alim.akhtar,
avri.altman, jejb, martin.petersen, stanley.chu, cang, asutoshd,
beanhuo, jaegeuk, satyat
Cc: grant.jung, jt77.jang, junwoo80.lee, jangsub.yi, sh043.lee,
cw9316.lee, sh8267.baek, wkon.kim
Hi
Thank you for your review and I found the below commit in linux-next.
So, I'll reject this patch.
>On 3/02/21 8:53 am, DooHyun Hwang wrote:
>> 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@samsung.com>
>
>Hi
>
>Please note that the following patch is already queued - see linux-next
>
>
>commit b6cacaf2044fd9b82e5ceac88d8d17e04a01982f
>Author: Adrian Hunter <adrian.hunter@intel.com>
>Date: Thu Jan 7 09:25:38 2021 +0200
>
> scsi: ufs: ufs-debugfs: Add error counters
>
> People testing have a need to know how many errors might be occurring
>over
> time. Add error counters and expose them via debugfs.
>
> A module initcall is used to create a debugfs root directory for
> ufshcd-related items. In the case that modules are built-in, then
> initialization is done in link order, so move ufshcd-core to the top of
>the
> Makefile.
>
> Link: https://lore.kernel.org/r/20210107072538.21782-1-
>adrian.hunter@intel.com
> Reviewed-by: Avri Altman <avri.altman@wdc.com>
> Reviewed-by: Bean Huo <beanhuo@micron.com>
> Reviewed-by: Can Guo <cang@codeaurora.org>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.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;
>> };
>>
>> /**
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-03 8:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20210203070741epcas1p20ce8cc24d06b3c82d735dff59f0459de@epcas1p2.samsung.com>
2021-02-03 6:53 ` [PATCH] scsi: ufs: Add total count for each error history DooHyun Hwang
2021-02-03 7:27 ` Adrian Hunter
2021-02-03 8:00 ` DooHyun Hwang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox