* [PATCH 0/2] PM: drop clocks_off_while_idle
@ 2009-05-19 17:14 Kevin Hilman
2009-05-19 17:14 ` [PATCH 1/2] OMAP: PM: UART: zero sleep_timeout will disable timeout feature Kevin Hilman
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Kevin Hilman @ 2009-05-19 17:14 UTC (permalink / raw)
To: linux-omap
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(-)
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/2] OMAP: PM: UART: zero sleep_timeout will disable timeout feature 2009-05-19 17:14 [PATCH 0/2] PM: drop clocks_off_while_idle Kevin Hilman @ 2009-05-19 17:14 ` Kevin Hilman 2009-05-19 17:14 ` [PATCH 2/2] OMAP2/3: PM: remove /sys/power/clocks_off_while_idle Kevin Hilman 2009-05-19 22:40 ` [PATCH 0/2] PM: drop clocks_off_while_idle Woodruff, Richard 2009-05-20 16:12 ` Kevin Hilman 2 siblings, 1 reply; 7+ messages in thread From: Kevin Hilman @ 2009-05-19 17:14 UTC (permalink / raw) To: linux-omap Writing zero to /sys/devices/platform/serial8250.<uart>/sleep_timeout will disable the timeout feature and prevent UART clocks from being disabled. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> --- arch/arm/mach-omap2/serial.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 0762165..c9059fd 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -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; } -- 1.6.2.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] OMAP2/3: PM: remove /sys/power/clocks_off_while_idle 2009-05-19 17:14 ` [PATCH 1/2] OMAP: PM: UART: zero sleep_timeout will disable timeout feature Kevin Hilman @ 2009-05-19 17:14 ` Kevin Hilman 2009-05-19 17:16 ` Tony Lindgren 0 siblings, 1 reply; 7+ messages in thread From: Kevin Hilman @ 2009-05-19 17:14 UTC (permalink / raw) To: linux-omap 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 Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> --- 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(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 58ed520..8633f86 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -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); diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index e523d75..2547e1b 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -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; diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index c9059fd..8c27700 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -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; -- 1.6.2.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] OMAP2/3: PM: remove /sys/power/clocks_off_while_idle 2009-05-19 17:14 ` [PATCH 2/2] OMAP2/3: PM: remove /sys/power/clocks_off_while_idle Kevin Hilman @ 2009-05-19 17:16 ` Tony Lindgren 0 siblings, 0 replies; 7+ messages in thread From: Tony Lindgren @ 2009-05-19 17:16 UTC (permalink / raw) To: Kevin Hilman; +Cc: linux-omap * Kevin Hilman <khilman@deeprootsystems.com> [090519 10:15]: > 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 Sounds like a nice improvment to me! Tony > > Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> > --- > 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(-) > > diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c > index 58ed520..8633f86 100644 > --- a/arch/arm/mach-omap2/pm.c > +++ b/arch/arm/mach-omap2/pm.c > @@ -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); > diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h > index e523d75..2547e1b 100644 > --- a/arch/arm/mach-omap2/pm.h > +++ b/arch/arm/mach-omap2/pm.h > @@ -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; > diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c > index c9059fd..8c27700 100644 > --- a/arch/arm/mach-omap2/serial.c > +++ b/arch/arm/mach-omap2/serial.c > @@ -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; > -- > 1.6.2.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 0/2] PM: drop clocks_off_while_idle 2009-05-19 17:14 [PATCH 0/2] PM: drop clocks_off_while_idle Kevin Hilman 2009-05-19 17:14 ` [PATCH 1/2] OMAP: PM: UART: zero sleep_timeout will disable timeout feature Kevin Hilman @ 2009-05-19 22:40 ` Woodruff, Richard 2009-05-19 22:58 ` Kevin Hilman 2009-05-20 16:12 ` Kevin Hilman 2 siblings, 1 reply; 7+ messages in thread From: Woodruff, Richard @ 2009-05-19 22:40 UTC (permalink / raw) To: Kevin Hilman, linux-omap@vger.kernel.org Kevin, > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > owner@vger.kernel.org] On Behalf Of Kevin Hilman > echo 0 > /sys/power/clocks_off_while_idle > > > Kevin 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] PM: drop clocks_off_while_idle 2009-05-19 22:40 ` [PATCH 0/2] PM: drop clocks_off_while_idle Woodruff, Richard @ 2009-05-19 22:58 ` Kevin Hilman 0 siblings, 0 replies; 7+ messages in thread From: Kevin Hilman @ 2009-05-19 22:58 UTC (permalink / raw) To: Woodruff, Richard; +Cc: linux-omap@vger.kernel.org "Woodruff, Richard" <r-woodruff2@ti.com> writes: > Kevin, > >> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- >> owner@vger.kernel.org] On Behalf Of Kevin Hilman > >> echo 0 > /sys/power/clocks_off_while_idle >> >> > > 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. 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] PM: drop clocks_off_while_idle 2009-05-19 17:14 [PATCH 0/2] PM: drop clocks_off_while_idle Kevin Hilman 2009-05-19 17:14 ` [PATCH 1/2] OMAP: PM: UART: zero sleep_timeout will disable timeout feature Kevin Hilman 2009-05-19 22:40 ` [PATCH 0/2] PM: drop clocks_off_while_idle Woodruff, Richard @ 2009-05-20 16:12 ` Kevin Hilman 2 siblings, 0 replies; 7+ messages in thread From: Kevin Hilman @ 2009-05-20 16:12 UTC (permalink / raw) To: linux-omap Kevin Hilman <khilman@deeprootsystems.com> writes: > 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 > > Pushing this series to the PM branch. Kevin ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-05-20 16:12 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-05-19 17:14 [PATCH 0/2] PM: drop clocks_off_while_idle Kevin Hilman 2009-05-19 17:14 ` [PATCH 1/2] OMAP: PM: UART: zero sleep_timeout will disable timeout feature Kevin Hilman 2009-05-19 17:14 ` [PATCH 2/2] OMAP2/3: PM: remove /sys/power/clocks_off_while_idle Kevin Hilman 2009-05-19 17:16 ` Tony Lindgren 2009-05-19 22:40 ` [PATCH 0/2] PM: drop clocks_off_while_idle Woodruff, Richard 2009-05-19 22:58 ` Kevin Hilman 2009-05-20 16:12 ` Kevin Hilman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox