From 24bfd162f966bf232a33523f72750c558492bb8b Mon Sep 17 00:00:00 2001 From: Gokul krishna Krishnakumar Date: Mon, 17 May 2021 18:58:25 -0700 Subject: [PATCH] ANDROID: rproc: Add vendor hook for recovery Add vendor hook for rproc recovery to allow vendor enhancements. Bug: 215224270 Change-Id: If6f0846c141a4ad40748d552002f65b94d9c52d5 Signed-off-by: Siddharth Gupta Signed-off-by: Gokul krishna Krishnakumar --- drivers/android/vendor_hooks.c | 2 ++ drivers/remoteproc/remoteproc_core.c | 3 +++ include/trace/hooks/remoteproc.h | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 include/trace/hooks/remoteproc.h diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 0439dab55dec..73847cacaae2 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -43,6 +43,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -210,3 +211,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_logbuf); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_logbuf_pr_cont); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_post_init_entity_util_avg); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_new_ilb); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery); diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 775df165eb45..71e58f5e7654 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "remoteproc_internal.h" @@ -1970,6 +1971,8 @@ static void rproc_crash_handler_work(struct work_struct *work) if (!rproc->recovery_disabled) rproc_trigger_recovery(rproc); + trace_android_vh_rproc_recovery(rproc); + pm_relax(rproc->dev.parent); } diff --git a/include/trace/hooks/remoteproc.h b/include/trace/hooks/remoteproc.h new file mode 100644 index 000000000000..dfac7b9e52db --- /dev/null +++ b/include/trace/hooks/remoteproc.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM remoteproc + +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_RPROC_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_RPROC_H + +struct rproc; + +#include +#include + +DECLARE_HOOK(android_vh_rproc_recovery, + TP_PROTO(struct rproc *rproc), + TP_ARGS(rproc)); + +#endif /* _TRACE_HOOK_GIC_H */ +/* This part must be outside protection */ +#include