msm: sdio_dmux: Pin read workqueue to CPU0
Pin read workqueue to CPU0 to avoid getting scheduled
on CPU1 which may be running at a lower clock rate
which reduces throughput.
CRs-Fixed: 308115
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
diff --git a/arch/arm/mach-msm/sdio_dmux.c b/arch/arm/mach-msm/sdio_dmux.c
index ea3382e..71b4e9b 100644
--- a/arch/arm/mach-msm/sdio_dmux.c
+++ b/arch/arm/mach-msm/sdio_dmux.c
@@ -25,6 +25,8 @@
#include <linux/skbuff.h>
#include <linux/wakelock.h>
#include <linux/debugfs.h>
+#include <linux/smp.h>
+#include <linux/cpumask.h>
#include <mach/sdio_al.h>
#include <mach/sdio_dmux.h>
@@ -304,6 +306,19 @@
void *ptr = 0;
int sz, rc, len = 0;
struct sdio_mux_hdr *hdr;
+ static int workqueue_pinned;
+
+ if (!workqueue_pinned) {
+ struct cpumask cpus;
+
+ cpumask_clear(&cpus);
+ cpumask_set_cpu(0, &cpus);
+
+ if (sched_setaffinity(current->pid, &cpus))
+ pr_err("%s: sdio_dmux set CPU affinity failed\n",
+ __func__);
+ workqueue_pinned = 1;
+ }
DBG("%s: reading\n", __func__);
/* should probably have a separate read lock */