From: Bart Van Assche <bvanassche@acm.org>
To: "Peter Wang (王信友)" <peter.wang@mediatek.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"beanhuo@micron.com" <beanhuo@micron.com>,
"can.guo@oss.qualcomm.com" <can.guo@oss.qualcomm.com>,
"avri.altman@sandisk.com" <avri.altman@sandisk.com>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>,
"adrian.hunter@intel.com" <adrian.hunter@intel.com>
Subject: Re: [PATCH 3/3] ufs: core: Optimize ufshcd_add_uic_command_trace()
Date: Wed, 22 Apr 2026 09:30:30 -0700 [thread overview]
Message-ID: <3c5f2db7-9190-4aa3-b69b-c9dca8a2998f@acm.org> (raw)
In-Reply-To: <24b3f4f1e6d723c6d0aa5a559fcb142b32e0c9be.camel@mediatek.com>
On 4/22/26 12:52 AM, Peter Wang (王信友) wrote:
> Yes, you are right! In general cases, this is true.
> But for some error cases, we need this trace debug log to check
> if the hardware is working as the software expects.
> Maybe the hardware is stuck or something like that.
> Therefore, we still need to read the register values from
> the hardware.
Hi Peter,
I have started testing the patch below. This patch is intended as a
replacement for patch 3/3 in this series:
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index a44ef7e97125..76416ee88b25 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -460,20 +460,19 @@ static void ufshcd_add_uic_command_trace(struct
ufs_hba *hba,
const struct uic_command *ucmd,
enum ufs_trace_str_t str_t)
{
- u32 cmd;
-
if (!trace_ufshcd_uic_command_enabled())
return;
if (str_t == UFS_CMD_SEND)
- cmd = ucmd->command;
+ trace_ufshcd_uic_command(hba, str_t, ucmd->command,
+ ucmd->argument1, ucmd->argument2,
+ ucmd->argument3);
else
- cmd = ufshcd_readl(hba, REG_UIC_COMMAND);
-
- trace_ufshcd_uic_command(hba, str_t, cmd,
- ufshcd_readl(hba, REG_UIC_COMMAND_ARG_1),
- ufshcd_readl(hba, REG_UIC_COMMAND_ARG_2),
- ufshcd_readl(hba, REG_UIC_COMMAND_ARG_3));
+ trace_ufshcd_uic_command(
+ hba, str_t, ufshcd_readl(hba, REG_UIC_COMMAND),
+ ufshcd_readl(hba, REG_UIC_COMMAND_ARG_1),
+ ufshcd_readl(hba, REG_UIC_COMMAND_ARG_2),
+ ufshcd_readl(hba, REG_UIC_COMMAND_ARG_3));
}
static void ufshcd_add_command_trace(struct ufs_hba *hba, struct
scsi_cmnd *cmd,
next prev parent reply other threads:[~2026-04-22 16:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 21:30 [PATCH 0/3] ufs: core: Optimize the UIC command implementation Bart Van Assche
2026-04-17 21:30 ` [PATCH 1/3] ufs: core: Inline two functions related to UIC commands Bart Van Assche
2026-04-21 8:41 ` Peter Wang (王信友)
2026-04-17 21:30 ` [PATCH 2/3] ufs: core: Complain if UIC argument 2 is invalid Bart Van Assche
2026-04-21 8:42 ` Peter Wang (王信友)
2026-04-17 21:30 ` [PATCH 3/3] ufs: core: Optimize ufshcd_add_uic_command_trace() Bart Van Assche
2026-04-21 8:45 ` Peter Wang (王信友)
2026-04-21 19:37 ` Bart Van Assche
2026-04-22 7:52 ` Peter Wang (王信友)
2026-04-22 16:30 ` Bart Van Assche [this message]
2026-04-23 8:08 ` Peter Wang (王信友)
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=3c5f2db7-9190-4aa3-b69b-c9dca8a2998f@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=adrian.hunter@intel.com \
--cc=avri.altman@sandisk.com \
--cc=beanhuo@micron.com \
--cc=can.guo@oss.qualcomm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@mediatek.com \
/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