Skip to contentSkip to conversation

return error when failing to set minfreq

PATCH In review Mattia Dongili 2 participants 2 messages Jul 5, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 return error when failing to set minfreq

Hello,

I'm resending this patch that probably has been lost in deep space. It got the signed-off by Dominik before:
http://lists.linux.org.uk/mailman/private/cpufreq/2006-June/005916.html
The same message contains a detailed explanation of the problem it fixes.
Rediffed against 2.6.17-mm6.

Description:
return -EINVAL if trying to increase frequencies starting from scaling_min_freq and documents the correct ordering of writes.

Signature · 2 lines
mattia
:wq!
Documentation/cpu-freq/user-guide.txt +4 -1
index 7fedc00..555c8cf 100644
@@ -153,10 +153,13 @@ scaling_governor,		and by "echoing" the 
 				that some governors won't load - they only
 				work on some specific architectures or
 				processors.
-scaling_min_freq and 
+scaling_min_freq and
 scaling_max_freq		show the current "policy limits" (in
 				kHz). By echoing new values into these
 				files, you can change these limits.
+				NOTE: when setting a policy you need to
+				first set scaling_max_freq, then
+				scaling_min_freq.
 
 
 If you have selected the "userspace" governor which allows you to
drivers/cpufreq/cpufreq.c +5 -0
index 1ba4039..deea3e0 100644
@@ -1348,6 +1348,11 @@ static int __cpufreq_set_policy(struct c
 
 	memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo));
 
+	if (policy->min > data->min && policy->min > policy->max) {
+		ret = -EINVAL;
+		goto error_out;
+	}
+
 	/* verify the cpu speed can be set within this limit */
 	ret = cpufreq_driver->verify(policy);
 	if (ret)

_______________________________________________
Cpufreq mailing list
[email protected]
http://lists.linux.org.uk/mailman/listinfo/cpufreq

#1 lore raw
Quoted 6 lines · Mattia Dongili

I'm resending this patch that probably has been lost in deep space. It got the signed-off by Dominik before:
http://lists.linux.org.uk/mailman/private/cpufreq/2006-June/005916.html
The same message contains a detailed explanation of the problem it fixes.
Rediffed against 2.6.17-mm6.

Applied.
(After de-MIME'ing your mail by hand, which is possibly why it got
dropped last time, though I usually send out grumbles when that happens as git-applymbox barfs on MIMEs.)

Dave

Signature · 1 line
http://www.codemonkey.org.uk