diff mbox series

[v1,3/3] scsi: ufs: Use UPIU query trace in devman_upiu_cmd

Message ID 20210523211409.210304-4-huobean@gmail.com
State Superseded
Headers show
Series [v1,1/3] scsi: ufs: Let UPIU completion trace print RSP UPIU | expand

Commit Message

Bean Huo May 23, 2021, 9:14 p.m. UTC
From: Bean Huo <beanhuo@micron.com>

Since devman_upiu_cmd is not COMMAND UPIU, and doesn't have
CDB, it is better to use UPIU query trace, which provides more
helpful information for issue shooting.

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/scsi/ufs/ufshcd.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Bart Van Assche May 24, 2021, 1:32 a.m. UTC | #1
On 5/23/21 2:14 PM, Bean Huo wrote:
> +	ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP,

> +				    (struct utp_upiu_req *)lrbp->ucd_rsp_ptr);


Why is there a cast in the above code from a response pointer to a
request pointer type?

Thanks,

Bart.
Bean Huo May 25, 2021, 8:04 p.m. UTC | #2
On Sun, 2021-05-23 at 18:32 -0700, Bart Van Assche wrote:
> On 5/23/21 2:14 PM, Bean Huo wrote:

> 

> > +     ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR :

> > UFS_QUERY_COMP,

> > +                                 (struct utp_upiu_req *)lrbp-

> > >ucd_rsp_ptr);

> 

> 

> Why is there a cast in the above code from a response pointer to a

> 

> request pointer type?

> 

> 


Ok, I think it is the same question as one in patch 1/3.

> 

> Thanks,

> 

> 

> 

> Bart.
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index ed9059b3e63d..e8756a4fb972 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6697,6 +6697,7 @@  static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
 
 	hba->dev_cmd.complete = &wait;
 
+	ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr);
 	/* Make sure descriptors are ready before ringing the doorbell */
 	wmb();
 	spin_lock_irqsave(hba->host->host_lock, flags);
@@ -6729,6 +6730,9 @@  static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
 		}
 	}
 
+	ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP,
+				    (struct utp_upiu_req *)lrbp->ucd_rsp_ptr);
+
 out:
 	blk_put_request(req);
 out_unlock: