diff mbox series

ufs: Use 'TASK_TAG' to construct the ucd_req_ptr->header.dword_0

Message ID 20230702190912.2559956-1-bhupesh.sharma@linaro.org
State Accepted
Commit 820801eacccd1b6913b101ffb2f518aa1bc24fdf
Headers show
Series ufs: Use 'TASK_TAG' to construct the ucd_req_ptr->header.dword_0 | expand

Commit Message

Bhupesh Sharma July 2, 2023, 7:09 p.m. UTC
Instead of using the hard-coded value of 0x1f, use 'TASK_TAG'
macro instead to construct the ucd_req_ptr->header.dword_0

This is in sync with what the Linux UFS driver does, i.e.
set the byte0 equal to TASK_TAG (see [1]).

Setting it to a fixed value of 0x1f is wrong as we define
TASK_TAG as 0 inside u-boot ufs framework. So, instead we
should  use the macro value directly.

[1]. https://github.com/torvalds/linux/blob/master/drivers/ufs/core/ufshcd.c#L2705

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 drivers/ufs/ufs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini July 15, 2023, 3:03 p.m. UTC | #1
On Mon, Jul 03, 2023 at 12:39:12AM +0530, Bhupesh Sharma wrote:
> Instead of using the hard-coded value of 0x1f, use 'TASK_TAG'
> macro instead to construct the ucd_req_ptr->header.dword_0
> 
> This is in sync with what the Linux UFS driver does, i.e.
> set the byte0 equal to TASK_TAG (see [1]).
> 
> Setting it to a fixed value of 0x1f is wrong as we define
> TASK_TAG as 0 inside u-boot ufs framework. So, instead we
> should  use the macro value directly.
> 
> [1]. https://github.com/torvalds/linux/blob/master/drivers/ufs/core/ufshcd.c#L2705
> 

> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c
index 8dd29edd3d..3bf1a95e7f 100644
--- a/drivers/ufs/ufs.c
+++ b/drivers/ufs/ufs.c
@@ -775,7 +775,7 @@  static inline void ufshcd_prepare_utp_nop_upiu(struct ufs_hba *hba)
 
 	/* command descriptor fields */
 	ucd_req_ptr->header.dword_0 =
-			UPIU_HEADER_DWORD(UPIU_TRANSACTION_NOP_OUT, 0, 0, 0x1f);
+			UPIU_HEADER_DWORD(UPIU_TRANSACTION_NOP_OUT, 0, 0, TASK_TAG);
 	/* clear rest of the fields of basic header */
 	ucd_req_ptr->header.dword_1 = 0;
 	ucd_req_ptr->header.dword_2 = 0;