]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ath10k: disable cpuidle during downloading firmware
authorIkjoon Jang <ikjn@chromium.org>
Wed, 6 Nov 2019 18:04:45 +0000 (20:04 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 8 Nov 2019 08:45:35 +0000 (10:45 +0200)
Downloading ath10k firmware needs a large number of IOs and
cpuidle's miss predictions make it worse. In the worst case,
resume time can be three times longer than the average on sdio.

This patch disables cpuidle during firmware downloading by
applying PM_QOS_CPU_DMA_LATENCY in ath10k_download_fw().

Tested-on: QCA9880
Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00029

Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/core.c

index 36c62d66c19e526beac03328c8fe16fa5845e114..4f76ba5d78a985156f3e3d720634d1649fdbe497 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/property.h>
 #include <linux/dmi.h>
 #include <linux/ctype.h>
+#include <linux/pm_qos.h>
 #include <asm/byteorder.h>
 
 #include "core.h"
@@ -1027,6 +1028,7 @@ static int ath10k_download_fw(struct ath10k *ar)
        u32 address, data_len;
        const void *data;
        int ret;
+       struct pm_qos_request latency_qos;
 
        address = ar->hw_params.patch_load_addr;
 
@@ -1060,8 +1062,14 @@ static int ath10k_download_fw(struct ath10k *ar)
                            ret);
        }
 
-       return ath10k_bmi_fast_download(ar, address,
-                                       data, data_len);
+       memset(&latency_qos, 0, sizeof(latency_qos));
+       pm_qos_add_request(&latency_qos, PM_QOS_CPU_DMA_LATENCY, 0);
+
+       ret = ath10k_bmi_fast_download(ar, address, data, data_len);
+
+       pm_qos_remove_request(&latency_qos);
+
+       return ret;
 }
 
 void ath10k_core_free_board_files(struct ath10k *ar)