ufs: ufs-qcom: Fix the hwq index reference in vh functions

The hardware queue 0 is no longer a dedicated hardware queue
for dev command since the upstream commit <ccb23dc3435a0>
("scsi: ufs: core: Remove dedicated hwq for dev command").

As a result, in the send_command and compl_command vendor
hook functions, correct the hardware queue index references
so that the correct information is printed to ipc log, and
possibly avoid referencing uninitialized data.

Change-Id: Ib4e0dd9364682719a258227381acd97cec683461
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
This commit is contained in:
Bao D. Nguyen 2023-12-27 14:22:41 -08:00
parent cda4f81b9f
commit 4051256d4d

View File

@ -5521,7 +5521,7 @@ static void ufs_qcom_hook_send_command(void *param, struct ufs_hba *hba,
/* The dev cmd would not be logged in MCQ mode provisionally */
u32 utag = (rq->mq_hctx->queue_num << BLK_MQ_UNIQUE_TAG_BITS) |
(rq->tag & BLK_MQ_UNIQUE_TAG_MASK);
u32 idx = blk_mq_unique_tag_to_hwq(utag) + 1;
u32 idx = blk_mq_unique_tag_to_hwq(utag);
struct ufs_hw_queue *hwq = &hba->uhq[idx];
ufs_qcom_log_str(host, "<,%x,%d,%d,%d\n",
@ -5584,7 +5584,7 @@ static void ufs_qcom_hook_compl_command(void *param, struct ufs_hba *hba,
/* The dev cmd would not be logged in MCQ mode provisionally */
u32 utag = (rq->mq_hctx->queue_num << BLK_MQ_UNIQUE_TAG_BITS) |
(rq->tag & BLK_MQ_UNIQUE_TAG_MASK);
u32 idx = blk_mq_unique_tag_to_hwq(utag) + 1;
u32 idx = blk_mq_unique_tag_to_hwq(utag);
struct ufs_hw_queue *hwq = &hba->uhq[idx];
ufs_qcom_log_str(host, ">,%x,%d,%d,%d\n",