linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight
@ 2013-09-30 20:44 Aaro Koskinen
  2013-09-30 20:44 ` [PATCH v2 RESEND 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Aaro Koskinen @ 2013-09-30 20:44 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Benjamin Herrenschmidt,
	linux-pm, linuxppc-dev
  Cc: Aaro Koskinen

Hi,

This is a resend of the v2 patchset:

	http://marc.info/?t=137797013200001&r=1&w=2

No changes except rebasing. Any chance to get these into v3.13?

Aaro Koskinen (3):
  cpufreq: pmac64: speed up frequency switch
  cpufreq: pmac64: provide cpufreq transition latency for older G5
    models
  cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model

 drivers/cpufreq/pmac64-cpufreq.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

-- 
1.8.4.rc3

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

* [PATCH v2 RESEND 1/3] cpufreq: pmac64: speed up frequency switch
  2013-09-30 20:44 [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
@ 2013-09-30 20:44 ` Aaro Koskinen
  2013-09-30 20:44 ` [PATCH v2 RESEND 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models Aaro Koskinen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2013-09-30 20:44 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Benjamin Herrenschmidt,
	linux-pm, linuxppc-dev
  Cc: Aaro Koskinen

Some functions on switch path use msleep() which is inaccurate, and
depends on HZ. With HZ=100 msleep(1) takes actually over ten times longer.
Using usleep_range() we get more accurate sleeps.

I measured the "pfunc_slewing_done" polling to take 300us at max (on
2.3GHz dual-processor Xserve G5), so using 500us sleep there should
be fine.

With the patch, g5_switch_freq() duration drops from ~50ms to ~10ms on
Xserve with HZ=100.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/pmac64-cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c
index 3a51ad7..46ae223 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -142,7 +142,7 @@ static void g5_vdnap_switch_volt(int speed_mode)
 		pmf_call_one(pfunc_vdnap0_complete, &args);
 		if (done)
 			break;
-		msleep(1);
+		usleep_range(1000, 1000);
 	}
 	if (done == 0)
 		printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n");
@@ -241,7 +241,7 @@ static void g5_pfunc_switch_volt(int speed_mode)
 		if (pfunc_cpu1_volt_low)
 			pmf_call_one(pfunc_cpu1_volt_low, NULL);
 	}
-	msleep(10); /* should be faster , to fix */
+	usleep_range(10000, 10000); /* should be faster , to fix */
 }
 
 /*
@@ -286,7 +286,7 @@ static int g5_pfunc_switch_freq(int speed_mode)
 		pmf_call_one(pfunc_slewing_done, &args);
 		if (done)
 			break;
-		msleep(1);
+		usleep_range(500, 500);
 	}
 	if (done == 0)
 		printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n");
-- 
1.8.4.rc3

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

* [PATCH v2 RESEND 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models
  2013-09-30 20:44 [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
  2013-09-30 20:44 ` [PATCH v2 RESEND 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
@ 2013-09-30 20:44 ` Aaro Koskinen
  2013-09-30 20:44 ` [PATCH v2 RESEND 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model Aaro Koskinen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2013-09-30 20:44 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Benjamin Herrenschmidt,
	linux-pm, linuxppc-dev
  Cc: Aaro Koskinen

Currently cpufreq ondemand governor cannot used on older G5 models,
because the transition latency is set to CPUFREQ_ETERNAL. Provide a
value based on a measurement on Xserve G5, which happens to be also the
highest allowed latency.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/cpufreq/pmac64-cpufreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c
index 46ae223..0196d60 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -647,8 +647,10 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
 	g5_cpu_freqs[0].frequency = max_freq;
 	g5_cpu_freqs[1].frequency = min_freq;
 
+	/* Based on a measurement on Xserve G5, rounded up. */
+	transition_latency = 10 * NSEC_PER_MSEC;
+
 	/* Set callbacks */
-	transition_latency = CPUFREQ_ETERNAL;
 	g5_switch_volt = g5_pfunc_switch_volt;
 	g5_switch_freq = g5_pfunc_switch_freq;
 	g5_query_freq = g5_pfunc_query_freq;
-- 
1.8.4.rc3

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

* [PATCH v2 RESEND 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model
  2013-09-30 20:44 [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
  2013-09-30 20:44 ` [PATCH v2 RESEND 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
  2013-09-30 20:44 ` [PATCH v2 RESEND 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models Aaro Koskinen
@ 2013-09-30 20:44 ` Aaro Koskinen
  2013-10-01  5:00 ` [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Rafael J. Wysocki
  2013-10-11  4:32 ` Benjamin Herrenschmidt
  4 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2013-09-30 20:44 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Benjamin Herrenschmidt,
	linux-pm, linuxppc-dev
  Cc: Aaro Koskinen

Enable cpufreq on iMac G5 (iSight) model. Tested with the 2.1 GHz version.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/pmac64-cpufreq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c
index 0196d60..6084f9b 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -397,7 +397,8 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
 	/* Check supported platforms */
 	if (of_machine_is_compatible("PowerMac8,1") ||
 	    of_machine_is_compatible("PowerMac8,2") ||
-	    of_machine_is_compatible("PowerMac9,1"))
+	    of_machine_is_compatible("PowerMac9,1") ||
+	    of_machine_is_compatible("PowerMac12,1"))
 		use_volts_smu = 1;
 	else if (of_machine_is_compatible("PowerMac11,2"))
 		use_volts_vdnap = 1;
-- 
1.8.4.rc3

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

* Re: [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight
  2013-09-30 20:44 [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
                   ` (2 preceding siblings ...)
  2013-09-30 20:44 ` [PATCH v2 RESEND 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model Aaro Koskinen
@ 2013-10-01  5:00 ` Rafael J. Wysocki
  2013-10-11  4:32 ` Benjamin Herrenschmidt
  4 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2013-10-01  5:00 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: Viresh Kumar, linux-pm, linuxppc-dev

On Monday, September 30, 2013 11:44:30 PM Aaro Koskinen wrote:
> Hi,
> 
> This is a resend of the v2 patchset:
> 
> 	http://marc.info/?t=137797013200001&r=1&w=2
> 
> No changes except rebasing. Any chance to get these into v3.13?

Well, Ben's ACKs are missing as far as I'm concerned ...

> Aaro Koskinen (3):
>   cpufreq: pmac64: speed up frequency switch
>   cpufreq: pmac64: provide cpufreq transition latency for older G5
>     models
>   cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model
> 
>  drivers/cpufreq/pmac64-cpufreq.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight
  2013-09-30 20:44 [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
                   ` (3 preceding siblings ...)
  2013-10-01  5:00 ` [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Rafael J. Wysocki
@ 2013-10-11  4:32 ` Benjamin Herrenschmidt
  2013-10-16 23:09   ` Rafael J. Wysocki
  4 siblings, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2013-10-11  4:32 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: Rafael J. Wysocki, Viresh Kumar, linuxppc-dev, linux-pm

On Mon, 2013-09-30 at 23:44 +0300, Aaro Koskinen wrote:
> Hi,
> 
> This is a resend of the v2 patchset:
> 
> 	http://marc.info/?t=137797013200001&r=1&w=2
> 
> No changes except rebasing. Any chance to get these into v3.13?

BTW. Ack from me, Rafael feel free to merge these.

Cheers,
Ben.

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

* Re: [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight
  2013-10-11  4:32 ` Benjamin Herrenschmidt
@ 2013-10-16 23:09   ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2013-10-16 23:09 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Viresh Kumar, linux-pm, linuxppc-dev, Aaro Koskinen

On Friday, October 11, 2013 03:32:15 PM Benjamin Herrenschmidt wrote:
> On Mon, 2013-09-30 at 23:44 +0300, Aaro Koskinen wrote:
> > Hi,
> > 
> > This is a resend of the v2 patchset:
> > 
> > 	http://marc.info/?t=137797013200001&r=1&w=2
> > 
> > No changes except rebasing. Any chance to get these into v3.13?
> 
> BTW. Ack from me, Rafael feel free to merge these.

Queued up for 3.13, sorry for the delay.

Thanks!

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

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

end of thread, other threads:[~2013-10-16 22:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-30 20:44 [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
2013-09-30 20:44 ` [PATCH v2 RESEND 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
2013-09-30 20:44 ` [PATCH v2 RESEND 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models Aaro Koskinen
2013-09-30 20:44 ` [PATCH v2 RESEND 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model Aaro Koskinen
2013-10-01  5:00 ` [PATCH v2 RESEND 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Rafael J. Wysocki
2013-10-11  4:32 ` Benjamin Herrenschmidt
2013-10-16 23:09   ` Rafael J. Wysocki

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).