linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: governors: clean timer init and exit code
@ 2013-01-30 13:53 Fabio Baltieri
  2013-01-31 10:53 ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Baltieri @ 2013-01-30 13:53 UTC (permalink / raw)
  To: Rafael J. Wysocki, cpufreq, linux-pm, Viresh Kumar
  Cc: Linus Walleij, swarren, linaro-dev, Nicolas Pitre,
	mathieu.poirier, Joseph Lo, linux-kernel, Fabio Baltieri

Drop unused arguments from dbs_timer_init and clean dbs_timer_exit and
cpufreq_governor_dbs to remove non necessary special cases.

Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---

Hello Rafael,

that's the cleanup on top of "cpufreq: handle SW coordinated CPUs".

Thanks,
Fabio

 drivers/cpufreq/cpufreq_governor.c | 43 ++++++++++++--------------------------
 1 file changed, 13 insertions(+), 30 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index ee8b7ca..46f96a4 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -169,19 +169,19 @@ bool dbs_sw_coordinated_cpus(struct cpu_dbs_common_info *cdbs)
 }
 EXPORT_SYMBOL_GPL(dbs_sw_coordinated_cpus);
 
-static inline void dbs_timer_init(struct dbs_data *dbs_data,
-				  struct cpu_dbs_common_info *cdbs,
-				  unsigned int sampling_rate,
-				  int cpu)
+static inline void dbs_timer_init(struct dbs_data *dbs_data, int cpu,
+				  unsigned int sampling_rate)
 {
 	int delay = delay_for_sampling_rate(sampling_rate);
-	struct cpu_dbs_common_info *cdbs_local = dbs_data->get_cpu_cdbs(cpu);
+	struct cpu_dbs_common_info *cdbs = dbs_data->get_cpu_cdbs(cpu);
 
-	schedule_delayed_work_on(cpu, &cdbs_local->work, delay);
+	schedule_delayed_work_on(cpu, &cdbs->work, delay);
 }
 
-static inline void dbs_timer_exit(struct cpu_dbs_common_info *cdbs)
+static inline void dbs_timer_exit(struct dbs_data *dbs_data, int cpu)
 {
+	struct cpu_dbs_common_info *cdbs = dbs_data->get_cpu_cdbs(cpu);
+
 	cancel_delayed_work_sync(&cdbs->work);
 }
 
@@ -289,36 +289,19 @@ second_time:
 		}
 		mutex_unlock(&dbs_data->mutex);
 
-		if (dbs_sw_coordinated_cpus(cpu_cdbs)) {
-			/* Initiate timer time stamp */
-			cpu_cdbs->time_stamp = ktime_get();
+		/* Initiate timer time stamp */
+		cpu_cdbs->time_stamp = ktime_get();
 
-			for_each_cpu(j, policy->cpus) {
-				struct cpu_dbs_common_info *j_cdbs;
-
-				j_cdbs = dbs_data->get_cpu_cdbs(j);
-				dbs_timer_init(dbs_data, j_cdbs,
-					       *sampling_rate, j);
-			}
-		} else {
-			dbs_timer_init(dbs_data, cpu_cdbs, *sampling_rate, cpu);
-		}
+		for_each_cpu(j, policy->cpus)
+			dbs_timer_init(dbs_data, j, *sampling_rate);
 		break;
 
 	case CPUFREQ_GOV_STOP:
 		if (dbs_data->governor == GOV_CONSERVATIVE)
 			cs_dbs_info->enable = 0;
 
-		if (dbs_sw_coordinated_cpus(cpu_cdbs)) {
-			for_each_cpu(j, policy->cpus) {
-				struct cpu_dbs_common_info *j_cdbs;
-
-				j_cdbs = dbs_data->get_cpu_cdbs(j);
-				dbs_timer_exit(j_cdbs);
-			}
-		} else {
-			dbs_timer_exit(cpu_cdbs);
-		}
+		for_each_cpu(j, policy->cpus)
+			dbs_timer_exit(dbs_data, j);
 
 		mutex_lock(&dbs_data->mutex);
 		mutex_destroy(&cpu_cdbs->timer_mutex);
-- 
1.7.12.1


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

* Re: [PATCH] cpufreq: governors: clean timer init and exit code
  2013-01-30 13:53 [PATCH] cpufreq: governors: clean timer init and exit code Fabio Baltieri
@ 2013-01-31 10:53 ` Viresh Kumar
  2013-01-31 11:06   ` Fabio Baltieri
  0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2013-01-31 10:53 UTC (permalink / raw)
  To: Fabio Baltieri
  Cc: Rafael J. Wysocki, cpufreq, linux-pm, Linus Walleij, swarren,
	linaro-dev, Nicolas Pitre, mathieu.poirier, Joseph Lo,
	linux-kernel

On 30 January 2013 19:23, Fabio Baltieri <fabio.baltieri@linaro.org> wrote:
> Drop unused arguments from dbs_timer_init and clean dbs_timer_exit and
> cpufreq_governor_dbs to remove non necessary special cases.
>
> Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>

As discussed over IRC, you will fix following in few days:
- Code redundancy within governors
- Removing second_time: label and cdbs->enable field
- Fixing params to timer init and exit to make them more efficient.

And here is my ack for this patch:

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

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

* Re: [PATCH] cpufreq: governors: clean timer init and exit code
  2013-01-31 10:53 ` Viresh Kumar
@ 2013-01-31 11:06   ` Fabio Baltieri
  2013-01-31 13:06     ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Baltieri @ 2013-01-31 11:06 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael J. Wysocki, cpufreq, linux-pm, Linus Walleij, swarren,
	linaro-dev, Nicolas Pitre, mathieu.poirier, Joseph Lo,
	linux-kernel

On Thu, Jan 31, 2013 at 04:23:06PM +0530, Viresh Kumar wrote:
> On 30 January 2013 19:23, Fabio Baltieri <fabio.baltieri@linaro.org> wrote:
> > Drop unused arguments from dbs_timer_init and clean dbs_timer_exit and
> > cpufreq_governor_dbs to remove non necessary special cases.
> >
> > Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
> 
> As discussed over IRC, you will fix following in few days:
> - Code redundancy within governors
> - Removing second_time: label and cdbs->enable field
> - Fixing params to timer init and exit to make them more efficient.

That's the plan, I'd leave it up to Rafael to decide if further cleanup
patches should be included in 3.9 merge window or skip to the following
one... I understand that we are starting to be late on the -rc and I
also prefer to focus on fixup.

Thanks,
Fabio

> And here is my ack for this patch:
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Fabio Baltieri

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

* Re: [PATCH] cpufreq: governors: clean timer init and exit code
  2013-01-31 11:06   ` Fabio Baltieri
@ 2013-01-31 13:06     ` Rafael J. Wysocki
  2013-02-01  3:54       ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2013-01-31 13:06 UTC (permalink / raw)
  To: Fabio Baltieri
  Cc: Viresh Kumar, cpufreq, linux-pm, Linus Walleij, swarren,
	linaro-dev, Nicolas Pitre, mathieu.poirier, Joseph Lo,
	linux-kernel

On Thursday, January 31, 2013 12:06:13 PM Fabio Baltieri wrote:
> On Thu, Jan 31, 2013 at 04:23:06PM +0530, Viresh Kumar wrote:
> > On 30 January 2013 19:23, Fabio Baltieri <fabio.baltieri@linaro.org> wrote:
> > > Drop unused arguments from dbs_timer_init and clean dbs_timer_exit and
> > > cpufreq_governor_dbs to remove non necessary special cases.
> > >
> > > Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
> > > Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
> > 
> > As discussed over IRC, you will fix following in few days:
> > - Code redundancy within governors
> > - Removing second_time: label and cdbs->enable field
> > - Fixing params to timer init and exit to make them more efficient.
> 
> That's the plan, I'd leave it up to Rafael to decide if further cleanup
> patches should be included in 3.9 merge window or skip to the following
> one... I understand that we are starting to be late on the -rc and I
> also prefer to focus on fixup.

The deadline for 3.9 merge window patches is about 2 days before 3.8-rc7
(assuming that there will be -rc7) and by that time they need to be in
linux-next.  Whatever doesn't make it will have to go after 3.9-rc1 or be
postponed until the 3.10 merge window.

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH] cpufreq: governors: clean timer init and exit code
  2013-01-31 13:06     ` Rafael J. Wysocki
@ 2013-02-01  3:54       ` Viresh Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2013-02-01  3:54 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Fabio Baltieri, cpufreq, linux-pm, Linus Walleij, swarren,
	linaro-dev, Nicolas Pitre, mathieu.poirier, Joseph Lo,
	linux-kernel

On 31 January 2013 18:36, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Thursday, January 31, 2013 12:06:13 PM Fabio Baltieri wrote:
>> On Thu, Jan 31, 2013 at 04:23:06PM +0530, Viresh Kumar wrote:

>> > As discussed over IRC, you will fix following in few days:
>> > - Code redundancy within governors
>> > - Removing second_time: label and cdbs->enable field
>> > - Fixing params to timer init and exit to make them more efficient.
>>
>> That's the plan, I'd leave it up to Rafael to decide if further cleanup
>> patches should be included in 3.9 merge window or skip to the following
>> one... I understand that we are starting to be late on the -rc and I
>> also prefer to focus on fixup.
>
> The deadline for 3.9 merge window patches is about 2 days before 3.8-rc7
> (assuming that there will be -rc7) and by that time they need to be in
> linux-next.  Whatever doesn't make it will have to go after 3.9-rc1 or be
> postponed until the 3.10 merge window.

For everybody else, i have patched above in a different patchset.

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

end of thread, other threads:[~2013-02-01  3:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 13:53 [PATCH] cpufreq: governors: clean timer init and exit code Fabio Baltieri
2013-01-31 10:53 ` Viresh Kumar
2013-01-31 11:06   ` Fabio Baltieri
2013-01-31 13:06     ` Rafael J. Wysocki
2013-02-01  3:54       ` 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).