2020-11-26 22:26:07

by Stanley Chu

[permalink] [raw]
Subject: [PATCH v1 0/3] Refine error history and introduce notify_event vop

Hi,
This series refines error history functions and introduce a new notify_event vop to allow vendor to get notified of important events.

Stanley Chu (3):
scsi: ufs: Add error history for abort event in UFS Device W-LUN
scsi: ufs: Refine error history functions
scsi: ufs: Introduce notify_event variant function

drivers/scsi/ufs/ufshcd.c | 122 ++++++++++++++++++++++----------------
drivers/scsi/ufs/ufshcd.h | 82 ++++++++++++-------------
2 files changed, 112 insertions(+), 92 deletions(-)

--
2.18.0


2020-11-26 22:26:07

by Stanley Chu

[permalink] [raw]
Subject: [PATCH v1 1/3] scsi: ufs: Add error history for abort event in UFS Device W-LUN

Add error history for abort event in UFS Device W-LUN.
Besides, use specified value as parameter of ufshcd_update_reg_hist()
to identify the aborted tag or LUNs.

Signed-off-by: Stanley Chu <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 0e5473d4699b..28e4def13f21 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6742,8 +6742,10 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
* To avoid these unnecessary/illegal step we skip to the last error
* handling stage: reset and restore.
*/
- if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN)
+ if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN) {
+ ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, lrbp->lun);
return ufshcd_eh_host_reset_handler(cmd);
+ }

ufshcd_hold(hba, false);
reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
@@ -6767,7 +6769,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
*/
scsi_print_command(hba->lrb[tag].cmd);
if (!hba->req_abort_count) {
- ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, 0);
+ ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, tag);
ufshcd_print_host_regs(hba);
ufshcd_print_host_state(hba);
ufshcd_print_pwr_info(hba);
--
2.18.0

2020-12-03 05:37:24

by Can Guo

[permalink] [raw]
Subject: Re: [PATCH v1 1/3] scsi: ufs: Add error history for abort event in UFS Device W-LUN

On 2020-11-26 13:38, Stanley Chu wrote:
> Add error history for abort event in UFS Device W-LUN.
> Besides, use specified value as parameter of ufshcd_update_reg_hist()
> to identify the aborted tag or LUNs.
>
> Signed-off-by: Stanley Chu <[email protected]>
> ---
> drivers/scsi/ufs/ufshcd.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 0e5473d4699b..28e4def13f21 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -6742,8 +6742,10 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
> * To avoid these unnecessary/illegal step we skip to the last error
> * handling stage: reset and restore.
> */
> - if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN)
> + if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN) {
> + ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, lrbp->lun);
> return ufshcd_eh_host_reset_handler(cmd);
> + }
>
> ufshcd_hold(hba, false);
> reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
> @@ -6767,7 +6769,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
> */
> scsi_print_command(hba->lrb[tag].cmd);
> if (!hba->req_abort_count) {
> - ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, 0);
> + ufshcd_update_reg_hist(&hba->ufs_stats.task_abort, tag);
> ufshcd_print_host_regs(hba);
> ufshcd_print_host_state(hba);
> ufshcd_print_pwr_info(hba);

Reviewed-by: Can Guo <[email protected]>

2020-12-05 02:50:13

by Asutosh Das (asd)

[permalink] [raw]
Subject: Re: [PATCH v1 0/3] Refine error history and introduce notify_event vop

On 11/25/2020 9:38 PM, Stanley Chu wrote:
> Hi,
> This series refines error history functions and introduce a new notify_event vop to allow vendor to get notified of important events.
>
> Stanley Chu (3):
> scsi: ufs: Add error history for abort event in UFS Device W-LUN
> scsi: ufs: Refine error history functions
> scsi: ufs: Introduce notify_event variant function
>
> drivers/scsi/ufs/ufshcd.c | 122 ++++++++++++++++++++++----------------
> drivers/scsi/ufs/ufshcd.h | 82 ++++++++++++-------------
> 2 files changed, 112 insertions(+), 92 deletions(-)
>

Hi Stanley,

Reviewed-by: Asutosh Das <[email protected]>

Please add to the series.


--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project