memory: samsung: exynos5422-dmc: Additional locking for 'curr_rate'
Subsystems (3)
Lukasz Luba
maintainerPATCH 1/1 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().
--- drivers/memory/samsung/exynos5422-dmc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/memory/samsung/exynos5422-dmc.c +3 -0
@@ -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 {
Signature · 1 line
2.17.1
Quoted 10 lines · Lukasz Luba
The '
curr_rate' is protected by local 'dmc->lock' in various places, but not in a functionexynos5_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 theexynos5_dmc_get_status().Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Lukasz Luba <[email protected]>--- drivers/memory/samsung/exynos5422-dmc.c | 3 +++
Thanks, applied.
Best regards,
Krzysztof
Lukasz Luba
maintainerHi Krzysztof,
Quoted 7 lines · Krzysztof Kozlowski
Quoted 6 lines · Lukasz Luba
The '
curr_rate' is protected by local 'dmc->lock' in various places, but not in a functionexynos5_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 theexynos5_dmc_get_status().
Quoted 7 lines
Quoted 4 lines
Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Lukasz Luba <[email protected]>--- drivers/memory/samsung/exynos5422-dmc.c | 3 +++Thanks, applied.
Thank you for applying it.
Regards,
Lukasz