pass: hal: Replace the function to get initial maximum frequency 46/143146/5
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 7 Aug 2017 05:53:09 +0000 (14:53 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 16 Aug 2017 01:23:21 +0000 (10:23 +0900)
The current maximum frequency is used for saving initial data of
frequency. However, it is affected by other factor such as thermal
throttling, thus the initial value can be lower than expected.
To prevent this problem, the available maximum frequency will be
used to get initial frequency data.

Change-Id: If8d65da8896a547d66abc0c2e053585468d3c346
Reported-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/pass/pass-hal.c

index b98a4fef7753ff74db9a72ebd1fe2504542bf0c8..89dfb97596f9c3c41606bdc3b8e9a88291a8757a 100644 (file)
@@ -557,7 +557,16 @@ static int pass_save_dvfs_initdata(struct pass_resource *res)
                initdata->dvfs.governor = NULL;
 
        initdata->dvfs.min_freq = pass_get_min_freq(res);
-       initdata->dvfs.max_freq = pass_get_max_freq(res);
+
+       /*
+        * Since the current maximum frequency can be affected by other
+        * factor such as thermal throttling, it can be restored lower
+        * value than we expected if we save it as initial value. Thus,
+        * in order to restore default maximum frequency we save available
+        * maximum frequency instead of current maximum frequency.
+        */
+       initdata->dvfs.max_freq = pass_get_available_max_freq(res);
+
        initdata->dvfs.up_threshold = pass_get_up_threshold(res);
 
        return 0;