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

Skip to content
Commit ac290b49 authored by Lina Iyer's avatar Lina Iyer
Browse files

drivers: qcom: rpmh: caching batch requests should flag the cache dirty



The sleep/wake state batch requests are saved in a linked list and
flushed along with other sleep/wake request when entering system low
power modes. Caches are flushed only if the state flag is marked dirty.

A race situation could cause the batch sleep/wake requests to not be
flushed. Here is how this could happen -

- Interconnect driver (ICC) invalidates the sleep/wake requests
	- RSC driver clears the TCSes (BCM, VRM, ARC sleep votes cleared)

- ICC sends an active state response-required request
	- RSC driver sends the AMC request
	- RPMH waits on the response, calls wait_for_completion

- Scheduler schedules idle thread
	- cpuidle enters cluster idle state
		- RPMH flushes cache and marks cache clean
		 (no BCM votes in TCS)

- RSC driver receives IRQ response
	- RPMH calls complete()

- ICC worker thread resumes execution
	- ICC driver calls RPMH driver with updated sleep and wake votes
		- RPMH caches the request, *cache is NOT marked dirty*

- Scheduler schedules idle thread
	- cpuidle enters cluster idle state
		- Cache is clean and nothing to flush
	- CPU enters idle
		=>ICC sleep/wake votes are not sent

Fix this by dirtying the cache state even when caching batch requests.

Change-Id: I7613e665d181f8abb27915d622442e7b981f9fcc
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 514fa165
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