From: Youngtae Lee Date: Tue, 15 May 2018 01:18:40 +0000 (+0900) Subject: samsung: emc: change timer add condition. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3b0236d6ccf5a4f191d8c682c83f6687a2415aa0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git samsung: emc: change timer add condition. If req_mode and cur_mode is same, skip adding timer Change-Id: I80ba564f705c131609e0b96ff99126a4495ae3dd Signed-off-by: Youngtae Lee --- diff --git a/drivers/soc/samsung/exynos-emc.c b/drivers/soc/samsung/exynos-emc.c index 47ab39a08ce3..a167975f79f4 100644 --- a/drivers/soc/samsung/exynos-emc.c +++ b/drivers/soc/samsung/exynos-emc.c @@ -514,16 +514,20 @@ static void emc_request_mode_change(struct emc_mode *target_mode) static void emc_irq_work(struct irq_work *irq_work) { + /* + * If req_mode is changed before mode change latency, + * cancel requesting mode change + */ if (hrtimer_active(&emc.timer)) hrtimer_cancel(&emc.timer); - /* - * In order to change state, same mode should be remained - * at least chamge_ms time - */ + /* if req_mode and cur_mode is same, skip the mode change */ + if (emc.req_mode == emc.cur_mode) + return; + trace_emc_start_timer(emc.req_mode->name, emc.req_mode->change_latency); - /* It tries to change mode only if it keeps same mode as change_latency */ + /* emc change applying req_mode after keeps same mode as change_latency */ hrtimer_start(&emc.timer, ms_to_ktime(emc.req_mode->change_latency), HRTIMER_MODE_REL);