Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6411ebb authored by Can Guo's avatar Can Guo
Browse files

scsi: ufs: update ufs command logging infrastructure



This change increases the max command logging capability.
It also adds cmd log print if pwr ctrl failure detected.
Finally, it changes function name ufshcd_cmd_log_print to
ufshchd_print_cmd_log to align with the naming of other
ufshcd debug print functions.

Change-Id: Ia407b239a0e231c353cccf7e6acf87a5f73d7bd8
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent 1fd6e206
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ static inline void ufshcd_remove_non_printable(char *val)
		*val = ' ';
}

#define UFSHCD_MAX_CMD_LOGGING	100
#define UFSHCD_MAX_CMD_LOGGING	200

#ifdef CONFIG_TRACEPOINTS
static inline void ufshcd_add_command_trace(struct ufs_hba *hba,
@@ -608,7 +608,7 @@ static void ufshcd_dme_cmd_log(struct ufs_hba *hba, char *str, u8 cmd_id)
	ufshcd_cmd_log(hba, str, "dme", 0xff, cmd_id, 0xff);
}

static void ufshcd_cmd_log_print(struct ufs_hba *hba)
static void ufshcd_print_cmd_log(struct ufs_hba *hba)
{
	int i;
	int pos;
@@ -657,7 +657,7 @@ static void ufshcd_dme_cmd_log(struct ufs_hba *hba, char *str, u8 cmd_id)
{
}

static void ufshcd_cmd_log_print(struct ufs_hba *hba)
static void ufshcd_print_cmd_log(struct ufs_hba *hba)
{
}
#endif
@@ -4303,6 +4303,7 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
		ufshcd_print_host_state(hba);
		ufshcd_print_pwr_info(hba);
		ufshcd_print_host_regs(hba);
		ufshcd_print_cmd_log(hba);
	}

	ufshcd_save_tstamp_of_last_dme_cmd(hba);
@@ -6150,7 +6151,7 @@ static void ufshcd_err_handler(struct work_struct *work)
			ufshcd_print_host_state(hba);
			ufshcd_print_pwr_info(hba);
			ufshcd_print_tmrs(hba, hba->outstanding_tasks);
			ufshcd_cmd_log_print(hba);
			ufshcd_print_cmd_log(hba);
			spin_lock_irqsave(hba->host->host_lock, flags);
		}
	}
@@ -6662,7 +6663,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
	hba = shost_priv(host);
	tag = cmd->request->tag;

	ufshcd_cmd_log_print(hba);
	ufshcd_print_cmd_log(hba);
	lrbp = &hba->lrb[tag];
	err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp);
	if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) {