]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ufs: fix empty check of error history
authorStanley Chu <stanley.chu@mediatek.com>
Sat, 4 Jan 2020 14:26:06 +0000 (22:26 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 16 Jan 2020 02:59:44 +0000 (21:59 -0500)
commit2f30b1dc17e63df7184e1129a299da0a6073d45f
treefd45b04cb63d5ee06e7ccf9cb42ae3a40d539336
parentd004efc3426d7eede506e5ef2897650ca0de0442
scsi: ufs: fix empty check of error history

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>
Link: https://lore.kernel.org/r/1578147968-30938-2-git-send-email-stanley.chu@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c