Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d24a9da5 authored by Matthew Garrett's avatar Matthew Garrett
Browse files

IPS driver: Fix limit clamping when reducing CPU power



Values here are in internal units rather than Watts, so we shouldn't
perform any conversion.

Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 96f3823f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -415,7 +415,7 @@ static void ips_cpu_lower(struct ips_driver *ips)
	new_limit = cur_limit - 8; /* 1W decrease */
	new_limit = cur_limit - 8; /* 1W decrease */


	/* Clamp to SKU TDP limit */
	/* Clamp to SKU TDP limit */
	if (((new_limit * 10) / 8) < (ips->orig_turbo_limit & TURBO_TDP_MASK))
	if (new_limit  < (ips->orig_turbo_limit & TURBO_TDP_MASK))
		new_limit = ips->orig_turbo_limit & TURBO_TDP_MASK;
		new_limit = ips->orig_turbo_limit & TURBO_TDP_MASK;


	thm_writew(THM_MPCPC, (new_limit * 10) / 8);
	thm_writew(THM_MPCPC, (new_limit * 10) / 8);