All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] scsi: ufs: Print uic error history in time order
@ 2019-01-28 14:04 Stanley Chu
       [not found] ` <1548684266-8792-1-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Stanley Chu @ 2019-01-28 14:04 UTC (permalink / raw)
  To: linux-scsi-u79uwXL29TY76Z2rM5mHXA, vinholikatti-Re5JQEeQqe8AvxtiuMwx3w
  Cc: wsd_upstream-NuS5LvNUpcJWk0Htik3J/w,
	kuohong.wang-NuS5LvNUpcJWk0Htik3J/w, avri.altman-Sjgp3cTcYWE,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	peter.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w, Stanley Chu

Now uic errors are printed out of time order.

Simply make it more readable by printing logs
in time order, and printing "No record" if history
is empty.

Signed-off-by: Stanley Chu <stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
 drivers/scsi/ufs/ufshcd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 9ba7671b84f8..f90badcb8318 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -393,15 +393,20 @@ static void ufshcd_print_uic_err_hist(struct ufs_hba *hba,
 		struct ufs_uic_err_reg_hist *err_hist, char *err_name)
 {
 	int i;
+	bool found = false;
 
 	for (i = 0; i < UIC_ERR_REG_HIST_LENGTH; i++) {
-		int p = (i + err_hist->pos - 1) % UIC_ERR_REG_HIST_LENGTH;
+		int p = (i + err_hist->pos) % UIC_ERR_REG_HIST_LENGTH;
 
 		if (err_hist->reg[p] == 0)
 			continue;
 		dev_err(hba->dev, "%s[%d] = 0x%x at %lld us\n", err_name, i,
 			err_hist->reg[p], ktime_to_us(err_hist->tstamp[p]));
+		found = true;
 	}
+
+	if (!found)
+		dev_err(hba->dev, "No record of %s uic errors\n", err_name);
 }
 
 static void ufshcd_print_host_regs(struct ufs_hba *hba)
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH v1 1/1] scsi: ufs: Print uic error history in time order
       [not found] ` <1548684266-8792-1-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2019-01-29  7:28   ` Avri Altman
  2019-02-05  3:04   ` Martin K. Petersen
  1 sibling, 0 replies; 5+ messages in thread
From: Avri Altman @ 2019-01-29  7:28 UTC (permalink / raw)
  To: Stanley Chu, linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	vinholikatti-Re5JQEeQqe8AvxtiuMwx3w
  Cc: matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	kuohong.wang-NuS5LvNUpcJWk0Htik3J/w,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	peter.wang-NuS5LvNUpcJWk0Htik3J/w,
	wsd_upstream-NuS5LvNUpcJWk0Htik3J/w

> 
> Now uic errors are printed out of time order.
> 
> Simply make it more readable by printing logs
> in time order, and printing "No record" if history
> is empty.
> 
> Signed-off-by: Stanley Chu <stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Reviewed-by: Avri Altman <avri.altman-Sjgp3cTcYWE@public.gmane.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] scsi: ufs: Print uic error history in time order
       [not found] ` <1548684266-8792-1-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  2019-01-29  7:28   ` Avri Altman
@ 2019-02-05  3:04   ` Martin K. Petersen
  1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2019-02-05  3:04 UTC (permalink / raw)
  To: Stanley Chu
  Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	wsd_upstream-NuS5LvNUpcJWk0Htik3J/w,
	kuohong.wang-NuS5LvNUpcJWk0Htik3J/w, avri.altman-Sjgp3cTcYWE,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	peter.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	vinholikatti-Re5JQEeQqe8AvxtiuMwx3w


Stanley,

> Now uic errors are printed out of time order.
>
> Simply make it more readable by printing logs in time order, and
> printing "No record" if history is empty.

Applied to 5.1/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v1 1/1] scsi: ufs: Print uic error history in time order
       [not found] ` <BYAPR08MB4533E3AEBFF64A2ABB33EB45DB900-73df4QikVELese8zA3WVkpNArRD3w/9+vxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-02-03 23:34   ` Stanley Chu
  0 siblings, 0 replies; 5+ messages in thread
From: Stanley Chu @ 2019-02-03 23:34 UTC (permalink / raw)
  To: Bean Huo (beanhuo), martin.petersen-QHcLZuEGTsvQT0dZR+AlfA
  Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	wsd_upstream-NuS5LvNUpcJWk0Htik3J/w,
	kuohong.wang-NuS5LvNUpcJWk0Htik3J/w, avri.altman-Sjgp3cTcYWE,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	peter.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	vinholikatti-Re5JQEeQqe8AvxtiuMwx3w

Hi Martin, 

Would you have any comment ?

Hi Bean and Avri,

Thanks so much for reviewing and testing.

On Wed, 2019-01-30 at 10:19 +0000, Bean Huo (beanhuo) wrote:
> Hi, Stanley
> I tested it on my own platform. This is very useful and thanks.
> 
> >
> >Now uic errors are printed out of time order.
> >
> >Simply make it more readable by printing logs in time order, and printing "No
> >record" if history is empty.
> >
> >Signed-off-by: Stanley Chu <stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> >---
> 
> Reviewed-by: Bean Huo <beanhuo-AL4WhLSQfzjQT0dZR+AlfA@public.gmane.org>
> Tested-by: Bean Huo <beanhuo-AL4WhLSQfzjQT0dZR+AlfA@public.gmane.org>

Thanks.

Stanley

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v1 1/1] scsi: ufs: Print uic error history in time order
@ 2019-01-30 10:19 Bean Huo (beanhuo)
       [not found] ` <BYAPR08MB4533E3AEBFF64A2ABB33EB45DB900-73df4QikVELese8zA3WVkpNArRD3w/9+vxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Bean Huo (beanhuo) @ 2019-01-30 10:19 UTC (permalink / raw)
  To: Stanley Chu, linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	vinholikatti-Re5JQEeQqe8AvxtiuMwx3w
  Cc: wsd_upstream-NuS5LvNUpcJWk0Htik3J/w,
	kuohong.wang-NuS5LvNUpcJWk0Htik3J/w, avri.altman-Sjgp3cTcYWE,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	peter.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w

Hi, Stanley
I tested it on my own platform. This is very useful and thanks.

>
>Now uic errors are printed out of time order.
>
>Simply make it more readable by printing logs in time order, and printing "No
>record" if history is empty.
>
>Signed-off-by: Stanley Chu <stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
>---

Reviewed-by: Bean Huo <beanhuo-AL4WhLSQfzjQT0dZR+AlfA@public.gmane.org>
Tested-by: Bean Huo <beanhuo-AL4WhLSQfzjQT0dZR+AlfA@public.gmane.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-05  3:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-28 14:04 [PATCH v1 1/1] scsi: ufs: Print uic error history in time order Stanley Chu
     [not found] ` <1548684266-8792-1-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2019-01-29  7:28   ` Avri Altman
2019-02-05  3:04   ` Martin K. Petersen
2019-01-30 10:19 Bean Huo (beanhuo)
     [not found] ` <BYAPR08MB4533E3AEBFF64A2ABB33EB45DB900-73df4QikVELese8zA3WVkpNArRD3w/9+vxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-02-03 23:34   ` Stanley Chu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.