lkml.org 
[lkml]   [2022]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 13/16] ufs: mcq: Add completion support of a cqe
From
On 9/22/22 18:05, Asutosh Das wrote:
> +static int ufshcd_mcq_get_tag(struct ufs_hba *hba,
> + struct ufs_hw_queue *hwq,
> + struct cq_entry *cqe)
> +{
> + dma_addr_t dma_addr;
> +
> + /* Bits 63:7 UCD base address, 6:5 are reserved, 4:0 is SQ ID */
> + dma_addr = le64_to_cpu(cqe->command_desc_base_addr) & CQE_UCD_BA;
> +
> + return (dma_addr - hba->ucdl_dma_addr) /
> + sizeof(struct utp_transfer_cmd_desc);
> +}

Since the above code only works correctly if the size of struct
utp_transfer_cmd_desc is a multiple of 1 << 7, please add a
BUILD_BUG_ON() statement that verifies that the size of
utp_transfer_cmd_desc is a multiple of 128.

Thanks,

Bart.

\
 
 \ /
  Last update: 2022-09-30 22:42    [W:0.034 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site