linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] scsi: ufs: core: Fix mcq tag calcualtion
@ 2023-02-15 12:37 Po-Wen Kao
  2023-02-15 12:37 ` [PATCH 2/2] scsi: ufs: core: Export symbol ufshcd_mcq_read_cqis() Po-Wen Kao
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Po-Wen Kao @ 2023-02-15 12:37 UTC (permalink / raw)
  To: Alim Akhtar, Avri Altman, Bart Van Assche, James E.J. Bottomley,
	Martin K. Petersen, Matthias Brugger
  Cc: wsd_upstream, peter.wang, stanley.chu, powen.kao, alice.chao,
	chun-hung.wu, cc.chou, chaotian.jing, jiajie.hao, mason.zhang,
	quic_asutoshd, linux-scsi, linux-kernel, linux-arm-kernel,
	linux-mediatek

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@mediatek.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));
 }
 
 static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-21  5:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 12:37 [PATCH 1/2] scsi: ufs: core: Fix mcq tag calcualtion Po-Wen Kao
2023-02-15 12:37 ` [PATCH 2/2] scsi: ufs: core: Export symbol ufshcd_mcq_read_cqis() Po-Wen Kao
2023-02-15 17:52   ` Christoph Hellwig
2023-02-21  4:46     ` Powen Kao (高伯文)
2023-02-15 17:34 ` [PATCH 1/2] scsi: ufs: core: Fix mcq tag calcualtion Bart Van Assche
2023-02-16  0:51 ` Stanley Chu
2023-02-16  7:40 ` Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).