net: wireless: bcmdhd: bump thread priority
Bibhay Ranjan [Fri, 4 Sep 2015 09:03:47 +0000 (14:03 +0530)]
For the latency sensitive data on wifi, the
thread priority needs to be increased.

Bug 200122028

Change-Id: Ia350ecb6f78fac7a5397296a8549b7dd845b374b
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/794246
(cherry picked from commit d715d1ebd108c9d94e631be31ece18a967e12bfd)
Reviewed-on: http://git-master/r/798614
(cherry picked from commit 40b64cd8a5b6b4f10a78a8c0f4385ff467d0d4ef)
Reviewed-on: http://git-master/r/831239
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

drivers/net/wireless/bcmdhd/dhd_linux.c

index c533a69..8cc1767 100644 (file)
@@ -85,6 +85,8 @@
 #include <dhd_bus.h>
 #include <dhd_proto.h>
 #include <dhd_dbg.h>
+/* Used for the bottom half, so same priority as the other irqthread */
+#define DHD_DEFAULT_RT_PRIORITY (MAX_USER_RT_PRIO / 2)
 #ifdef CONFIG_HAS_WAKELOCK
 #include <linux/wakelock.h>
 #endif
@@ -3417,7 +3419,7 @@ dhd_sched_policy(int prio)
                setScheduler(current, SCHED_NORMAL, &param);
        } else {
                if (get_scheduler_policy(current) != SCHED_FIFO) {
-                       param.sched_priority = (prio < MAX_RT_PRIO)? prio : (MAX_RT_PRIO-1);
+                       param.sched_priority = DHD_DEFAULT_RT_PRIORITY;
                        setScheduler(current, SCHED_FIFO, &param);
                }
        }
@@ -3455,7 +3457,7 @@ dhd_dpc_thread(void *data)
        if (dhd_dpc_prio > 0)
        {
                struct sched_param param;
-               param.sched_priority = (dhd_dpc_prio < MAX_RT_PRIO)?dhd_dpc_prio:(MAX_RT_PRIO-1);
+               param.sched_priority = DHD_DEFAULT_RT_PRIORITY;
                setScheduler(current, SCHED_FIFO, &param);
        }
 
@@ -3529,7 +3531,7 @@ dhd_rxf_thread(void *data)
        if (dhd_rxf_prio > 0)
        {
                struct sched_param param;
-               param.sched_priority = (dhd_rxf_prio < MAX_RT_PRIO)?dhd_rxf_prio:(MAX_RT_PRIO-1);
+               param.sched_priority = DHD_DEFAULT_RT_PRIORITY;
                setScheduler(current, SCHED_FIFO, &param);
        }