cnss2: add support for controller IPC logs

Controller IPC logs support bootup and shutdown logs which can
help in easier debug.

Change-Id: I10e37641559473a14a7ebab65562ffcfb9d95ab6
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
This commit is contained in:
Bhaumik Bhatt 2020-03-25 13:19:22 -07:00
commit 7b037a401a

View file

@ -4402,6 +4402,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);
@ -4419,6 +4424,8 @@ unreg_mhi:
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);
@ -4433,6 +4440,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);
}