msm: kgsl: Fix a dead loop issue while changing gpu frequency

There is a dead loop in kgsl driver function, while changing governor
frequency. In governor 'userspace' mode, If the requested frequency
(set_freq) is more than the configured frequency and max_freq is also
set to more than the configured frequency, then there is a dead loop
while changing target frequency.

Dead loop occurs due to comparing signed integer 'i' with unsigned integer
'max_pwrlevel'. Decrementing 'i' beyond zero will cause dead loop.
So, change the array index 'i' of pwrlevels[] to unsigned int, which can't
be decremented beyond zero. Also, changing loop condition to restrict 'i'
within permitted levels.

Change-Id: Ic82b7477d50d1abcd348b011f64246066887922c
Signed-off-by: Venkateswara Rao Tadikonda <vtadik@codeaurora.org>
1 file changed