From: <liuderong@oppo.com>
To: <alim.akhtar@samsung.com>, <avri.altman@wdc.com>, <bvanassche@acm.org>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
liuderong <liuderong@oppo.com>
Subject: [PATCH] scsi:ufs:core: Add trace READ(16)/WRITE(16) commands
Date: Wed, 25 Sep 2024 10:48:43 +0800 [thread overview]
Message-ID: <1727232523-188866-1-git-send-email-liuderong@oppo.com> (raw)
From: liuderong <liuderong@oppo.com>
For sd_zbc_read_zones, READ(16)/WRITE(16) are mandatory for ZBC disks.
Currently, when printing the trace:ufshcd_command on zone UFS devices,
the LBA and SIZE fields appear invalid,
making it difficult to trace commands.
So add trace READ(16)/WRITE(16) commands for zone ufs device.
Trace sample:
ufshcd_command: send_req: 1d84000.ufshc: tag: 31, DB: 0x0,
size: -1, IS: 0, LBA: 0, opcode: 0x8a (WRITE_16), group_id: 0x0, hwq_id: 7
ufshcd_command: complete_rsp: 1d84000.ufshc: tag: 31, DB: 0x0,
size: -1, IS: 0, LBA: 0, opcode: 0x8a (WRITE_16), group_id: 0x0, hwq_id: 7
Signed-off-by: liuderong <liuderong@oppo.com>
---
drivers/ufs/core/ufshcd.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 5e3c67e..9e5e903 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -434,15 +434,19 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
opcode = cmd->cmnd[0];
- if (opcode == READ_10 || opcode == WRITE_10) {
+ if (opcode == READ_10 || opcode == READ_16 ||
+ opcode == WRITE_10 || opcode == WRITE_16) {
/*
- * Currently we only fully trace read(10) and write(10) commands
+ * Currently we only fully trace the following commands,
+ * read(10),read(16),write(10), and write(16)
*/
transfer_len =
be32_to_cpu(lrbp->ucd_req_ptr->sc.exp_data_transfer_len);
lba = scsi_get_lba(cmd);
if (opcode == WRITE_10)
group_id = lrbp->cmd->cmnd[6];
+ if (opcode == WRITE_16)
+ group_id = lrbp->cmd->cmnd[14];
} else if (opcode == UNMAP) {
/*
* The number of Bytes to be unmapped beginning with the lba.
--
2.7.4
next reply other threads:[~2024-09-25 2:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 2:48 liuderong [this message]
2024-09-25 16:34 ` Bart Van Assche
2024-09-27 2:15 ` liuderong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1727232523-188866-1-git-send-email-liuderong@oppo.com \
--to=liuderong@oppo.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®