Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 47f9b50d authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: thermal: limits-dcvs: Prevent race in freq limits polling



Thermal-core when setting a software cap, will write to the hardware by
making a scm call. The TZ will disable the frequency cap momentarily
before writing the new frequency cap and then re-enable it. During this
scm call transaction, if the polling thread in LMH DCVSh driver reads
the hardware limits, it will show that the CPUs are not throttling and
will enable the interrupt. But when the scm transaction is done, it will
disable the interrupt again.

There is a possibility software frequency cap first decrements the atomic
variable, indicating the interrupt is disabled, and gets context switched.
During this time frame if a hardware interrupt occurs, it can go in a
interrupt storm till the software frequency cap thread actually disables
the interrupt.

To avoid these race conditions protect the LMH DCVSh driver software
frequency write, polling thread and the interrupt handling.

Change-Id: I601bf2c99d6cc6525f3809043330b816bb3e8737
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent c9738304
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment