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

This commit is contained in:
Linux Build Service Account 2017-06-03 22:36:47 -07:00 committed by Gerrit - the friendly Code Review server
commit c5eb66bf52
5 changed files with 106 additions and 0 deletions

View file

@ -39,6 +39,8 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm-generic/io-64-nonatomic-lo-hi.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" #include "peripheral-loader.h"
@ -835,6 +837,7 @@ int pil_boot(struct pil_desc *desc)
goto release_fw; goto release_fw;
} }
trace_pil_event("before_init_image", desc);
if (desc->ops->init_image) if (desc->ops->init_image)
ret = desc->ops->init_image(desc, fw->data, fw->size); ret = desc->ops->init_image(desc, fw->data, fw->size);
if (ret) { if (ret) {
@ -843,6 +846,7 @@ int pil_boot(struct pil_desc *desc)
goto err_boot; goto err_boot;
} }
trace_pil_event("before_mem_setup", desc);
if (desc->ops->mem_setup) if (desc->ops->mem_setup)
ret = desc->ops->mem_setup(desc, priv->region_start, ret = desc->ops->mem_setup(desc, priv->region_start,
priv->region_end - 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 * Also for secure boot devices, modem memory has to be released
* after MBA is booted * after MBA is booted
*/ */
trace_pil_event("before_assign_mem", desc);
if (desc->modem_ssr) { if (desc->modem_ssr) {
ret = pil_assign_mem_to_linux(desc, priv->region_start, ret = pil_assign_mem_to_linux(desc, priv->region_start,
(priv->region_end - priv->region_start)); (priv->region_end - priv->region_start));
@ -876,6 +881,7 @@ int pil_boot(struct pil_desc *desc)
hyp_assign = true; hyp_assign = true;
} }
trace_pil_event("before_load_seg", desc);
list_for_each_entry(seg, &desc->priv->segs, list) { list_for_each_entry(seg, &desc->priv->segs, list) {
ret = pil_load_seg(desc, seg); ret = pil_load_seg(desc, seg);
if (ret) if (ret)
@ -883,6 +889,7 @@ int pil_boot(struct pil_desc *desc)
} }
if (desc->subsys_vmid > 0) { if (desc->subsys_vmid > 0) {
trace_pil_event("before_reclaim_mem", desc);
ret = pil_reclaim_mem(desc, priv->region_start, ret = pil_reclaim_mem(desc, priv->region_start,
(priv->region_end - priv->region_start), (priv->region_end - priv->region_start),
desc->subsys_vmid); desc->subsys_vmid);
@ -894,12 +901,14 @@ int pil_boot(struct pil_desc *desc)
hyp_assign = false; hyp_assign = false;
} }
trace_pil_event("before_auth_reset", desc);
ret = desc->ops->auth_and_reset(desc); ret = desc->ops->auth_and_reset(desc);
if (ret) { if (ret) {
pil_err(desc, "Failed to bring out of reset(rc:%d)\n", ret); pil_err(desc, "Failed to bring out of reset(rc:%d)\n", ret);
subsys_set_error(desc->subsys_dev, firmware_error_msg); subsys_set_error(desc->subsys_dev, firmware_error_msg);
goto err_auth_and_reset; goto err_auth_and_reset;
} }
trace_pil_event("reset_done", desc);
pil_info(desc, "Brought out of reset\n"); pil_info(desc, "Brought out of reset\n");
desc->modem_ssr = false; desc->modem_ssr = false;
err_auth_and_reset: err_auth_and_reset:

View file

@ -26,6 +26,7 @@
#include <linux/highmem.h> #include <linux/highmem.h>
#include <soc/qcom/scm.h> #include <soc/qcom/scm.h>
#include <soc/qcom/secure_buffer.h> #include <soc/qcom/secure_buffer.h>
#include <trace/events/trace_msm_pil_event.h>
#include "peripheral-loader.h" #include "peripheral-loader.h"
#include "pil-q6v5.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); phys_addr_t start_addr = pil_get_entry_addr(pil);
int ret; int ret;
trace_pil_func(__func__);
if (drv->mba_dp_phys) if (drv->mba_dp_phys)
start_addr = 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; const u8 *data;
struct device *dma_dev = md->mba_mem_dev_fixed ?: &md->mba_mem_dev; 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; fw_name_p = drv->non_elf_image ? fw_name_legacy : fw_name;
ret = request_firmware(&fw, fw_name_p, pil->dev); ret = request_firmware(&fw, fw_name_p, pil->dev);
if (ret) { if (ret) {
@ -685,6 +688,7 @@ static int pil_msa_auth_modem_mdt(struct pil_desc *pil, const u8 *metadata,
DEFINE_DMA_ATTRS(attrs); DEFINE_DMA_ATTRS(attrs);
trace_pil_func(__func__);
dma_dev->coherent_dma_mask = DMA_BIT_MASK(sizeof(dma_addr_t) * 8); 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_SKIP_ZEROING, &attrs);
dma_set_attr(DMA_ATTR_STRONGLY_ORDERED, &attrs); dma_set_attr(DMA_ATTR_STRONGLY_ORDERED, &attrs);

View file

@ -22,6 +22,7 @@
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/regulator/rpm-smd-regulator.h> #include <linux/regulator/rpm-smd-regulator.h>
#include <linux/clk/msm-clk.h> #include <linux/clk/msm-clk.h>
#include <trace/events/trace_msm_pil_event.h>
#include "peripheral-loader.h" #include "peripheral-loader.h"
#include "pil-q6v5.h" #include "pil-q6v5.h"
@ -360,6 +361,7 @@ static int __pil_q6v55_reset(struct pil_desc *pil)
u32 val; u32 val;
int i; int i;
trace_pil_func(__func__);
/* Override the ACC value if required */ /* Override the ACC value if required */
if (drv->override_acc) if (drv->override_acc)
writel_relaxed(QDSP6SS_ACC_OVERRIDE_VAL, writel_relaxed(QDSP6SS_ACC_OVERRIDE_VAL,

View file

@ -35,6 +35,7 @@
#include <soc/qcom/subsystem_restart.h> #include <soc/qcom/subsystem_restart.h>
#include <soc/qcom/subsystem_notif.h> #include <soc/qcom/subsystem_notif.h>
#include <soc/qcom/sysmon.h> #include <soc/qcom/sysmon.h>
#include <trace/events/trace_msm_pil_event.h>
#include <asm/current.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.no_auth = dev->desc->no_auth;
notif_data.pdev = pdev; notif_data.pdev = pdev;
trace_pil_notif("before_send_notif", notif, dev->desc->fw_name);
subsys_notif_queue_notification(dev->notify, notif, subsys_notif_queue_notification(dev->notify, notif,
&notif_data); &notif_data);
trace_pil_notif("after_send_notif", notif, dev->desc->fw_name);
} }
} }

View file

@ -0,0 +1,88 @@
/* 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>