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

Commit aa75fcc7 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 0ea391ba
Loading
Loading
Loading
Loading
+31 −2
Original line number Diff line number Diff line
@@ -411,6 +411,7 @@ struct mhi_controller {
	bool initiate_mhi_reset;
	void *priv_data;
	void *log_buf;
	void *cntrl_log_buf;
	struct dentry *dentry;
	struct dentry *parent;

@@ -905,7 +906,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)

@@ -915,8 +916,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) \
			printk("%s[I][%s] " fmt, KERN_INFO, __func__, \
					##__VA_ARGS__); \
} while (0)

#define MHI_CNTRL_ERR(fmt, ...) do {	\
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_ERROR) \
			printk("%s[E][%s] " fmt, KERN_ERR, __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) \
			printk("%s[I][%s] " fmt, KERN_INFO, __func__, \
					##__VA_ARGS__); \
} while (0)
@@ -958,6 +971,22 @@ char *mhi_get_restart_reason(const char *name);

#endif

#define MHI_CNTRL_LOG(fmt, ...) do { \
		if (mhi_cntrl->klog_lvl <= MHI_MSG_LVL_INFO) \
			printk("%s[I][%s] " fmt, KERN_ERR, __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) \
			printk("%s[E][%s] " fmt, KERN_ERR, __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) \
			printk("%s[I][%s] " fmt, KERN_ERR, __func__, \