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

Commit 3d46bc93 authored by Bhaumik Bhatt's avatar Bhaumik Bhatt
Browse files

mhi: core: add log buffer for controller bootup and shutdown



Add support in the MHI controller for a dedicated bootup and
shutdown log buffer and fix log message macros.

Change-Id: I6425107b9e2a048b44d8912051486d3aaa2abdac
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 283c2816
Loading
Loading
Loading
Loading
+27 −2
Original line number Diff line number Diff line
@@ -402,6 +402,7 @@ struct mhi_controller {
	bool initiate_mhi_reset;
	void *priv_data;
	void *log_buf;
	void *cntrl_log_buf;
	struct dentry *dentry;
	struct dentry *parent;

@@ -855,7 +856,7 @@ char *mhi_get_restart_reason(const char *name);
#ifdef CONFIG_MHI_DEBUG

#define MHI_VERB(fmt, ...) do { \
		if (mhi_cntrl->klog_lvl <= MHI_MSG_VERBOSE) \
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_VERBOSE) \
			pr_dbg("[D][%s] " fmt, __func__, ##__VA_ARGS__);\
} while (0)

@@ -865,8 +866,18 @@ char *mhi_get_restart_reason(const char *name);

#endif

#define MHI_CNTRL_LOG(fmt, ...) do {	\
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \
			pr_info("[I][%s] " fmt, __func__, ##__VA_ARGS__);\
} while (0)

#define MHI_CNTRL_ERR(fmt, ...) do {	\
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_ERROR) \
			pr_err("[E][%s] " fmt, __func__, ##__VA_ARGS__); \
} while (0)

#define MHI_LOG(fmt, ...) do {	\
		if (mhi_cntrl->klog_lvl <= MHI_MSG_INFO) \
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \
			pr_info("[I][%s] " fmt, __func__, ##__VA_ARGS__);\
} while (0)

@@ -906,6 +917,20 @@ char *mhi_get_restart_reason(const char *name);

#endif

#define MHI_CNTRL_LOG(fmt, ...) do { \
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \
			pr_err("[I][%s] " fmt, __func__, ##__VA_ARGS__);\
		ipc_log_string(mhi_cntrl->cntrl_log_buf, "[I][%s] " fmt, \
			       __func__, ##__VA_ARGS__); \
} while (0)

#define MHI_CNTRL_ERR(fmt, ...) do { \
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_ERROR) \
			pr_err("[E][%s] " fmt, __func__, ##__VA_ARGS__); \
		ipc_log_string(mhi_cntrl->cntrl_log_buf, "[E][%s] " fmt, \
			       __func__, ##__VA_ARGS__); \
} while (0)

#define MHI_LOG(fmt, ...) do {	\
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \
			pr_err("[I][%s] " fmt, __func__, ##__VA_ARGS__);\