diff mbox series

[2/2] scsi: ufs: core: Add a trace function calling when uic command error occurs

Message ID 20250417023405.6954-3-dh0421.hwang@samsung.com
State New
Headers show
Series scsi: ufs: Add an enum for ufs_trace_str_t to check uic cmd error | expand

Commit Message

DooHyun Hwang April 17, 2025, 2:34 a.m. UTC
When a uic command error occurs, there is no trace function calling.
Therefore, trace function calls are added when a uic command error happens.

Signed-off-by: DooHyun Hwang <dh0421.hwang@samsung.com>
---
 drivers/ufs/core/ufshcd.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index ab98acd982b5..baac1ae94efc 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -2534,6 +2534,9 @@  ufshcd_wait_for_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
 	hba->active_uic_cmd = NULL;
 	spin_unlock_irqrestore(hba->host->host_lock, flags);
 
+	if (ret)
+		ufshcd_add_uic_command_trace(hba, uic_cmd, UFS_CMD_ERR);
+
 	return ret;
 }
 
@@ -4306,6 +4309,8 @@  static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
 	}
 out:
 	if (ret) {
+		ufshcd_add_uic_command_trace(hba, hba->active_uic_cmd,
+					     UFS_CMD_ERR);
 		ufshcd_print_host_state(hba);
 		ufshcd_print_pwr_info(hba);
 		ufshcd_print_evt_hist(hba);