linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: disable cpuidle during downloading firmware.
@ 2019-11-01  5:40 Ikjoon Jang
  2019-11-06 18:22 ` Kalle Valo
  2019-11-08  8:54 ` Kalle Valo
  0 siblings, 2 replies; 7+ messages in thread
From: Ikjoon Jang @ 2019-11-01  5:40 UTC (permalink / raw)
  To: ath10k
  Cc: Kalle Valo, David S . Miller, linux-wireless, netdev,
	linux-kernel, Ikjoon Jang

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().

Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
---
 drivers/net/wireless/ath/ath10k/core.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 36c62d66c19e..4f76ba5d78a9 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -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)
-- 
2.24.0.rc1.363.gb1bccd3e3d-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ath10k: disable cpuidle during downloading firmware.
  2019-11-01  5:40 [PATCH] ath10k: disable cpuidle during downloading firmware Ikjoon Jang
@ 2019-11-06 18:22 ` Kalle Valo
  2019-11-06 18:33   ` Tom Psyborg
  2019-11-07  4:16   ` Ikjoon Jang
  2019-11-08  8:54 ` Kalle Valo
  1 sibling, 2 replies; 7+ messages in thread
From: Kalle Valo @ 2019-11-06 18:22 UTC (permalink / raw)
  To: Ikjoon Jang
  Cc: ath10k, netdev, linux-wireless, linux-kernel, David S . Miller

Ikjoon Jang <ikjn@chromium.org> writes:

> 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().
>
> Signed-off-by: Ikjoon Jang <ikjn@chromium.org>

On what hardware and firmware versions did you test this? I'll add that
to the commit log.

https://wireless.wiki.kernel.org/en/users/drivers/ath10k/submittingpatches#guidelines

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ath10k: disable cpuidle during downloading firmware.
  2019-11-06 18:22 ` Kalle Valo
@ 2019-11-06 18:33   ` Tom Psyborg
  2019-11-08  8:31     ` Kalle Valo
  2019-11-07  4:16   ` Ikjoon Jang
  1 sibling, 1 reply; 7+ messages in thread
From: Tom Psyborg @ 2019-11-06 18:33 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Ikjoon Jang, netdev, linux-wireless, linux-kernel, ath10k,
	David S . Miller

On 06/11/2019, Kalle Valo <kvalo@codeaurora.org> wrote:
> Ikjoon Jang <ikjn@chromium.org> writes:
>
>> 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().
>>
>> Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
>
> On what hardware and firmware versions did you test this? I'll add that
> to the commit log.
>
> https://wireless.wiki.kernel.org/en/users/drivers/ath10k/submittingpatches#guidelines
>
> --
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
>
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
>

Hi

I've tested this on QCA9880. No issues during firmware download.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ath10k: disable cpuidle during downloading firmware.
  2019-11-06 18:22 ` Kalle Valo
  2019-11-06 18:33   ` Tom Psyborg
@ 2019-11-07  4:16   ` Ikjoon Jang
  2019-11-08  8:32     ` Kalle Valo
  1 sibling, 1 reply; 7+ messages in thread
From: Ikjoon Jang @ 2019-11-07  4:16 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath10k, netdev, linux-wireless, linux-kernel, David S . Miller

On Thu, Nov 7, 2019 at 2:23 AM Kalle Valo <kvalo@codeaurora.org> wrote:
>
> Ikjoon Jang <ikjn@chromium.org> writes:
>
> > 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().
> >
> > Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
>
> On what hardware and firmware versions did you test this? I'll add that
> to the commit log.
>
> https://wireless.wiki.kernel.org/en/users/drivers/ath10k/submittingpatches#guidelines

Thank you for sharing it.
It's QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00029
on ARMv8 multi cluster platform.

>
> --
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ath10k: disable cpuidle during downloading firmware.
  2019-11-06 18:33   ` Tom Psyborg
@ 2019-11-08  8:31     ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-11-08  8:31 UTC (permalink / raw)
  To: Tom Psyborg
  Cc: netdev, linux-wireless, linux-kernel, ath10k, Ikjoon Jang,
	David S . Miller

Tom Psyborg <pozega.tomislav@gmail.com> writes:

> On 06/11/2019, Kalle Valo <kvalo@codeaurora.org> wrote:
>> Ikjoon Jang <ikjn@chromium.org> writes:
>>
>>> 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().
>>>
>>> Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
>>
>> On what hardware and firmware versions did you test this? I'll add that
>> to the commit log.
>
> I've tested this on QCA9880. No issues during firmware download.

Great, thanks for testing.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ath10k: disable cpuidle during downloading firmware.
  2019-11-07  4:16   ` Ikjoon Jang
@ 2019-11-08  8:32     ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-11-08  8:32 UTC (permalink / raw)
  To: Ikjoon Jang
  Cc: netdev, linux-wireless, linux-kernel, ath10k, David S . Miller

Ikjoon Jang <ikjn@chromium.org> writes:

> On Thu, Nov 7, 2019 at 2:23 AM Kalle Valo <kvalo@codeaurora.org> wrote:
>>
>> Ikjoon Jang <ikjn@chromium.org> writes:
>>
>> > 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().
>> >
>> > Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
>>
>> On what hardware and firmware versions did you test this? I'll add that
>> to the commit log.
>>
>> https://wireless.wiki.kernel.org/en/users/drivers/ath10k/submittingpatches#guidelines
>
> Thank you for sharing it.
> It's QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00029
> on ARMv8 multi cluster platform.

Thanks, I added that to the commit log.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ath10k: disable cpuidle during downloading firmware.
  2019-11-01  5:40 [PATCH] ath10k: disable cpuidle during downloading firmware Ikjoon Jang
  2019-11-06 18:22 ` Kalle Valo
@ 2019-11-08  8:54 ` Kalle Valo
  1 sibling, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-11-08  8:54 UTC (permalink / raw)
  To: Ikjoon Jang
  Cc: ath10k, David S . Miller, linux-wireless, netdev, linux-kernel,
	Ikjoon Jang

Ikjoon Jang <ikjn@chromium.org> wrote:

> 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>

Patch applied to ath-next branch of ath.git, thanks.

3b58d6a599ba ath10k: disable cpuidle during downloading firmware

-- 
https://patchwork.kernel.org/patch/11222331/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-08  8:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-01  5:40 [PATCH] ath10k: disable cpuidle during downloading firmware Ikjoon Jang
2019-11-06 18:22 ` Kalle Valo
2019-11-06 18:33   ` Tom Psyborg
2019-11-08  8:31     ` Kalle Valo
2019-11-07  4:16   ` Ikjoon Jang
2019-11-08  8:32     ` Kalle Valo
2019-11-08  8:54 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).