diff mbox

cpufreq: only stop ondemand governor if already started

Message ID CACMJ4GbJsXq-yWybCoB5BVXZZh2Vk=LTaj42+Ey53J6BppRDGA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christopher Clark Aug. 9, 2017, 5:21 p.m. UTC
On Wed, Aug 9, 2017 at 2:25 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 09.08.17 at 03:57, <christopher.w.clark@gmail.com> wrote:
>> Avoid panic in cpufreq_gov_stop.
>
> There's no such function afaics; ...
>
>> Only execute the CPUFREQ_GOV_STOP logic if the governor has
>> actually been started.
>
> ... all dbs_timer_exit() does is a kill_timer(), so at the very least
> the description needs correction.

Thanks for the review. I will resend with a corrected description.

>> Patch originated in OpenXT.
>
> With the original author impossible to identify?

This patch is a 100% new implementation, written by me, and copyright
on it belongs to BAE Systems.

A similar patch, with the same effect, that OpenXT uses, has been part
of the project source code since the 12th of June, 2014. It was
written by an unidentifiable member of staff at Citrix as part of the
XenClient project, licensed GPLv2 and delivered to the OpenXT project
at its inception. Citrix retains the copyright on that patch, which is
reproduced below.

https://github.com/OpenXT/xenclient-oe/blob/stable-7/recipes-extended/xen/files/cpufreq_gov_stop_avoid_panic.patch
diff mbox

Patch

--- xen-4.6.6.orig/xen/drivers/cpufreq/cpufreq_ondemand.c
+++ xen-4.6.6/xen/drivers/cpufreq/cpufreq_ondemand.c
@@ -273,8 +273,11 @@  int cpufreq_governor_dbs(struct cpufreq_
break;
case CPUFREQ_GOV_STOP:
- dbs_timer_exit(this_dbs_info);
- dbs_enable--;
+ if (this_dbs_info->enable)
+ {
+ dbs_timer_exit(this_dbs_info);
+ dbs_enable--;
+ }


Christopher