[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d0ce6b32-04ac-e3bc-d999-6a9c3d757645@acm.org>
Date: Fri, 30 Sep 2022 13:41:31 -0700
From: Bart Van Assche <bvanassche@....org>
To: Asutosh Das <quic_asutoshd@...cinc.com>, mani@...nel.org,
quic_nguyenb@...cinc.com, quic_xiaosenh@...cinc.com,
quic_cang@...cinc.com, quic_nitirawa@...cinc.com,
quic_rampraka@...cinc.com, quic_richardp@...cinc.com,
stanley.chu@...iatek.com, adrian.hunter@...el.com,
avri.altman@....com, beanhuo@...ron.com, martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, Alim Akhtar <alim.akhtar@...sung.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Kiwoong Kim <kwmad.kim@...sung.com>,
open list <linux-kernel@...r.kernel.org>,
"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v1 13/16] ufs: mcq: Add completion support of a cqe
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.
Powered by blists - more mailing lists