linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: avoid consecutive OTP download to reduce boot time
@ 2020-01-07  6:23 Maharaja Kennadyrajan
  2020-01-07  7:00 ` Maharaja Kennadyrajan
  2020-03-11 16:31 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Maharaja Kennadyrajan @ 2020-01-07  6:23 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Vikas Patel, Maharaja Kennadyrajan

From: Vikas Patel <vikpatel@codeaurora.org>

Currently, OTP is downloaded twice in case of "pre-cal-dt"
and "pre-cal-file" to fetch the board ID and takes around
~2 sec more boot uptime.

First OTP download happens in "ath10k_core_probe_fw" and
second in ath10k_core_start. First boot does not need OTP
download in core start when valid board id acquired.

The second OTP download is required upon core stop/start.

This patch skips the OTP download when first OTP download
has acquired a valid board id. This patch also marks board
id invalid in "ath10k_core_stop", which will force the OTP
download in ath10k_core_start and fetches valid board id.

Tested HW: QCA9984
Tested FW: 10.4-3.6-00104

Signed-off-by: Vikas Patel <vikpatel@codeaurora.org>
Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/core.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 5ec16ce..8fef991 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -874,6 +874,13 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
 		return -ENODATA;
 	}
 
+	if (ar->id.bmi_ids_valid) {
+		ath10k_dbg(ar, ATH10K_DBG_BOOT,
+			   "boot already acquired valid otp board id,skip download, board_id %d chip_id %d\n",
+			   ar->id.bmi_board_id, ar->id.bmi_chip_id);
+		goto skip_otp_download;
+	}
+
 	ath10k_dbg(ar, ATH10K_DBG_BOOT,
 		   "boot upload otp to 0x%x len %zd for board id\n",
 		   address, ar->normal_mode_fw.fw_file.otp_len);
@@ -921,6 +928,8 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
 	ar->id.bmi_board_id = board_id;
 	ar->id.bmi_chip_id = chip_id;
 
+skip_otp_download:
+
 	return 0;
 }
 
@@ -2863,6 +2872,8 @@ void ath10k_core_stop(struct ath10k *ar)
 	ath10k_htt_tx_stop(&ar->htt);
 	ath10k_htt_rx_free(&ar->htt);
 	ath10k_wmi_detach(ar);
+
+	ar->id.bmi_ids_valid = false;
 }
 EXPORT_SYMBOL(ath10k_core_stop);
 
-- 
1.9.1

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

* Re: [PATCH] ath10k: avoid consecutive OTP download to reduce boot time
  2020-01-07  6:23 [PATCH] ath10k: avoid consecutive OTP download to reduce boot time Maharaja Kennadyrajan
@ 2020-01-07  7:00 ` Maharaja Kennadyrajan
  2020-02-13 14:13   ` Kalle Valo
  2020-03-11 16:31 ` Kalle Valo
  1 sibling, 1 reply; 5+ messages in thread
From: Maharaja Kennadyrajan @ 2020-01-07  7:00 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Vikas Patel

On 2020-01-07 11:53, Maharaja Kennadyrajan wrote:

[Maha]: Please ignore/drop this duplicate patch as I sent it already.
Regret for inconvenience caused.


> From: Vikas Patel <vikpatel@codeaurora.org>
> 
> Currently, OTP is downloaded twice in case of "pre-cal-dt"
> and "pre-cal-file" to fetch the board ID and takes around
> ~2 sec more boot uptime.
> 
> First OTP download happens in "ath10k_core_probe_fw" and
> second in ath10k_core_start. First boot does not need OTP
> download in core start when valid board id acquired.
> 
> The second OTP download is required upon core stop/start.
> 
> This patch skips the OTP download when first OTP download
> has acquired a valid board id. This patch also marks board
> id invalid in "ath10k_core_stop", which will force the OTP
> download in ath10k_core_start and fetches valid board id.
> 
> Tested HW: QCA9984
> Tested FW: 10.4-3.6-00104
> 
> Signed-off-by: Vikas Patel <vikpatel@codeaurora.org>
> Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
> ---
>  drivers/net/wireless/ath/ath10k/core.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/core.c
> b/drivers/net/wireless/ath/ath10k/core.c
> index 5ec16ce..8fef991 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -874,6 +874,13 @@ static int
> ath10k_core_get_board_id_from_otp(struct ath10k *ar)
>  		return -ENODATA;
>  	}
> 
> +	if (ar->id.bmi_ids_valid) {
> +		ath10k_dbg(ar, ATH10K_DBG_BOOT,
> +			   "boot already acquired valid otp board id,skip download,
> board_id %d chip_id %d\n",
> +			   ar->id.bmi_board_id, ar->id.bmi_chip_id);
> +		goto skip_otp_download;
> +	}
> +
>  	ath10k_dbg(ar, ATH10K_DBG_BOOT,
>  		   "boot upload otp to 0x%x len %zd for board id\n",
>  		   address, ar->normal_mode_fw.fw_file.otp_len);
> @@ -921,6 +928,8 @@ static int
> ath10k_core_get_board_id_from_otp(struct ath10k *ar)
>  	ar->id.bmi_board_id = board_id;
>  	ar->id.bmi_chip_id = chip_id;
> 
> +skip_otp_download:
> +
>  	return 0;
>  }
> 
> @@ -2863,6 +2872,8 @@ void ath10k_core_stop(struct ath10k *ar)
>  	ath10k_htt_tx_stop(&ar->htt);
>  	ath10k_htt_rx_free(&ar->htt);
>  	ath10k_wmi_detach(ar);
> +
> +	ar->id.bmi_ids_valid = false;
>  }
>  EXPORT_SYMBOL(ath10k_core_stop);

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

* Re: [PATCH] ath10k: avoid consecutive OTP download to reduce boot time
  2020-01-07  7:00 ` Maharaja Kennadyrajan
@ 2020-02-13 14:13   ` Kalle Valo
  2020-02-14  5:46     ` Maharaja Kennadyrajan
  0 siblings, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2020-02-13 14:13 UTC (permalink / raw)
  To: Maharaja Kennadyrajan; +Cc: ath10k, Vikas Patel, linux-wireless

Maharaja Kennadyrajan <mkenna@codeaurora.org> writes:

> On 2020-01-07 11:53, Maharaja Kennadyrajan wrote:
>
> [Maha]: Please ignore/drop this duplicate patch as I sent it already.
> Regret for inconvenience caused.

Are you sure I should drop this? In the first patch I think you forgot
to CC linux-wireless and that's why I didn't see it. But this second
patch was CCed to linux-wireless and I see it on patchwork. So my plan
is to put this back to my queue, please let me know if I have
misunderstood.

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

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

* Re: [PATCH] ath10k: avoid consecutive OTP download to reduce boot time
  2020-02-13 14:13   ` Kalle Valo
@ 2020-02-14  5:46     ` Maharaja Kennadyrajan
  0 siblings, 0 replies; 5+ messages in thread
From: Maharaja Kennadyrajan @ 2020-02-14  5:46 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath10k, Vikas Patel, linux-wireless

On 2020-02-13 19:43, Kalle Valo wrote:
> Maharaja Kennadyrajan <mkenna@codeaurora.org> writes:
> 
>> On 2020-01-07 11:53, Maharaja Kennadyrajan wrote:
>> 
>> [Maha]: Please ignore/drop this duplicate patch as I sent it already.
>> Regret for inconvenience caused.
> 
> Are you sure I should drop this? In the first patch I think you forgot
> to CC linux-wireless and that's why I didn't see it. But this second
> patch was CCed to linux-wireless and I see it on patchwork. So my plan
> is to put this back to my queue, please let me know if I have
> misunderstood.

[Maha]: Hi Kalle, I sent the same patch twice. So I asked to ignore one 
duplicate patch.
You can pick up this patch to put it in your queue and please ignore the 
duplicate patch.

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

* Re: [PATCH] ath10k: avoid consecutive OTP download to reduce boot time
  2020-01-07  6:23 [PATCH] ath10k: avoid consecutive OTP download to reduce boot time Maharaja Kennadyrajan
  2020-01-07  7:00 ` Maharaja Kennadyrajan
@ 2020-03-11 16:31 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2020-03-11 16:31 UTC (permalink / raw)
  To: Maharaja Kennadyrajan
  Cc: ath10k, linux-wireless, Vikas Patel, Maharaja Kennadyrajan

Maharaja Kennadyrajan <mkenna@codeaurora.org> wrote:

> Currently, OTP is downloaded twice in case of "pre-cal-dt"
> and "pre-cal-file" to fetch the board ID and takes around
> ~2 sec more boot uptime.
> 
> First OTP download happens in "ath10k_core_probe_fw" and
> second in ath10k_core_start. First boot does not need OTP
> download in core start when valid board id acquired.
> 
> The second OTP download is required upon core stop/start.
> 
> This patch skips the OTP download when first OTP download
> has acquired a valid board id. This patch also marks board
> id invalid in "ath10k_core_stop", which will force the OTP
> download in ath10k_core_start and fetches valid board id.
> 
> Tested HW: QCA9984
> Tested FW: 10.4-3.6-00104
> 
> Signed-off-by: Vikas Patel <vikpatel@codeaurora.org>
> Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

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

a4b9f641e858 ath10k: avoid consecutive OTP download to reduce boot time

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

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

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

end of thread, other threads:[~2020-03-11 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07  6:23 [PATCH] ath10k: avoid consecutive OTP download to reduce boot time Maharaja Kennadyrajan
2020-01-07  7:00 ` Maharaja Kennadyrajan
2020-02-13 14:13   ` Kalle Valo
2020-02-14  5:46     ` Maharaja Kennadyrajan
2020-03-11 16:31 ` 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).