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

Commit 158fa23c authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

msm: thermal: Re-evaluate hotplug for unexpected cpu online



Thermal driver don't acquire get_online_cpus() lock before
evaluating to hotplug or online a core. This will introduce
a corner case where thermal determines to keep an offline core
hotplugged but will be brought online by other driver due to race
condition.

Thermal driver after evaluating to hotplug a core will see if it
is online. if it is online, it will proceed to hotplug it, otherwise
it will evaluate for the next core. If another driver initiates to
online a core when thermal is evaluating hotplug status, we will end up
onlining a core when thermal has a request to hotplug. Explained the
scenario below,

1.                             | Driver X initiates cpu 'A' online
2. Thermal gets CPU_UP_PREPARE |
   Notification and allows CPU |
   'A' to be online.           |
3. Thermal driver evaluates    |
   hotplug status and sees cpu |
   'A' being offline and skips |
   to next CPU.                |
4.                             | CPU 'A' online is complete and CPU
                               | online mask is updated.

Fix this corner case, by listening for CPU_ONLINE notification and
initiate a re-evaluation to retry hotplug, if a CPU online was supposed
to be hotplugged by thermal driver.

CRs-Fixed: 928985
Change-Id: Icc6c6bcbc2656c0712550b884b9a9b17e3fea9d1
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent bdac6adb
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