All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight
@ 2013-08-31 17:23 Aaro Koskinen
  2013-08-31 17:23 ` [PATCH v2 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-08-31 17:23 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Benjamin Herrenschmidt,
	linux-pm, linuxppc-dev
  Cc: Aaro Koskinen

Hi,

This is a second version of the patch set sent earlier
(http://marc.info/?t=137461124900005&r=1&w=2) to enable ondemand on
Xserve G5, and also to enable cpufreq on the final iMac G5 (iSight) model.

I changed the second patch to so that it only adds the new latency value
for PowerMac7,2/PowerMac7,3/RackMac3,1.

The only other changes are ACKs from Viresh Kumar to patches 1 & 3.

A.

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


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

* [PATCH v2 1/3] cpufreq: pmac64: speed up frequency switch
  2013-08-31 17:23 [PATCH v2 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
@ 2013-08-31 17:23 ` Aaro Koskinen
  2013-08-31 17:23 ` [PATCH v2 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models Aaro Koskinen
  2013-08-31 17:23 ` [PATCH v2 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model Aaro Koskinen
  2 siblings, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-08-31 17:23 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 7ba4234..674807d 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -141,7 +141,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");
@@ -240,7 +240,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 */
 }
 
 /*
@@ -285,7 +285,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.3.2


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

* [PATCH v2 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models
  2013-08-31 17:23 [PATCH v2 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
  2013-08-31 17:23 ` [PATCH v2 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
@ 2013-08-31 17:23 ` Aaro Koskinen
  2013-08-31 17:23 ` [PATCH v2 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model Aaro Koskinen
  2 siblings, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-08-31 17:23 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 674807d..d3d1995 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -674,8 +674,10 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
 	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.3.2


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

* [PATCH v2 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model
  2013-08-31 17:23 [PATCH v2 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
  2013-08-31 17:23 ` [PATCH v2 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
  2013-08-31 17:23 ` [PATCH v2 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models Aaro Koskinen
@ 2013-08-31 17:23 ` Aaro Koskinen
  2 siblings, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-08-31 17:23 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 d3d1995..699e0a5 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -398,7 +398,8 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
 	/* 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.3.2


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

end of thread, other threads:[~2013-08-31 17:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-31 17:23 [PATCH v2 0/3] cpufreq/ondemand support for Xserve G5 & iMac G5 iSight Aaro Koskinen
2013-08-31 17:23 ` [PATCH v2 1/3] cpufreq: pmac64: speed up frequency switch Aaro Koskinen
2013-08-31 17:23 ` [PATCH v2 2/3] cpufreq: pmac64: provide cpufreq transition latency for older G5 models Aaro Koskinen
2013-08-31 17:23 ` [PATCH v2 3/3] cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model Aaro Koskinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.