Skip to content

Commit a8f9a36

Browse files
Bao D. Nguyenmartinkpetersen
authored andcommitted
scsi: ufs: core: Combine 32-bit command_desc_base_addr_lo/hi
The UTP command descriptor base address is a 57-bit field in the UTP transfer request descriptor. Combine the two 32-bit command_desc_base_addr_lo/hi fields into a 64-bit for better handling of this field. Signed-off-by: Bao D. Nguyen <[email protected]> Link: https://lore.kernel.org/r/4e6f7f5a15000cdae77c3014b477264f57bf572c.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Stanley Chu <[email protected]> Tested-by: Stanley Chu <[email protected]> Reviewed-by: Can Guo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent ac9a786 commit a8f9a36

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3868,10 +3868,8 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba)
38683868
/* Configure UTRD with command descriptor base address */
38693869
cmd_desc_element_addr =
38703870
(cmd_desc_dma_addr + (cmd_desc_size * i));
3871-
utrdlp[i].command_desc_base_addr_lo =
3872-
cpu_to_le32(lower_32_bits(cmd_desc_element_addr));
3873-
utrdlp[i].command_desc_base_addr_hi =
3874-
cpu_to_le32(upper_32_bits(cmd_desc_element_addr));
3871+
utrdlp[i].command_desc_base_addr =
3872+
cpu_to_le64(cmd_desc_element_addr);
38753873

38763874
/* Response upiu and prdt offset should be in double words */
38773875
if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN) {

include/ufs/ufshci.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,7 @@ struct request_desc_header {
503503
/**
504504
* struct utp_transfer_req_desc - UTP Transfer Request Descriptor (UTRD)
505505
* @header: UTRD header DW-0 to DW-3
506-
* @command_desc_base_addr_lo: UCD base address low DW-4
507-
* @command_desc_base_addr_hi: UCD base address high DW-5
506+
* @command_desc_base_addr: UCD base address DW 4-5
508507
* @response_upiu_length: response UPIU length DW-6
509508
* @response_upiu_offset: response UPIU offset DW-6
510509
* @prd_table_length: Physical region descriptor length DW-7
@@ -516,8 +515,7 @@ struct utp_transfer_req_desc {
516515
struct request_desc_header header;
517516

518517
/* DW 4-5*/
519-
__le32 command_desc_base_addr_lo;
520-
__le32 command_desc_base_addr_hi;
518+
__le64 command_desc_base_addr;
521519

522520
/* DW 6 */
523521
__le16 response_upiu_length;

0 commit comments

Comments
 (0)