Commit 7f7d9e1e authored by Lukasz Luba's avatar Lukasz Luba Committed by Krzysztof Kozlowski

memory: samsung: exynos5422-dmc: Additional locking for 'curr_rate'

The 'curr_rate' is protected by local 'dmc->lock' in various places, but
not in a function exynos5_dmc_get_status(). The lock protects frequency
(and voltage) change process and the corresponding value stored in
'curr_rate'. Add the locking mechanism to protect the 'curr_rate' reading
also in the exynos5_dmc_get_status().
Suggested-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Link: https://lore.kernel.org/r/20200811101727.3976-1-lukasz.luba@arm.comSigned-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 9123e3a7
......@@ -908,7 +908,10 @@ static int exynos5_dmc_get_status(struct device *dev,
int ret;
if (dmc->in_irq_mode) {
mutex_lock(&dmc->lock);
stat->current_frequency = dmc->curr_rate;
mutex_unlock(&dmc->lock);
stat->busy_time = dmc->load;
stat->total_time = dmc->total;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment