diff options
author | Sidath Senanayake <sidaths@google.com> | 2021-06-17 15:01:52 +0100 |
---|---|---|
committer | Sidath Senanayake <sidaths@google.com> | 2021-06-17 23:39:09 +0000 |
commit | 070b935c6a1f2057256331a47a492f6a573cb3ad (patch) | |
tree | ed5f69ca437dcff81fc506f50d558b22fabcfcf3 /mali_kbase/mali_kbase_defs.h | |
parent | af55bbd0f81d100f10c516545345fe6ebe775fd3 (diff) | |
download | gpu-070b935c6a1f2057256331a47a492f6a573cb3ad.tar.gz |
mali_kbase: pm: Fix APC race condition
It was possible for the APC power off work queue to use the
same work struct for two different power off requests if two
consecutive APC requests were issued in quick succession with
sufficiently short duration requests.
This change ensures that the power off work queue is only used
once by ensuring that all active hrtimer callbacks complete
before the next power off work can be set up.
The change also moves power on and power off work struct
initialization to APC init as they are only ever used with a
single worker struct.
Bug: 190341904
Signed-off-by: Sidath Senanayake <sidaths@google.com>
Change-Id: Iaf08d9a1ff0a1a824d00a505ce71880402ed1552
Diffstat (limited to 'mali_kbase/mali_kbase_defs.h')
-rw-r--r-- | mali_kbase/mali_kbase_defs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mali_kbase/mali_kbase_defs.h b/mali_kbase/mali_kbase_defs.h index 68b0a29..a2f3eca 100644 --- a/mali_kbase/mali_kbase_defs.h +++ b/mali_kbase/mali_kbase_defs.h @@ -143,6 +143,11 @@ #define KBASE_RT_THREAD_CPUMASK_MAX (3) /** + * Minimum allowed wake duration in usec for apc request. + */ +#define KBASE_APC_MIN_DUR_USEC (100) + +/** * Maximum allowed wake duration in usec for apc request. */ #define KBASE_APC_MAX_DUR_USEC (4000) @@ -936,7 +941,7 @@ struct kbase_process { * @apc.power_off_work: Work struct for powering off the GPU. * @apc.end_ts: The latest end timestamp to power off the GPU. * @apc.timer: A hrtimer for powering off based on wake duration. - * @apc.pending: Whether apc is requested and not handled yet. + * @apc.pending: Whether an APC power on request is active and not handled yet. * @apc.lock: Lock for @apc.end_ts, @apc.timer and @apc.pending. * @dummy_job_wa: struct for dummy job execution workaround for the * GPU hang issue |