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

Commit 4e44e9c4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi_dev: mhi: Add IPC logging to MHI device driver"

parents 53f42d8f 78370137
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -60,7 +60,10 @@
#define HOST_ADDR_LSB(addr)		(addr & 0xFFFFFFFF)
#define HOST_ADDR_LSB(addr)		(addr & 0xFFFFFFFF)
#define HOST_ADDR_MSB(addr)		((addr >> 32) & 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_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 struct mhi_dev *mhi_ctx;
static void mhi_hwc_cb(void *priv, enum ipa_mhi_event_type event,
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;
		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;
	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_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_msg_lvl, "mhi msg lvl");
MODULE_PARM_DESC(mhi_ipc_msg_lvl, "mhi ipc msg lvl");


static int __init mhi_dev_init(void)
static int __init mhi_dev_init(void)
{
{
+7 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@


#include <linux/msm_ep_pcie.h>
#include <linux/msm_ep_pcie.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/ipc_logging.h>


/* MHI control data structures alloted by the host, including
/* MHI control data structures alloted by the host, including
 * channel context array, event context array, command context and rings */
 * 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_msg_lvl;
extern enum mhi_msg_level mhi_ipc_msg_lvl;
extern void *mhi_ipc_log;


#define mhi_log(_msg_lvl, _msg, ...) do { \
#define mhi_log(_msg_lvl, _msg, ...) do { \
	if (_msg_lvl >= mhi_msg_lvl) { \
	if (_msg_lvl >= mhi_msg_lvl) { \
		pr_err("[%s] "_msg, __func__, ##__VA_ARGS__); \
		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)
} while (0)


/* SW channel client list */
/* SW channel client list */