PM: drop clocks_off_while_idle
cover PM: drop clocks_off_while_idle
The sysfs control /sys/power/clocks_off_while_idle only affects the UART clocks. And these can now be controlled with a UART specific timeout sysfs control. The system default behavior is to have the equivalent of clocks_off_while_idle == 1 and a UART inactivity timeout of 5 seconds.
Now one can use
/sys/devices/platform/serial8250.<uart>/sleep_timeout
to set the inactivity timer for the UART in seconds. Setting this value to zero disables the timout and is the equivalent of doing an
echo 0 > /sys/power/clocks_off_while_idle
Kevin Hilman (2):
OMAP: PM: UART: zero sleep_timeout will disable timeout feature OMAP2/3: PM: remove /sys/power/clocks_off_while_idle
arch/arm/mach-omap2/pm.c | 12 ------------ arch/arm/mach-omap2/pm.h | 1 - arch/arm/mach-omap2/serial.c | 16 +++++++++++----- 3 files changed, 11 insertions(+), 18 deletions(-)
PATCH 1/2 OMAP: PM: UART: zero sleep_timeout will disable timeout feature
Writing zero to /sys/devices/platform/serial8250.<uart>/sleep_timeout will disable the timeout feature and prevent UART clocks from being disabled.
--- arch/arm/mach-omap2/serial.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/serial.c +11 -2
@@ -235,7 +235,10 @@ static void omap_uart_block_sleep(struct omap_uart_state *uart)omap_uart_smart_idle_enable (uart,0 ); uart->can_sleep =0 ; -mod_timer (&uart->timer, jiffies + uart->timeout); +if (uart->timeout) +mod_timer (&uart->timer, jiffies + uart->timeout); +else +del_timer (&uart->timer); }static void omap_uart_allow_sleep (struct omap_uart_state *uart)
@@ -465,8 +468,14 @@ static ssize_t sleep_timeout_store(struct kobject *kobj,return -EINVAL ; } sleep_timeout = value *HZ ; -list_for_each_entry (uart, &uart_list, node) +list_for_each_entry (uart, &uart_list, node) { uart->timeout = sleep_timeout; +if (uart->timeout) +mod_timer (&uart->timer, jiffies + uart->timeout); +else +/* A zero value means disable timeout feature */ +omap_uart_block_sleep (uart); + }return n; }
Signature · 1 line
1.6.2.2
PATCH 2/2 OMAP2/3: PM: remove /sys/power/clocks_off_while_idle
The sysfs control /sys/power/clocks_off_while_idle only affects the UART clocks. And these can now be controlled with a UART specific timeout sysfs control. The system default behavior is to have the equivalent of clocks_off_while_idle == 1 and a UART inactivity timeout of 5 seconds.
Now one can use
/sys/devices/platform/serial8250.<uart>/sleep_timeout
to set the inactivity timer for the UART in seconds. Setting this value to zero disables the timout and is the equivalent of doing an
echo 0 > /sys/power/clocks_off_while_idle
--- arch/arm/mach-omap2/pm.c | 12 ------------ arch/arm/mach-omap2/pm.h | 1 - arch/arm/mach-omap2/serial.c | 3 --- 3 files changed, 0 insertions(+), 16 deletions(-)
arch/arm/mach-omap2/pm.c +0 -12
@@ -39,7 +39,6 @@#include "pm.h" unsigned short enable_dyn_sleep; -unsigned short clocks_off_while_idle;unsigned short enable_off_mode;unsigned short voltage_off_while_idle;unsigned short wakeup_timer_seconds;
@@ -52,9 +51,6 @@ static ssize_t idle_store(struct kobject *k, struct kobj_attribute *,static struct kobj_attribute sleep_while_idle_attr =__ATTR (sleep_while_idle,0644 , idle_show, idle_store); -static struct kobj_attribute clocks_off_while_idle_attr = -__ATTR (clocks_off_while_idle,0644 , idle_show, idle_store); -static struct kobj_attribute enable_off_mode_attr =__ATTR (enable_off_mode,0644 , idle_show, idle_store);
@@ -85,8 +81,6 @@ static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, {if (attr == &sleep_while_idle_attr)return sprintf (buf,"%hu\n" , enable_dyn_sleep); -else if (attr == &clocks_off_while_idle_attr) -return sprintf (buf,"%hu\n" , clocks_off_while_idle);else if (attr == &enable_off_mode_attr)return sprintf (buf,"%hu\n" , enable_off_mode);else if (attr == &voltage_off_while_idle_attr)
@@ -109,8 +103,6 @@ static ssize_t idle_store(struct kobject *kobj, struct kobj_attribute *attr,if (attr == &sleep_while_idle_attr) { enable_dyn_sleep = value; - }else if (attr == &clocks_off_while_idle_attr) { - clocks_off_while_idle = value; }else if (attr == &enable_off_mode_attr) { enable_off_mode = value;omap3_pm_off_mode_enable (enable_off_mode);
@@ -255,10 +247,6 @@ static int __init omap_pm_init(void)if (error)printk (KERN_ERR "sysfs_create_file failed: %d\n" , error); error =sysfs_create_file (power_kobj, - &clocks_off_while_idle_attr.attr); -if (error) -printk (KERN_ERR "sysfs_create_file failed: %d\n" , error); - error =sysfs_create_file (power_kobj, &enable_off_mode_attr.attr);if (error) {printk (KERN_ERR "sysfs_create_file failed: %d\n" , error);
arch/arm/mach-omap2/pm.h +0 -1
@@ -24,7 +24,6 @@ static inline int omap3_idle_init(void) { return 0; }#endif extern unsigned short enable_dyn_sleep; -extern unsigned short clocks_off_while_idle;extern unsigned short enable_off_mode;extern unsigned short voltage_off_while_idle;extern atomic_t sleep_block;
arch/arm/mach-omap2/serial.c +0 -3
@@ -263,9 +263,6 @@ void omap_uart_prepare_idle(int num)struct omap_uart_state *uart;list_for_each_entry (uart, &uart_list, node) { -if (!clocks_off_while_idle) -continue ; -if (num == uart->num && uart->can_sleep) {omap_uart_disable_clocks (uart);return ;
Signature · 1 line
1.6.2.2
Tony Lindgren
maintainerRe: [PATCH 2/2] OMAP2/3: PM: remove /sys/power/clocks_off_while_idle
Quoted 8 lines · Kevin Hilman
The sysfs control
/sys/power/clocks_off_while_idleonly affects the UART clocks. And these can now be controlled with a UART specific timeout sysfs control. The system default behavior is to have the equivalent ofclocks_off_while_idle== 1 and a UART inactivity timeout of 5 seconds.Now one can use
Quoted 7 lines
/sys/devices/platform/serial8250.<uart>/sleep_timeout
to set the inactivity timer for the UART in seconds. Setting this value to zero disables the timout and is the equivalent of doing an
echo 0 >
/sys/power/clocks_off_while_idle
Sounds like a nice improvment to me!
Tony
Quoted 92 lines
Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/pm.c | 12 ------------ arch/arm/mach-omap2/pm.h | 1 - arch/arm/mach-omap2/serial.c | 3 --- 3 files changed, 0 insertions(+), 16 deletions(-)arch/arm/mach-omap2/pm.c +0
-12@@ -39,7 +39,6 @@#include "pm.h" unsigned short enable_dyn_sleep; -unsigned short clocks_off_while_idle;unsigned short enable_off_mode;unsigned short voltage_off_while_idle;unsigned short wakeup_timer_seconds;@@ -52,9 +51,6 @@ static ssize_t idle_store(struct kobject *k, struct kobj_attribute *,static struct kobj_attribute sleep_while_idle_attr =__ATTR (sleep_while_idle,0644 , idle_show, idle_store); -static struct kobj_attribute clocks_off_while_idle_attr = -__ATTR (clocks_off_while_idle,0644 , idle_show, idle_store); -static struct kobj_attribute enable_off_mode_attr =__ATTR (enable_off_mode,0644 , idle_show, idle_store);@@ -85,8 +81,6 @@ static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, {if (attr == &sleep_while_idle_attr)return sprintf (buf,"%hu\n" , enable_dyn_sleep); -else if (attr == &clocks_off_while_idle_attr) -return sprintf (buf,"%hu\n" , clocks_off_while_idle);else if (attr == &enable_off_mode_attr)return sprintf (buf,"%hu\n" , enable_off_mode);else if (attr == &voltage_off_while_idle_attr)@@ -109,8 +103,6 @@ static ssize_t idle_store(struct kobject *kobj, struct kobj_attribute *attr,if (attr == &sleep_while_idle_attr) { enable_dyn_sleep = value; - }else if (attr == &clocks_off_while_idle_attr) { - clocks_off_while_idle = value; }else if (attr == &enable_off_mode_attr) { enable_off_mode = value;omap3_pm_off_mode_enable (enable_off_mode);@@ -255,10 +247,6 @@ static int __init omap_pm_init(void)if (error)printk (KERN_ERR "sysfs_create_file failed: %d\n" , error); error =sysfs_create_file (power_kobj, - &clocks_off_while_idle_attr.attr); -if (error) -printk (KERN_ERR "sysfs_create_file failed: %d\n" , error); - error =sysfs_create_file (power_kobj, &enable_off_mode_attr.attr);if (error) {printk (KERN_ERR "sysfs_create_file failed: %d\n" , error);arch/arm/mach-omap2/pm.h +0
-1@@ -24,7 +24,6 @@ static inline int omap3_idle_init(void) { return 0; }#endif extern unsigned short enable_dyn_sleep; -extern unsigned short clocks_off_while_idle;extern unsigned short enable_off_mode;extern unsigned short voltage_off_while_idle;extern atomic_t sleep_block;arch/arm/mach-omap2/serial.c +0
-3@@ -263,9 +263,6 @@ void omap_uart_prepare_idle(int num)struct omap_uart_state *uart;list_for_each_entry (uart, &uart_list, node) { -if (!clocks_off_while_idle) -continue ; -if (num == uart->num && uart->can_sleep) {omap_uart_disable_clocks (uart);return ;Signature · 6 lines
1.6.2.2 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Kevin,
Quoted 7 lines
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Kevin Hilman
echo 0 >
/sys/power/clocks_off_while_idleKevin Hilman (2):
For PM branch are you keeping any kind of running readme file for inclusion in Documentation directory? It would be pretty useful to capture interface changes.
Regards,
Richard W.
Quoted 5 lines · Richard
Kevin,
Quoted 2 lines
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Kevin Hilman
Quoted 7 lines
Quoted 3 lines
echo 0 >
/sys/power/clocks_off_while_idleFor PM branch are you keeping any kind of running readme file for inclusion in Documentation directory? It would be pretty useful to capture interface changes.
No. Nothing in-kernel at the moment as this is all work-in-progress and changing.
However, Vikram and company are mostly done with a Wiki page on omapzoom.org that documents all the sysfs knobs and other debugging techniques.
Kevin
Quoted 8 lines · Kevin Hilman
The sysfs control
/sys/power/clocks_off_while_idleonly affects the UART clocks. And these can now be controlled with a UART specific timeout sysfs control. The system default behavior is to have the equivalent ofclocks_off_while_idle== 1 and a UART inactivity timeout of 5 seconds.Now one can use
Quoted 9 lines
/sys/devices/platform/serial8250.<uart>/sleep_timeout
to set the inactivity timer for the UART in seconds. Setting this value to zero disables the timout and is the equivalent of doing an
echo 0 >
/sys/power/clocks_off_while_idle
Pushing this series to the PM branch.
Kevin