From: Todd P. <tp...@mv...> - 2005-03-22 00:55:35
|
Now that DPM extensions for driver scale callbacks and device constraints do not depend on LDM PM data structures, some support for these can be provided when CONFIG_PM=n (although that is expected to be a rare situation). A patch to fixup these follows, thanks -- Todd diff -u linux-2.6.10/drivers/base/power/Makefile linux-2.6.10/drivers/base/power/Makefile --- linux-2.6.10/drivers/base/power/Makefile 2005-03-10 21:26:07.000000000 +0000 +++ linux-2.6.10/drivers/base/power/Makefile 2005-03-21 23:02:11.000000000 +0000 @@ -1,5 +1,5 @@ -obj-y := shutdown.o -obj-$(CONFIG_PM) += main.o suspend.o resume.o runtime.o sysfs.o power-dpm.o +obj-y := shutdown.o power-dpm.o +obj-$(CONFIG_PM) += main.o suspend.o resume.o runtime.o sysfs.o ifeq ($(CONFIG_DEBUG_DRIVER),y) EXTRA_CFLAGS += -DDEBUG diff -u linux-2.6.10/drivers/base/power/power-dpm.c linux-2.6.10/drivers/base/power/power-dpm.c --- linux-2.6.10/drivers/base/power/power-dpm.c 2005-03-10 21:30:56.000000000 +0000 +++ linux-2.6.10/drivers/base/power/power-dpm.c 2005-03-21 23:24:13.000000000 +0000 @@ -155,13 +155,12 @@ * Device constraints */ - +#ifdef CONFIG_DPM LIST_HEAD(dpm_constraints); DECLARE_MUTEX(dpm_constraints_sem); void assert_constraints(struct constraints *constraints) { -#ifdef CONFIG_DPM if (! constraints || constraints->asserted) return; @@ -172,13 +171,11 @@ /* DPM-PM-TODO: Check against DPM state. */ -#endif /* CONFIG_DPM */ } void deassert_constraints(struct constraints *constraints) { -#ifdef CONFIG_DPM if (! constraints || ! constraints->asserted) return; @@ -186,7 +183,6 @@ constraints->asserted = 0; list_del_init(&constraints->entry); up(&dpm_constraints_sem); -#endif /* CONFIG_DPM */ } @@ -196,7 +192,6 @@ static ssize_t constraints_show(struct device * dev, char * buf) { -#ifdef CONFIG_DPM int i, cnt = 0; if (dev->constraints) { @@ -215,15 +210,11 @@ } return cnt; -#else /* CONFIG_DPM */ - return 0; -#endif /* CONFIG_DPM */ } static ssize_t constraints_store(struct device * dev, const char * buf, size_t count) { -#ifdef CONFIG_DPM int num_args, paramid, min, max; int cidx; const char *cp, *paramname; @@ -299,14 +290,21 @@ } return ret < 0 ? ret : count; -#else /* CONFIG_DPM */ - return -EINVAL; -#endif /* CONFIG_DPM */ } DEVICE_ATTR(constraints,S_IWUSR | S_IRUGO, constraints_show,constraints_store); +#else /* CONFIG_DPM */ +void assert_constraints(struct constraints *constraints) +{ +} + +void deassert_constraints(struct constraints *constraints) +{ +} +#endif /* CONFIG_DPM */ + #ifdef CONFIG_DPM /* @@ -410,6 +408,7 @@ int dpm_show_opconstraints(struct dpm_opt *opt, char * buf) { +#ifdef CONFIG_PM struct list_head * entry; int len = 0; @@ -423,6 +422,9 @@ } return len; +#else /* CONFIG_PM */ + return 0; +#endif /* CONFIG_PM */ } #endif /* CONFIG_DPM */ diff -u linux-2.6.10/include/linux/pm.h linux-2.6.10/include/linux/pm.h --- linux-2.6.10/include/linux/pm.h 2005-03-10 21:26:07.000000000 +0000 +++ linux-2.6.10/include/linux/pm.h 2005-03-21 23:08:21.000000000 +0000 @@ -260,17 +260,10 @@ SCALE_POSTCHANGE, }; -#ifdef CONFIG_PM extern void assert_constraints(struct constraints *); extern void deassert_constraints(struct constraints *); extern void power_event(char *eventstr); extern void device_power_event(struct device * dev, char *eventstr); -#else /* CONFIG_PM */ -static inline void assert_constraints(struct constraints *c) {} -static inline void deassert_constraints(struct constraints *c) {} -static inline void power_event(char *eventstr) {} -static inline void device_power_event(struct device * dev, char *eventstr) {} -#endif /* CONFIG_PM */ #endif /* __KERNEL__ */ |
From: Daniel P. <d.p...@gm...> - 2005-03-29 20:20:16
|
Hi all, I've been researching the DPM for omap platform. In my tests I switched the policies created in the dpm-setup-omap1510 script and could realize the frequency switching. I also created some lower frequency OPs - big power savings :-) In my group, I was assigned to make more tests and understand DPM deeply. I have some doubts and appreciate very much if someone can help. -How can I assign an user process to a operating state (task-4, task-3...task, task+3, task+4)? Reading /proc/driver/dpm/stats I see that the system only switches among idle, idle-task and task. How can I start a process in task-4 state for instance? -Is there any user level application or deamon that runs and manage the task assignment, a test policy manager already developed? -Which are the operating points parameters: tc_rate, mpuper_rate and dsp_rate? Thank very much in advance and best regards, Daniel Petrini -- 10LE - Linux Nokia Institute of Tecnology - INdT Manaus - Brazil |
From: Todd P. <tp...@mv...> - 2005-03-30 02:15:05
|
Daniel Petrini wrote: > -How can I assign an user process to a operating state (task-4, > task-3...task, task+3, task+4)? Reading /proc/driver/dpm/stats I see > that the system only switches among idle, idle-task and task. How can > I start a process in task-4 state for instance? Hi Daniel -- In newer code write a task state name to /proc/<pid>/dpmstate: # echo -n "task-4" > /proc/$$/dpmstate # ls # cat /sys/dpm/state/stats state: idle-task ticks: 1996910 times: 13591 state: idle ticks: 749169144 times: 13385 state: sleep ticks: 0 times: 0 state: task-4 ticks: 1287414 times: 121 ... Using older patches there's another, now-deprecated, interface for it: # echo "set_task_state $$ -4" > /proc/driver/dpm/cmd > -Is there any user level application or deamon that runs and manage > the task assignment, a test policy manager already developed? A number of folks have developed application software to manage DPM for their consumer product needs or as a developer tool in Linux development platform product, not sure specifically whether any features regarding task state assignments have been developed, and I don't know that anything is available for general use. If you have ideas on what might be needed for managing task assignments I'm open to suggestions. > -Which are the operating points parameters: tc_rate, mpuper_rate and dsp_rate? OMAP power parameters "tc-div", "per-div", and "dsp-div" refer to the clock divisors that may be set in the ARM CKCTL for these components... the rate associated with these would normally refer to a value computed in conjunction with settings of other upstream clocks (that are divided down per those parameters). Hope that helps, -- Todd |