summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Forlin <per.forlin@stericsson.com>2011-10-04 21:51:13 +0200
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-27 16:08:34 +0200
commit9a83612d9ecaed99fb658866b33bf39da4f962b0 (patch)
treed591411177863f7a1f511f70ffbce81e5b81a68d
parentfb5d78ebe2b2274308ad77eddb664a503de95dbc (diff)
ux500: pm: prevent sleep during high wlan load
The system wake up latency from sleep adds an extra overhead when running wlan in DMA mode. This is not the case for PIO since the CPU usage prevents the system from going to sleep. ST-Ericsson ID: 357764 ST-Ericsson FOSS-OUT ID: Trivial ST-Ericsson Linux next: NA Change-Id: Ib3ac10da61ca9f3d9db4956a29fb694bd2c416cc Signed-off-by: Per Forlin <per.forlin@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33008 Reviewed-by: QABUILD Reviewed-by: Johan RUDHOLM <johan.rudholm@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/pm/performance.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/arch/arm/mach-ux500/pm/performance.c b/arch/arm/mach-ux500/pm/performance.c
index 4f9fe381fd9..e919e01614c 100644
--- a/arch/arm/mach-ux500/pm/performance.c
+++ b/arch/arm/mach-ux500/pm/performance.c
@@ -16,6 +16,7 @@
#include <linux/kernel.h>
#include <linux/mfd/dbx500-prcmu.h>
#include <linux/cpu.h>
+#include <linux/pm_qos_params.h>
#include <mach/irqs.h>
@@ -47,6 +48,8 @@
static struct delayed_work work_mmc;
static struct delayed_work work_wlan_workaround;
+static struct pm_qos_request_list wlan_pm_qos_latency;
+static bool wlan_pm_qos_is_latency_0;
static void wlan_load(struct work_struct *work)
{
@@ -58,12 +61,31 @@ static void wlan_load(struct work_struct *work)
num_irqs += kstat_irqs_cpu(IRQ_DB8500_SDMMC1, cpu);
if ((num_irqs > old_num_irqs) &&
- (num_irqs - old_num_irqs) > WLAN_LIMIT)
+ (num_irqs - old_num_irqs) > WLAN_LIMIT) {
prcmu_qos_update_requirement(PRCMU_QOS_ARM_OPP,
"wlan", 125);
- else
+ if (!wlan_pm_qos_is_latency_0) {
+ /*
+ * The wake up latency is set to 0 to prevent
+ * the system from going to sleep. This improves
+ * the wlan throughput in DMA mode.
+ * The wake up latency from sleep adds ~5% overhead
+ * for TX in some cases.
+ * This change doesn't increase performance for wlan
+ * PIO since the CPU usage prevents sleep in this mode.
+ */
+ pm_qos_add_request(&wlan_pm_qos_latency,
+ PM_QOS_CPU_DMA_LATENCY, 0);
+ wlan_pm_qos_is_latency_0 = true;
+ }
+ } else {
prcmu_qos_update_requirement(PRCMU_QOS_ARM_OPP,
"wlan", 25);
+ if (wlan_pm_qos_is_latency_0) {
+ pm_qos_remove_request(&wlan_pm_qos_latency);
+ wlan_pm_qos_is_latency_0 = false;
+ }
+ }
old_num_irqs = num_irqs;