Skip to content

Commit

Permalink
ANDROID: gic: Add affinity-setting vendor hooks to gic
Browse files Browse the repository at this point in the history
Add vendor hooks to allow vendor enhancements to GIC, specifically
implementation-defined multi-CPU IRQ target affinity setting.

This patch is a refactored version of the android13-5.15 commit
9c25e5d ("ANDROID: gic: Add vendor hook to GIC").

Bug: 266450121
Change-Id: I4a17ed20f8e868a6479fd53c0230b22652595b01
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
  • Loading branch information
Guru Das Srinagesh authored and Treehugger Robot committed Feb 1, 2023
1 parent 818d44d commit 4cd99f6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/android/vendor_hooks.c
Expand Up @@ -43,6 +43,7 @@
#include <trace/hooks/futex.h>
#include <trace/hooks/fips140.h>
#include <trace/hooks/dmabuf.h>
#include <trace/hooks/gic.h>
#include <trace/hooks/timer.h>
#include <trace/hooks/topology.h>
#include <trace/hooks/hung_task.h>
Expand Down Expand Up @@ -136,5 +137,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_expandkey);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_encrypt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_decrypt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_timer_calc_index);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_set_affinity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterrupt_tasks);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterrupt_tasks_done);
3 changes: 3 additions & 0 deletions drivers/irqchip/irq-gic.c
Expand Up @@ -39,6 +39,7 @@
#include <linux/irqchip.h>
#include <linux/irqchip/chained_irq.h>
#include <linux/irqchip/arm-gic.h>
#include <trace/hooks/gic.h>

#include <asm/cputype.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -816,6 +817,8 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
writeb_relaxed(gic_cpu_map[cpu], reg);
irq_data_update_effective_affinity(d, cpumask_of(cpu));

trace_android_vh_gic_set_affinity(d, mask_val, force, gic_cpu_map, reg);

return IRQ_SET_MASK_OK_DONE;
}

Expand Down
20 changes: 20 additions & 0 deletions include/trace/hooks/gic.h
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM gic

#define TRACE_INCLUDE_PATH trace/hooks

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

#include <trace/hooks/vendor_hooks.h>

struct irq_data;
DECLARE_HOOK(android_vh_gic_set_affinity,
TP_PROTO(struct irq_data *d, const struct cpumask *mask_val,
bool force, u8 *gic_cpu_map, void __iomem *reg),
TP_ARGS(d, mask_val, force, gic_cpu_map, reg));

#endif /* _TRACE_HOOK_GIC_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

0 comments on commit 4cd99f6

Please sign in to comment.