From: Dominik Brodowski <linux@brodo.de>
To: cpufreq@www.linux.org.uk
Subject: [RFC] cpufreq_driver->resume
Date: Tue, 2 Sep 2003 10:32:27 +0200 [thread overview]
Message-ID: <20030902083227.GB3958@brodo.de> (raw)
diff -ruN linux-original/Documentation/cpu-freq/cpu-drivers.txt linux/Documentation/cpu-freq/cpu-drivers.txt
--- linux-original/Documentation/cpu-freq/cpu-drivers.txt 2003-09-02 08:55:01.896637296 +0200
+++ linux/Documentation/cpu-freq/cpu-drivers.txt 2003-09-02 08:53:16.908597904 +0200
@@ -64,6 +64,12 @@
cpufreq_driver.exit - A pointer to a per-CPU cleanup function.
+cpufreq_driver.resume - A pointer to a per-CPU resume function
+ which is called with interrupts disabled
+ and _before_ the pre-suspend frequency
+ and/or policy is restored by a call to
+ ->target or ->setpolicy.
+
cpufreq_driver.attr - A pointer to a NULL-terminated list of
"struct freq_attr" which allow to
export values to sysfs.
diff -ruN linux-original/drivers/cpufreq/cpufreq.c linux/drivers/cpufreq/cpufreq.c
--- linux-original/drivers/cpufreq/cpufreq.c 2003-09-02 08:55:01.897637144 +0200
+++ linux/drivers/cpufreq/cpufreq.c 2003-09-02 08:55:44.440169696 +0200
@@ -493,6 +493,13 @@
if (!cpu_policy)
return -EINVAL;
+ if (cpufreq_driver->resume)
+ ret = cpufreq_driver->resume(cpu_policy);
+ if (ret) {
+ printk(KERN_ERR "cpufreq: resume failed in ->resume step on CPU %u\n", cpu_policy->cpu);
+ goto out;
+ }
+
if (cpufreq_driver->setpolicy)
ret = cpufreq_driver->setpolicy(cpu_policy);
else
@@ -501,6 +508,12 @@
*/
ret = cpufreq_driver->target(cpu_policy, cpu_policy->cur, CPUFREQ_RELATION_H);
+ if (ret) {
+ printk(KERN_ERR "cpufreq: resume failed in ->setpolicy/target step on CPU %u\n", cpu_policy->cpu);
+ goto out;
+ }
+
+ out:
cpufreq_cpu_put(cpu_policy);
return ret;
diff -ruN linux-original/include/linux/cpufreq.h linux/include/linux/cpufreq.h
--- linux-original/include/linux/cpufreq.h 2003-09-02 08:55:01.897637144 +0200
+++ linux/include/linux/cpufreq.h 2003-09-02 08:50:16.363045000 +0200
@@ -179,6 +179,7 @@
/* optional */
int (*exit) (struct cpufreq_policy *policy);
+ int (*resume) (struct cpufreq_policy *policy);
struct freq_attr **attr;
};
next reply other threads:[~2003-09-02 8:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-02 8:32 Dominik Brodowski [this message]
2003-09-02 11:08 ` [RFC] cpufreq_driver->resume Dave Jones
2003-09-02 13:41 ` Dominik Brodowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030902083227.GB3958@brodo.de \
--to=linux@brodo.de \
--cc=cpufreq@www.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox