Commit c0e8e355 authored by Jian Gong's avatar Jian Gong Committed by Treehugger Robot
Browse files

ANDROID: vendor_hooks: psci: add hook to check if cpu is allowed to power off



While TOS is running alongside with linux, cpu power off operation by linux
may need be denied by TOS in some scenarios.
This patch added two hooks in psci_tos_resident_on and psci_cpu_suspend
to hook cpu off operation.

The function psci_tos_resident_on originally is used to check if TOS is resident on
a specific cpu and that cpu is dedicated for running TOS exclusively. If so, that
cpu can not be power off. Actually if TOS supports SMP, TOS may need deny any
other cpu to power down in some cases, i.e. there are no-expired timers in TOS.
Thus the first hook for psci_tos_resident_on is used to determine if
the specific cpu is allowed to power off in the cpu hotplug path.

Besides cpu hotplug, a cpu also can power off by cpu_suspend.
The second hook for psci_cpu_suspend determines if cpu suspend should go through
or not. When the same conditions described above meets, cpu suspend will break up.

The hook cherry-pick from commit 88d88955
and changed vh to rvh according to commit 949edf75

Bug: 317657627

Change-Id: Ib329beeff20f0cfef263f6a7813280d33f6a5eaa
Signed-off-by: default avatarJian Gong <Jian.Gong@unisoc.com>
Signed-off-by: default avatarZhi Hou <Zhi.Hou@unisoc.com>
parent de5f5746
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment