ANDROID: Fix incorrect hook declaration

Two hooks that need to be restricted were correctly named with "_rvh_"
but were incorrectly declared as normal hooks. This resulted in crashes
for at least 1 partner:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at include/trace/hooks/psci.h:19 psci_0_2_cpu_suspend+0x124/0x1d8
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G S      W          6.1.25-android14-7-00072-gf10e53af33a0 #1
Hardware name: Samsung ERD9945 board based on S5E9945 (DT)
pstate: 624003c5 (nZCv DAIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : psci_0_2_cpu_suspend+0x124/0x1d8
lr : psci_0_2_cpu_suspend+0x88/0x1d8
sp : ffffffd00b1f7b20
x29: ffffffd00b1f7b30
[0:      swapper/0:    0]  x28: ffffffd00b217be4 x27: 0000000000000001
x26: 0000000000000000 x25: ffffff8915b689fc x24: 93ffff8837750100

x23: 000000008cc8e544 x22: 00000000000000c0
 x21: 0000000000010000
x20: 000000008147a038 x19: efffffc000000000 x18: 0000000000000000

x17: 0000000000000000 x16: 00000000000000ff x15: 0000000000000000
x14: 0000000000000000 x13: ffffffd00b22ae00 x12: ffffffb90a98d000
x11: ffffffd00b1d9850
x10: 0000000100000001 x9 : efffffc000000000
x8 : 0000000100000001
[0:      swapper/0:    0]  x7 : 015001f2b5593519
[0:      swapper/0:    0]  x6 : 0000000000310000
x5 : 0000000000000000
 x4 : 0000000000000000 x3 : 0000000000000000
[0:      swapper/0:    0] x2 : 0000000000000000 x1 : ffffff8915b66850 x0 : 0000000000000000

Call trace:
 psci_0_2_cpu_suspend+0x124/0x1d8
 psci_suspend_finisher+0x2c/0x38
 cpu_suspend+0x8c/0x16c
 psci_cpu_suspend_enter+0x54/0x7c
 psci_enter_idle_state+0x64/0x94
 cpuidle_enter_state+0x1dc/0x9b8
 cpuidle_enter+0x58/0x7c
 call_cpuidle+0x30/0x58
[0:      swapper/0:    0]  do_idle+0x214/0x2b8
 cpu_startup_entry+0x2c/0x30
 kernel_init+0x0/0x180
 start_kernel+0x0/0x444
 start_kernel+0x368/0x444
 __primary_switched+0xc0/0xc8
Kernel panic - not syncing: kernel: panic_on_warn set ...

Fixes: b7a7fd15ed ("ANDROID: vendor_hooks: psci: add hook to check if cpu is allowed to power off")
Bug: 285477556
Change-Id: I44ca332dc61dab025a0e33c94e8ad2f5eaffb6f8
Signed-off-by: Todd Kjos <tkjos@google.com>
This commit is contained in:
Todd Kjos 2023-06-02 16:01:40 +00:00
parent e57fe10b5a
commit 9e2fa0a396

View file

@ -10,13 +10,13 @@
#include <trace/hooks/vendor_hooks.h>
DECLARE_HOOK(android_rvh_psci_tos_resident_on,
DECLARE_RESTRICTED_HOOK(android_rvh_psci_tos_resident_on,
TP_PROTO(int cpu, bool *resident),
TP_ARGS(cpu, resident));
TP_ARGS(cpu, resident), 1);
DECLARE_HOOK(android_rvh_psci_cpu_suspend,
DECLARE_RESTRICTED_HOOK(android_rvh_psci_cpu_suspend,
TP_PROTO(u32 state, bool *deny),
TP_ARGS(state, deny));
TP_ARGS(state, deny), 1);
/* macro versions of hooks are no longer required */