In max_freq_store(), we allow any large to be
stored as max_freq
Similarly in min_freq_store() we allow any
lower value as min_freq
Fix this so that we clip max_freq to highest
freq value supported and clip min_freq to
lowest freq value supported
Bug
200260336
Change-Id: I6b11f6a5fd31f9411299dbeea1d3a528e1077bc5
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/
1266463
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
goto unlock;
}
+ /* can't drop below supported MIN */
+ if (value < df->profile->freq_table[0])
+ value = df->profile->freq_table[0];
+
df->min_freq = value;
update_devfreq(df);
ret = count;
unsigned long value;
int ret;
unsigned long min;
+ unsigned int max_states;
ret = sscanf(buf, "%lu", &value);
if (ret != 1)
goto unlock;
}
+ /* can't exceed supported MAX */
+ max_states = df->profile->max_state;
+ if (value > df->profile->freq_table[max_states - 1])
+ value = df->profile->freq_table[max_states - 1];
+
df->max_freq = value;
update_devfreq(df);
ret = count;