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

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

Merge "mhi: core: Enable ftrace events in MHI"

parents c11aba75 fd8c19f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,3 +10,4 @@ obj-y += mhi_sys.o
obj-y += mhi_bhi.o
obj-y += mhi_pm.o
obj-y += mhi_ssr.o
CFLAGS_mhi_iface.o := -I$(src)
+4 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
 * GNU General Public License for more details.
 */


#include <linux/pci.h>
#include <linux/gpio.h>
#include <linux/module.h>
@@ -18,6 +19,9 @@
#include <linux/delay.h>
#include <linux/debugfs.h>

#define CREATE_TRACE_POINTS
#include "mhi_trace.h"

#include "mhi_sys.h"
#include "mhi.h"
#include "mhi_macros.h"
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/interrupt.h>

#include "mhi_sys.h"
#include "mhi_trace.h"


irqreturn_t mhi_msi_handlr(int irq_number, void *dev_id)
@@ -30,6 +31,7 @@ irqreturn_t mhi_msi_handlr(int irq_number, void *dev_id)
	mhi_dev_ctxt->msi_counter[IRQ_TO_MSI(mhi_dev_ctxt, irq_number)]++;
	mhi_log(MHI_MSG_VERBOSE,
		"Got MSI 0x%x\n", IRQ_TO_MSI(mhi_dev_ctxt, irq_number));
	trace_mhi_msi(IRQ_TO_MSI(mhi_dev_ctxt, irq_number));
	switch (IRQ_TO_MSI(mhi_dev_ctxt, irq_number)) {
	case 0:
	case 1:
+14 −6
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include "mhi.h"
#include "mhi_hwio.h"
#include "mhi_macros.h"
#include "mhi_trace.h"

static void mhi_write_db(struct mhi_device_ctxt *mhi_dev_ctxt,
		  void __iomem *io_addr_lower,
@@ -585,6 +586,7 @@ enum MHI_STATUS mhi_queue_xfer(struct mhi_client_handle *client_handle,
	pkt_loc = mhi_dev_ctxt->mhi_local_chan_ctxt[chan].wp;
	pkt_loc->data_tx_pkt.buffer_ptr = buf;
	pkt_loc->type.info = mhi_flags;
	trace_mhi_tre(pkt_loc, chan, 0);

	if (likely(0 != client_handle->intmod_t))
		MHI_TRB_SET_INFO(TX_TRB_BEI, pkt_loc, 1);
@@ -632,17 +634,19 @@ enum MHI_STATUS mhi_send_cmd(struct mhi_device_ctxt *mhi_dev_ctxt,
	enum MHI_PKT_TYPE ring_el_type = MHI_PKT_TYPE_NOOP_CMD;
	struct mutex *chan_mutex = NULL;

	if (chan >= MHI_MAX_CHANNELS ||
		cmd >= MHI_COMMAND_MAX_NR || mhi_dev_ctxt == NULL) {
		mhi_log(MHI_MSG_ERROR,
			"Invalid channel id, received id: 0x%x", chan);
		return MHI_STATUS_ERROR;
	}

	mhi_log(MHI_MSG_INFO,
		"Entered, MHI state %d dev_exec_env %d chan %d cmd %d\n",
			mhi_dev_ctxt->mhi_state,
			mhi_dev_ctxt->dev_exec_env,
			chan, cmd);
	if (chan >= MHI_MAX_CHANNELS ||
		cmd >= MHI_COMMAND_MAX_NR || NULL == mhi_dev_ctxt) {
		mhi_log(MHI_MSG_ERROR,
			"Invalid channel id, received id: 0x%x", chan);
		goto error_general;
	}

	mhi_assert_device_wake(mhi_dev_ctxt);
	/*
	 * If there is a cmd pending a struct device confirmation,
@@ -863,6 +867,8 @@ enum MHI_STATUS parse_xfer_event(struct mhi_device_ctxt *ctxt,
	u32 nr_trb_to_parse;
	u32 i = 0;

	trace_mhi_ev(event);

	switch (MHI_EV_READ_CODE(EV_TRB_CODE, event)) {
	case MHI_EVENT_CC_EOB:
		chan = MHI_EV_READ_CHID(EV_CHID, event);
@@ -906,6 +912,8 @@ enum MHI_STATUS parse_xfer_event(struct mhi_device_ctxt *ctxt,
							phy_ev_trb_loc);
		local_trb_loc = (union mhi_xfer_pkt *)local_chan_ctxt->rp;

		trace_mhi_tre(local_trb_loc, chan, 1);

		ret_val = get_nr_enclosed_el(local_chan_ctxt,
				      local_trb_loc,
				      local_ev_trb_loc,
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@

#include "mhi_sys.h"
#include "mhi_hwio.h"
#include "mhi_trace.h"

static void conditional_chan_db_write(
				struct mhi_device_ctxt *mhi_dev_ctxt, u32 chan)
@@ -656,6 +657,7 @@ static enum MHI_STATUS process_stt_work_item(

	mhi_log(MHI_MSG_INFO, "Transitioning to %d\n",
				(int)cur_work_item);
	trace_mhi_state(cur_work_item);
	switch (cur_work_item) {
	case STATE_TRANSITION_BHI:
		ret_val = process_bhi_transition(mhi_dev_ctxt, cur_work_item);
Loading