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: Bhaumik Bhatt <bbhatt@codeaurora.org>
This commit is contained in:
Bhaumik Bhatt 2020-03-24 16:57:25 -07:00
commit aa75fcc7cf

View file

@ -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__, \