diff options
author | Ziqi Chen <quic_ziqichen@quicinc.com> | 2023-03-15 10:44:25 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-03-17 06:16:18 +0300 |
commit | 4a52338bf288c95a46f20af1f5df77b80b74c9ad (patch) | |
tree | 943635f84acb27f1869cccb67dec93365a9c8ff3 /drivers/ufs | |
parent | 127fd07da459379d39d5a048afbd3e51d00f3f60 (diff) | |
download | linux-4a52338bf288c95a46f20af1f5df77b80b74c9ad.tar.xz |
scsi: ufs: core: Add trace event for MCQ
Add MCQ hardware queue ID in the existing trace event ufshcd_command().
Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com>
Link: https://lore.kernel.org/r/1678866271-49601-1-git-send-email-quic_ziqichen@quicinc.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs')
-rw-r--r-- | drivers/ufs/core/ufshcd.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index b960b516c4ae..8e7dfaadc691 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -422,7 +422,9 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, { u64 lba = 0; u8 opcode = 0, group_id = 0; - u32 intr, doorbell; + u32 doorbell = 0; + u32 intr; + int hwq_id = -1; struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct scsi_cmnd *cmd = lrbp->cmd; struct request *rq = scsi_cmd_to_rq(cmd); @@ -456,9 +458,16 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, } intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS); - doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); + + if (is_mcq_enabled(hba)) { + struct ufs_hw_queue *hwq = ufshcd_mcq_req_to_hwq(hba, rq); + + hwq_id = hwq->id; + } else { + doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); + } trace_ufshcd_command(dev_name(hba->dev), str_t, tag, - doorbell, transfer_len, intr, lba, opcode, group_id); + doorbell, hwq_id, transfer_len, intr, lba, opcode, group_id); } static void ufshcd_print_clk_freqs(struct ufs_hba *hba) |