diff options
author | Mark Gross <mgross@linux.intel.com> | 2008-02-05 01:30:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:22 -0500 |
commit | f011e2e2df3393c16b0fdc48e855e909b7e021ee (patch) | |
tree | 1ad56011597c739336d7068c8182fd9cfdddad5b /drivers | |
parent | d82b35186eaa816267f044bd70cc0acb3c7971a3 (diff) |
latency.c: use QoS infrastructure
Replace latency.c use with pm_qos_params use.
Signed-off-by: mark gross <mgross@linux.intel.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/processor_idle.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 12 |
2 files changed, 18 insertions, 12 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index eb1f82f79153..199ea2146153 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <linux/dmi.h> | 38 | #include <linux/dmi.h> |
39 | #include <linux/moduleparam.h> | 39 | #include <linux/moduleparam.h> |
40 | #include <linux/sched.h> /* need_resched() */ | 40 | #include <linux/sched.h> /* need_resched() */ |
41 | #include <linux/latency.h> | 41 | #include <linux/pm_qos_params.h> |
42 | #include <linux/clockchips.h> | 42 | #include <linux/clockchips.h> |
43 | #include <linux/cpuidle.h> | 43 | #include <linux/cpuidle.h> |
44 | 44 | ||
@@ -648,7 +648,8 @@ static void acpi_processor_idle(void) | |||
648 | if (cx->promotion.state && | 648 | if (cx->promotion.state && |
649 | ((cx->promotion.state - pr->power.states) <= max_cstate)) { | 649 | ((cx->promotion.state - pr->power.states) <= max_cstate)) { |
650 | if (sleep_ticks > cx->promotion.threshold.ticks && | 650 | if (sleep_ticks > cx->promotion.threshold.ticks && |
651 | cx->promotion.state->latency <= system_latency_constraint()) { | 651 | cx->promotion.state->latency <= |
652 | pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)) { | ||
652 | cx->promotion.count++; | 653 | cx->promotion.count++; |
653 | cx->demotion.count = 0; | 654 | cx->demotion.count = 0; |
654 | if (cx->promotion.count >= | 655 | if (cx->promotion.count >= |
@@ -692,7 +693,8 @@ static void acpi_processor_idle(void) | |||
692 | * or if the latency of the current state is unacceptable | 693 | * or if the latency of the current state is unacceptable |
693 | */ | 694 | */ |
694 | if ((pr->power.state - pr->power.states) > max_cstate || | 695 | if ((pr->power.state - pr->power.states) > max_cstate || |
695 | pr->power.state->latency > system_latency_constraint()) { | 696 | pr->power.state->latency > |
697 | pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)) { | ||
696 | if (cx->demotion.state) | 698 | if (cx->demotion.state) |
697 | next_state = cx->demotion.state; | 699 | next_state = cx->demotion.state; |
698 | } | 700 | } |
@@ -1200,7 +1202,7 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | |||
1200 | "maximum allowed latency: %d usec\n", | 1202 | "maximum allowed latency: %d usec\n", |
1201 | pr->power.state ? pr->power.state - pr->power.states : 0, | 1203 | pr->power.state ? pr->power.state - pr->power.states : 0, |
1202 | max_cstate, (unsigned)pr->power.bm_activity, | 1204 | max_cstate, (unsigned)pr->power.bm_activity, |
1203 | system_latency_constraint()); | 1205 | pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)); |
1204 | 1206 | ||
1205 | seq_puts(seq, "states:\n"); | 1207 | seq_puts(seq, "states:\n"); |
1206 | 1208 | ||
@@ -1718,8 +1720,9 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, | |||
1718 | "ACPI: processor limited to max C-state %d\n", | 1720 | "ACPI: processor limited to max C-state %d\n", |
1719 | max_cstate); | 1721 | max_cstate); |
1720 | first_run++; | 1722 | first_run++; |
1721 | #if !defined (CONFIG_CPU_IDLE) && defined (CONFIG_SMP) | 1723 | #if !defined(CONFIG_CPU_IDLE) && defined(CONFIG_SMP) |
1722 | register_latency_notifier(&acpi_processor_latency_notifier); | 1724 | pm_qos_add_notifier(PM_QOS_CPU_DMA_LATENCY, |
1725 | &acpi_processor_latency_notifier); | ||
1723 | #endif | 1726 | #endif |
1724 | } | 1727 | } |
1725 | 1728 | ||
@@ -1806,7 +1809,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr, | |||
1806 | */ | 1809 | */ |
1807 | cpu_idle_wait(); | 1810 | cpu_idle_wait(); |
1808 | #ifdef CONFIG_SMP | 1811 | #ifdef CONFIG_SMP |
1809 | unregister_latency_notifier(&acpi_processor_latency_notifier); | 1812 | pm_qos_remove_notifier(PM_QOS_CPU_DMA_LATENCY, |
1813 | &acpi_processor_latency_notifier); | ||
1810 | #endif | 1814 | #endif |
1811 | } | 1815 | } |
1812 | #endif | 1816 | #endif |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 2ab107f45793..5bf9e00b070c 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -162,7 +162,7 @@ that only one external action is invoked at a time. | |||
162 | #include <linux/firmware.h> | 162 | #include <linux/firmware.h> |
163 | #include <linux/acpi.h> | 163 | #include <linux/acpi.h> |
164 | #include <linux/ctype.h> | 164 | #include <linux/ctype.h> |
165 | #include <linux/latency.h> | 165 | #include <linux/pm_qos_params.h> |
166 | 166 | ||
167 | #include "ipw2100.h" | 167 | #include "ipw2100.h" |
168 | 168 | ||
@@ -1701,7 +1701,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred) | |||
1701 | /* the ipw2100 hardware really doesn't want power management delays | 1701 | /* the ipw2100 hardware really doesn't want power management delays |
1702 | * longer than 175usec | 1702 | * longer than 175usec |
1703 | */ | 1703 | */ |
1704 | modify_acceptable_latency("ipw2100", 175); | 1704 | pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", 175); |
1705 | 1705 | ||
1706 | /* If the interrupt is enabled, turn it off... */ | 1706 | /* If the interrupt is enabled, turn it off... */ |
1707 | spin_lock_irqsave(&priv->low_lock, flags); | 1707 | spin_lock_irqsave(&priv->low_lock, flags); |
@@ -1856,7 +1856,8 @@ static void ipw2100_down(struct ipw2100_priv *priv) | |||
1856 | ipw2100_disable_interrupts(priv); | 1856 | ipw2100_disable_interrupts(priv); |
1857 | spin_unlock_irqrestore(&priv->low_lock, flags); | 1857 | spin_unlock_irqrestore(&priv->low_lock, flags); |
1858 | 1858 | ||
1859 | modify_acceptable_latency("ipw2100", INFINITE_LATENCY); | 1859 | pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", |
1860 | PM_QOS_DEFAULT_VALUE); | ||
1860 | 1861 | ||
1861 | /* We have to signal any supplicant if we are disassociating */ | 1862 | /* We have to signal any supplicant if we are disassociating */ |
1862 | if (associated) | 1863 | if (associated) |
@@ -6554,7 +6555,8 @@ static int __init ipw2100_init(void) | |||
6554 | if (ret) | 6555 | if (ret) |
6555 | goto out; | 6556 | goto out; |
6556 | 6557 | ||
6557 | set_acceptable_latency("ipw2100", INFINITE_LATENCY); | 6558 | pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", |
6559 | PM_QOS_DEFAULT_VALUE); | ||
6558 | #ifdef CONFIG_IPW2100_DEBUG | 6560 | #ifdef CONFIG_IPW2100_DEBUG |
6559 | ipw2100_debug_level = debug; | 6561 | ipw2100_debug_level = debug; |
6560 | ret = driver_create_file(&ipw2100_pci_driver.driver, | 6562 | ret = driver_create_file(&ipw2100_pci_driver.driver, |
@@ -6576,7 +6578,7 @@ static void __exit ipw2100_exit(void) | |||
6576 | &driver_attr_debug_level); | 6578 | &driver_attr_debug_level); |
6577 | #endif | 6579 | #endif |
6578 | pci_unregister_driver(&ipw2100_pci_driver); | 6580 | pci_unregister_driver(&ipw2100_pci_driver); |
6579 | remove_acceptable_latency("ipw2100"); | 6581 | pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100"); |
6580 | } | 6582 | } |
6581 | 6583 | ||
6582 | module_init(ipw2100_init); | 6584 | module_init(ipw2100_init); |