[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGaU9a8mSx1Da5rnXDm9pc-yc8BQOrjc5KMXjotcaDdKDTXwuQ@mail.gmail.com>
Date: Tue, 2 May 2023 15:35:25 +0800
From: Stanley Chu <chu.stanley@...il.com>
To: Po-Wen Kao <powen.kao@...iatek.com>
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
Bart Van Assche <bvanassche@....org>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
wsd_upstream@...iatek.com, peter.wang@...iatek.com,
stanley.chu@...iatek.com, alice.chao@...iatek.com,
naomi.chu@...iatek.com, chun-hung.wu@...iatek.com,
cc.chou@...iatek.com, eddie.huang@...iatek.com,
mason.zhang@...iatek.com, chaotian.jing@...iatek.com,
jiajie.hao@...iatek.com
Subject: Re: [PATCH v5 1/3] scsi: ufs: core: Fix mcq tag calcualtion
Hi Po-Wen,
Po-Wen Kao <powen.kao@...iatek.com> 於 2023年4月24日 週一 下午10:13寫道:
>
> Transfer command descriptor is allocated in ufshcd_memory_alloc()
> and referenced by transfer request descriptor with stride size
> sizeof_utp_transfer_cmd_desc()
> instead of
> sizeof(struct utp_transfer_cmd_desc).
>
> Consequently, computing tag by address offset should also refer to the
> same stride.
>
> Signed-off-by: Po-Wen Kao <powen.kao@...iatek.com>
> Reviewed-by: Bart Van Assche <bvanassche@....org>
> Reviewed-by: Manivannan Sadhasivam <mani@...nel.org>
> Reviewed-by: Stanley Chu <stanley.chu@...iatek.com>
> Reviewed-by: Ziqi Chen <quic_ziqichen@...cinc.com>
> ---
> drivers/ufs/core/ufs-mcq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
> index 31df052fbc41..3a27fa4b0024 100644
> --- a/drivers/ufs/core/ufs-mcq.c
> +++ b/drivers/ufs/core/ufs-mcq.c
> @@ -265,7 +265,7 @@ static int ufshcd_mcq_get_tag(struct ufs_hba *hba,
> addr = (le64_to_cpu(cqe->command_desc_base_addr) & CQE_UCD_BA) -
> hba->ucdl_dma_addr;
>
> - return div_u64(addr, sizeof(struct utp_transfer_cmd_desc));
> + return div_u64(addr, sizeof_utp_transfer_cmd_desc(hba));
Would you also need to consider the ufshcd_release_sdb_queue() case?
Thanks.
Stanley Chu
Powered by blists - more mailing lists