From: asutoshd@codeaurora.org
To: Stanley Chu <stanley.chu@mediatek.com>
Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
avri.altman@wdc.com, alim.akhtar@samsung.com, jejb@linux.ibm.com,
beanhuo@micron.com, cang@codeaurora.org, matthias.bgg@gmail.com,
bvanassche@acm.org, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kuohong.wang@mediatek.com,
peter.wang@mediatek.com, chun-hung.wu@mediatek.com,
andy.teng@mediatek.com, linux-scsi-owner@vger.kernel.org
Subject: Re: [PATCH v1 1/3] scsi: ufs: fix empty check of error history
Date: Mon, 06 Jan 2020 09:34:05 -0800 [thread overview]
Message-ID: <926596b3823333bd8d31aed8630509de@codeaurora.org> (raw)
In-Reply-To: <1578147968-30938-2-git-send-email-stanley.chu@mediatek.com>
On 2020-01-04 06:26, Stanley Chu wrote:
> Currently checking if an error history element is empty or
> not is by its "value". In most cases, value is error code.
>
> However this checking is not correct because some errors or
> events do not specify any values in error history so values
> remain as 0, and this will lead to incorrect empty checking.
>
> Fix it by checking "timestamp" instead of "value" because
> timestamp will be always assigned for all history elements
>
> Cc: Alim Akhtar <alim.akhtar@samsung.com>
> Cc: Asutosh Das <asutoshd@codeaurora.org>
> Cc: Avri Altman <avri.altman@wdc.com>
> Cc: Bart Van Assche <bvanassche@acm.org>
> Cc: Bean Huo <beanhuo@micron.com>
> Cc: Can Guo <cang@codeaurora.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
> drivers/scsi/ufs/ufshcd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 1b97f2dc0b63..bae43da00bb6 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -385,7 +385,7 @@ static void ufshcd_print_err_hist(struct ufs_hba
> *hba,
> for (i = 0; i < UFS_ERR_REG_HIST_LENGTH; i++) {
> int p = (i + err_hist->pos) % UFS_ERR_REG_HIST_LENGTH;
>
> - if (err_hist->reg[p] == 0)
> + if (err_hist->tstamp[p] == 0)
> continue;
> dev_err(hba->dev, "%s[%d] = 0x%x at %lld us\n", err_name, p,
> err_hist->reg[p], ktime_to_us(err_hist->tstamp[p]));
Looks good to me.
Reviewed by:- Asutosh Das <asutoshd@codeaurora.org>
next prev parent reply other threads:[~2020-01-06 17:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-04 14:26 [PATCH v1 0/3] scsi: ufs: fix error history and complete device reset history Stanley Chu
2020-01-04 14:26 ` [PATCH v1 1/3] scsi: ufs: fix empty check of error history Stanley Chu
2020-01-06 17:34 ` asutoshd [this message]
2020-01-13 9:28 ` [EXT] " Bean Huo (beanhuo)
2020-01-13 9:43 ` Stanley Chu
2020-01-13 9:58 ` Bean Huo (beanhuo)
2020-01-04 14:26 ` [PATCH v1 2/3] scsi: ufs: add device reset history for vendor implementations Stanley Chu
2020-01-13 10:03 ` [EXT] " Bean Huo (beanhuo)
2020-01-13 18:59 ` asutoshd
2020-01-04 14:26 ` [PATCH v1 3/3] scsi: ufs: remove "errors" word in ufshcd_print_err_hist() Stanley Chu
2020-01-13 10:05 ` [EXT] " Bean Huo (beanhuo)
2020-01-11 7:17 ` [PATCH v1 0/3] scsi: ufs: fix error history and complete device reset history Stanley Chu
2020-01-16 3:00 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=926596b3823333bd8d31aed8630509de@codeaurora.org \
--to=asutoshd@codeaurora.org \
--cc=alim.akhtar@samsung.com \
--cc=andy.teng@mediatek.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=chun-hung.wu@mediatek.com \
--cc=jejb@linux.ibm.com \
--cc=kuohong.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi-owner@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=peter.wang@mediatek.com \
--cc=stanley.chu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).