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

Commit ca8e02c4 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss2: add support for controller IPC logs"

parents bd807a2a 6d0808c2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4109,6 +4109,11 @@ static int cnss_pci_register_mhi(struct cnss_pci_data *pci_priv)
	if (!mhi_ctrl->log_buf)
		cnss_pr_err("Unable to create CNSS MHI IPC log context\n");

	mhi_ctrl->cntrl_log_buf = ipc_log_context_create(CNSS_IPC_LOG_PAGES,
							 "cnss-mhi-cntrl", 0);
	if (!mhi_ctrl->cntrl_log_buf)
		cnss_pr_err("Unable to create CNSS MHICNTRL IPC log context\n");

	ret = of_register_mhi_controller(mhi_ctrl);
	if (ret) {
		cnss_pr_err("Failed to register to MHI bus, err = %d\n", ret);
@@ -4126,6 +4131,8 @@ static int cnss_pci_register_mhi(struct cnss_pci_data *pci_priv)
destroy_ipc:
	if (mhi_ctrl->log_buf)
		ipc_log_context_destroy(mhi_ctrl->log_buf);
	if (mhi_ctrl->cntrl_log_buf)
		ipc_log_context_destroy(mhi_ctrl->cntrl_log_buf);
	kfree(mhi_ctrl->irq);
free_mhi_ctrl:
	mhi_free_controller(mhi_ctrl);
@@ -4140,6 +4147,8 @@ static void cnss_pci_unregister_mhi(struct cnss_pci_data *pci_priv)
	mhi_unregister_mhi_controller(mhi_ctrl);
	if (mhi_ctrl->log_buf)
		ipc_log_context_destroy(mhi_ctrl->log_buf);
	if (mhi_ctrl->cntrl_log_buf)
		ipc_log_context_destroy(mhi_ctrl->cntrl_log_buf);
	kfree(mhi_ctrl->irq);
	mhi_free_controller(mhi_ctrl);
}
+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__);\