lpm: Resolve inconsistent CPU status with M4M sleep
Cluster sleep preparation and configuration starts first with L2 and
then M4M (or parent level). In the exit path, cluster unpreparation
starts with L2 and then M4M. Only the first cpu from each cluster waits
to unprepare M4M and send out M4M exit notifications.
CPU0
|
|
|
V CPU2
Cluster 0 L2 |
| |
| |
| V
V L2 CPU3
M4M | |
| | |
| | Unprepare |
| V V
V M4 L2 unprepare(not first cpu)
Sleep ^ ^
| |
| |
CPU2 Active CPU3 Active
|
|
V
Request for frequency change
Instead the entry/exit path should acquire M4M lock holding onto the L2
lock such that there is no race condition between the cpus that are
exiting/entering.
CPU0
|
|
|
V CPU2
Cluster 0 L2 |
| |
| |
| V
V L2 CPU3
M4M | |
| | |
| | Unprepare |
| V V
| M4 L2 unprepare(waiting on spinlock
V | acquired by CPU2)
Sleep | |
| |
V |
CPU2 Active spinlock for L2 acquired
|
|
|
CPU3 is not the first cpu in the cluster
|
| exit idle path
V
CPU3 active
|
|
V
safe time
for frequency change
Also, number of children in sync is accessed without the lock of the
same cluster. This causes inconsistency within the same cluster. Ensure
this variable is accessed within the spinlock.
Change-Id: I182692fbc2bd6b0b0beaee0666bf108a76adc34a
Signed-off-by:
Archana Sathyakumar <asathyak@codeaurora.org>
Loading
Please register or sign in to comment