Merge "mhi_dev: mhi: Add IPC logging to MHI device driver"
This commit is contained in:
commit
cfa0aa937c
|
@ -60,7 +60,10 @@
|
|||
#define HOST_ADDR_LSB(addr) (addr & 0xFFFFFFFF)
|
||||
#define HOST_ADDR_MSB(addr) ((addr >> 32) & 0xFFFFFFFF)
|
||||
|
||||
#define MHI_IPC_LOG_PAGES (100)
|
||||
enum mhi_msg_level mhi_msg_lvl = MHI_MSG_ERROR;
|
||||
enum mhi_msg_level mhi_ipc_msg_lvl = MHI_MSG_VERBOSE;
|
||||
void *mhi_ipc_log;
|
||||
|
||||
static struct mhi_dev *mhi_ctx;
|
||||
static void mhi_hwc_cb(void *priv, enum ipa_mhi_event_type event,
|
||||
|
@ -1822,6 +1825,13 @@ static int mhi_init(struct mhi_dev *mhi)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
mhi_ipc_log = ipc_log_context_create(MHI_IPC_LOG_PAGES, "mhi");
|
||||
|
||||
if (mhi_ipc_log == NULL) {
|
||||
dev_err(&pdev->dev,
|
||||
"Failed to create IPC logging context\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1880,7 +1890,10 @@ static struct platform_driver mhi_dev_driver = {
|
|||
};
|
||||
|
||||
module_param(mhi_msg_lvl , uint, S_IRUGO | S_IWUSR);
|
||||
module_param(mhi_ipc_msg_lvl, uint, S_IRUGO | S_IWUSR);
|
||||
|
||||
MODULE_PARM_DESC(mhi_msg_lvl, "mhi msg lvl");
|
||||
MODULE_PARM_DESC(mhi_ipc_msg_lvl, "mhi ipc msg lvl");
|
||||
|
||||
static int __init mhi_dev_init(void)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <linux/msm_ep_pcie.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/ipc_logging.h>
|
||||
|
||||
/* MHI control data structures alloted by the host, including
|
||||
* channel context array, event context array, command context and rings */
|
||||
|
@ -513,11 +514,17 @@ enum mhi_msg_level {
|
|||
};
|
||||
|
||||
extern enum mhi_msg_level mhi_msg_lvl;
|
||||
extern enum mhi_msg_level mhi_ipc_msg_lvl;
|
||||
extern void *mhi_ipc_log;
|
||||
|
||||
#define mhi_log(_msg_lvl, _msg, ...) do { \
|
||||
if (_msg_lvl >= mhi_msg_lvl) { \
|
||||
pr_err("[%s] "_msg, __func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
if (mhi_ipc_log && (_msg_lvl >= mhi_ipc_msg_lvl)) { \
|
||||
ipc_log_string(mhi_ipc_log, \
|
||||
"[%s] " _msg, __func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* SW channel client list */
|
||||
|
|
Loading…
Reference in New Issue