linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: governor: Drop gov_cancel_work()
@ 2016-06-08 23:45 Rafael J. Wysocki
  2016-06-09  3:21 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2016-06-08 23:45 UTC (permalink / raw)
  To: Linux PM list
  Cc: Viresh Kumar, Srinivas Pandruvada, Linux Kernel Mailing List

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

There's no reason for gov_cancel_work() to exist at all, as it only
has one caller and the only thing done by that caller is to invoke
gov_cancel_work().

Accordingly, drop gov_cancel_work() and move its contents to the
caller.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/cpufreq/cpufreq_governor.c |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

Index: linux-pm/drivers/cpufreq/cpufreq_governor.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq_governor.c
+++ linux-pm/drivers/cpufreq/cpufreq_governor.c
@@ -336,17 +336,6 @@ static inline void gov_clear_update_util
 	synchronize_sched();
 }
 
-static void gov_cancel_work(struct cpufreq_policy *policy)
-{
-	struct policy_dbs_info *policy_dbs = policy->governor_data;
-
-	gov_clear_update_util(policy_dbs->policy);
-	irq_work_sync(&policy_dbs->irq_work);
-	cancel_work_sync(&policy_dbs->work);
-	atomic_set(&policy_dbs->work_count, 0);
-	policy_dbs->work_in_progress = false;
-}
-
 static struct policy_dbs_info *alloc_policy_dbs_info(struct cpufreq_policy *policy,
 						     struct dbs_governor *gov)
 {
@@ -544,7 +533,13 @@ EXPORT_SYMBOL_GPL(cpufreq_dbs_governor_s
 
 void cpufreq_dbs_governor_stop(struct cpufreq_policy *policy)
 {
-	gov_cancel_work(policy);
+	struct policy_dbs_info *policy_dbs = policy->governor_data;
+
+	gov_clear_update_util(policy_dbs->policy);
+	irq_work_sync(&policy_dbs->irq_work);
+	cancel_work_sync(&policy_dbs->work);
+	atomic_set(&policy_dbs->work_count, 0);
+	policy_dbs->work_in_progress = false;
 }
 EXPORT_SYMBOL_GPL(cpufreq_dbs_governor_stop);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpufreq: governor: Drop gov_cancel_work()
  2016-06-08 23:45 [PATCH] cpufreq: governor: Drop gov_cancel_work() Rafael J. Wysocki
@ 2016-06-09  3:21 ` Viresh Kumar
  2016-06-09 12:21   ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2016-06-09  3:21 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Srinivas Pandruvada, Linux Kernel Mailing List

On 09-06-16, 01:45, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> There's no reason for gov_cancel_work() to exist at all, as it only
> has one caller and the only thing done by that caller is to invoke
> gov_cancel_work().
> 
> Accordingly, drop gov_cancel_work() and move its contents to the
> caller.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/cpufreq/cpufreq_governor.c |   19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

I am wondering what happened to your other patches around the governor callbacks
and why weren't they applied yet :)

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpufreq: governor: Drop gov_cancel_work()
  2016-06-09  3:21 ` Viresh Kumar
@ 2016-06-09 12:21   ` Rafael J. Wysocki
  2016-06-10  2:58     ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2016-06-09 12:21 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael J. Wysocki, Linux PM list, Srinivas Pandruvada,
	Linux Kernel Mailing List

On Thu, Jun 9, 2016 at 5:21 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 09-06-16, 01:45, Rafael J. Wysocki wrote:
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
>> There's no reason for gov_cancel_work() to exist at all, as it only
>> has one caller and the only thing done by that caller is to invoke
>> gov_cancel_work().
>>
>> Accordingly, drop gov_cancel_work() and move its contents to the
>> caller.
>>
>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> ---
>>  drivers/cpufreq/cpufreq_governor.c |   19 +++++++------------
>>  1 file changed, 7 insertions(+), 12 deletions(-)
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Thanks!

> I am wondering what happened to your other patches around the governor callbacks
> and why weren't they applied yet :)

They are in linux-next now, aren't they?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpufreq: governor: Drop gov_cancel_work()
  2016-06-09 12:21   ` Rafael J. Wysocki
@ 2016-06-10  2:58     ` Viresh Kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2016-06-10  2:58 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Linux PM list, Srinivas Pandruvada,
	Linux Kernel Mailing List

On 09-06-16, 14:21, Rafael J. Wysocki wrote:
> On Thu, Jun 9, 2016 at 5:21 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > On 09-06-16, 01:45, Rafael J. Wysocki wrote:
> >> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >>
> >> There's no reason for gov_cancel_work() to exist at all, as it only
> >> has one caller and the only thing done by that caller is to invoke
> >> gov_cancel_work().
> >>
> >> Accordingly, drop gov_cancel_work() and move its contents to the
> >> caller.
> >>
> >> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >> ---
> >>  drivers/cpufreq/cpufreq_governor.c |   19 +++++++------------
> >>  1 file changed, 7 insertions(+), 12 deletions(-)
> >
> > Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 
> Thanks!
> 
> > I am wondering what happened to your other patches around the governor callbacks
> > and why weren't they applied yet :)
> 
> They are in linux-next now, aren't they?

Yeah, they are in now.

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-10  2:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 23:45 [PATCH] cpufreq: governor: Drop gov_cancel_work() Rafael J. Wysocki
2016-06-09  3:21 ` Viresh Kumar
2016-06-09 12:21   ` Rafael J. Wysocki
2016-06-10  2:58     ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).