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

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

Merge "soc: qcom: pil: Add trace events for PIL driver"

parents be36af2b 497f7511
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@
#include <asm/uaccess.h>
#include <asm/setup.h>
#include <asm-generic/io-64-nonatomic-lo-hi.h>
#define CREATE_TRACE_POINTS
#include <trace/events/trace_msm_pil_event.h>

#include "peripheral-loader.h"

@@ -835,6 +837,7 @@ int pil_boot(struct pil_desc *desc)
		goto release_fw;
	}

	trace_pil_event("before_init_image", desc);
	if (desc->ops->init_image)
		ret = desc->ops->init_image(desc, fw->data, fw->size);
	if (ret) {
@@ -843,6 +846,7 @@ int pil_boot(struct pil_desc *desc)
		goto err_boot;
	}

	trace_pil_event("before_mem_setup", desc);
	if (desc->ops->mem_setup)
		ret = desc->ops->mem_setup(desc, priv->region_start,
				priv->region_end - priv->region_start);
@@ -858,6 +862,7 @@ int pil_boot(struct pil_desc *desc)
		 * Also for secure boot devices, modem memory has to be released
		 * after MBA is booted
		 */
		trace_pil_event("before_assign_mem", desc);
		if (desc->modem_ssr) {
			ret = pil_assign_mem_to_linux(desc, priv->region_start,
				(priv->region_end - priv->region_start));
@@ -876,6 +881,7 @@ int pil_boot(struct pil_desc *desc)
		hyp_assign = true;
	}

	trace_pil_event("before_load_seg", desc);
	list_for_each_entry(seg, &desc->priv->segs, list) {
		ret = pil_load_seg(desc, seg);
		if (ret)
@@ -883,6 +889,7 @@ int pil_boot(struct pil_desc *desc)
	}

	if (desc->subsys_vmid > 0) {
		trace_pil_event("before_reclaim_mem", desc);
		ret =  pil_reclaim_mem(desc, priv->region_start,
				(priv->region_end - priv->region_start),
				desc->subsys_vmid);
@@ -894,12 +901,14 @@ int pil_boot(struct pil_desc *desc)
		hyp_assign = false;
	}

	trace_pil_event("before_auth_reset", desc);
	ret = desc->ops->auth_and_reset(desc);
	if (ret) {
		pil_err(desc, "Failed to bring out of reset(rc:%d)\n", ret);
		subsys_set_error(desc->subsys_dev, firmware_error_msg);
		goto err_auth_and_reset;
	}
	trace_pil_event("reset_done", desc);
	pil_info(desc, "Brought out of reset\n");
	desc->modem_ssr = false;
err_auth_and_reset:
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/highmem.h>
#include <soc/qcom/scm.h>
#include <soc/qcom/secure_buffer.h>
#include <trace/events/trace_msm_pil_event.h>

#include "peripheral-loader.h"
#include "pil-q6v5.h"
@@ -462,6 +463,7 @@ static int pil_mss_reset(struct pil_desc *pil)
	phys_addr_t start_addr = pil_get_entry_addr(pil);
	int ret;

	trace_pil_func(__func__);
	if (drv->mba_dp_phys)
		start_addr = drv->mba_dp_phys;

@@ -555,6 +557,7 @@ int pil_mss_reset_load_mba(struct pil_desc *pil)
	const u8 *data;
	struct device *dma_dev = md->mba_mem_dev_fixed ?: &md->mba_mem_dev;

	trace_pil_func(__func__);
	fw_name_p = drv->non_elf_image ? fw_name_legacy : fw_name;
	ret = request_firmware(&fw, fw_name_p, pil->dev);
	if (ret) {
@@ -685,6 +688,7 @@ static int pil_msa_auth_modem_mdt(struct pil_desc *pil, const u8 *metadata,
	DEFINE_DMA_ATTRS(attrs);


	trace_pil_func(__func__);
	dma_dev->coherent_dma_mask = DMA_BIT_MASK(sizeof(dma_addr_t) * 8);
	dma_set_attr(DMA_ATTR_SKIP_ZEROING, &attrs);
	dma_set_attr(DMA_ATTR_STRONGLY_ORDERED, &attrs);
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/regulator/consumer.h>
#include <linux/regulator/rpm-smd-regulator.h>
#include <linux/clk/msm-clk.h>
#include <trace/events/trace_msm_pil_event.h>

#include "peripheral-loader.h"
#include "pil-q6v5.h"
@@ -360,6 +361,7 @@ static int __pil_q6v55_reset(struct pil_desc *pil)
	u32 val;
	int i;

	trace_pil_func(__func__);
	/* Override the ACC value if required */
	if (drv->override_acc)
		writel_relaxed(QDSP6SS_ACC_OVERRIDE_VAL,
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include <soc/qcom/subsystem_restart.h>
#include <soc/qcom/subsystem_notif.h>
#include <soc/qcom/sysmon.h>
#include <trace/events/trace_msm_pil_event.h>

#include <asm/current.h>

@@ -539,8 +540,10 @@ static void notify_each_subsys_device(struct subsys_device **list,
		notif_data.no_auth = dev->desc->no_auth;
		notif_data.pdev = pdev;

		trace_pil_notif("before_send_notif", notif, dev->desc->fw_name);
		subsys_notif_queue_notification(dev->notify, notif,
								&notif_data);
		trace_pil_notif("after_send_notif", notif, dev->desc->fw_name);
	}
}

+88 −0
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM msm_pil_event

#if !defined(_TRACE_MSM_PIL_EVENT_H_) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_MSM_PIL_EVENT_H_

#include <linux/tracepoint.h>
#include <../drivers/soc/qcom/peripheral-loader.h>

TRACE_EVENT(pil_event,

	TP_PROTO(const char *event_name, struct pil_desc *desc),

	TP_ARGS(event_name, desc),

	TP_STRUCT__entry(
		__string(event_name, event_name)
		__string(fw_name, desc->fw_name)
	),

	TP_fast_assign(
		__assign_str(event_name, event_name);
		__assign_str(fw_name, desc->fw_name);
	),

	TP_printk("event_name=%s fw_name=%s",
		__get_str(event_name),
		__get_str(fw_name))
);

TRACE_EVENT(pil_notif,

	TP_PROTO(const char *event_name, unsigned long code,
	const char *fw_name),

	TP_ARGS(event_name, code, fw_name),

	TP_STRUCT__entry(
		__string(event_name, event_name)
		__field(unsigned long, code)
		__string(fw_name, fw_name)
	),

	TP_fast_assign(
		__assign_str(event_name, event_name);
		__entry->code = code;
		__assign_str(fw_name, fw_name);
	),

	TP_printk("event_name=%s code=%lu fw=%s",
		__get_str(event_name),
		__entry->code,
		__get_str(fw_name))
);

TRACE_EVENT(pil_func,

	TP_PROTO(const char *func_name),

	TP_ARGS(func_name),

	TP_STRUCT__entry(
		__string(func_name, func_name)
	),

	TP_fast_assign(
		__assign_str(func_name, func_name);
	),

	TP_printk("func_name=%s",
		__get_str(func_name))
);

#endif
#define TRACE_INCLUDE_FILE trace_msm_pil_event
#include <trace/define_trace.h>