Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp22257003ybl; Mon, 6 Jan 2020 22:24:34 -0800 (PST) X-Google-Smtp-Source: APXvYqzy1wZssXlyp2jiaDiXZ9t5ryGu9nzYdEKsBIwxzP8SQG/bR/qJsOC1M9FTnVkdHqIwloDy X-Received: by 2002:a05:6830:1c81:: with SMTP id v1mr122938766otf.83.1578378274261; Mon, 06 Jan 2020 22:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578378274; cv=none; d=google.com; s=arc-20160816; b=K8yHDwuXP2xfylTkiLwdav9SYEGs0YmXu0zGcK1fSuCi6aw+VJ0OdAUkGZRYCpBjm0 UVq2wdtzVTgIwR5pIM7IDfJ5kL7h1pPW8Vxz77FR37agSyvBUGzIusqfx5DhbLEm5iAf /sjRQWZndclykB7j8IoQ8B3lamacbud39ApMBsFHydjXE82cUKCL2FhhfxPYYBJFEIzJ O5VBDvYezNW1k0rgVxSeSGHGqqHWKrugSW/VZj+j84b3d14t1nPq0HVDD9uJGBAbajfK fO57DN+TkMaABQxavoxhrXJIGxQm/7xOZyInRDGwhNMuyGlZ4pJD051MJccGqrjEl180 YZ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=/5Cj4kGBRUTN/E1SEncRP8qPjJOV4btr6EY3RJAXrPE=; b=k5pKDDL7bRRktPN+Qv8LM+cYaMVD0rYw4UVwJMjR2JIESqktAsYbizP0h7Lut4eD+w R7nsTESWJ2+QF0pD00wrU7ikiArmLI7vBYFrLbxtegRFxNOH+vTBLQo+KneURyPVeCFP nyNL0ka/GFYqeHncAPkmdZGIBQPCNaiZK7a5y7s+JanCNVZ6OoImqsBH7e8SHnYFDEq0 rkUo+eYKWkJdrEReMozqOQ8pDdTnezjdA0Fq1nlIaSMXz1UNSULK8lOxJDPhzWpZc7Nk VZcuJ6gKlVjA3uYuFLO9xn8OGnUA029nXDqksR28AOLpAi+b2vR6Nvm2cZMt1SsPhXYQ OyLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=B073zNTh; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t142si30637892oih.242.2020.01.06.22.24.17; Mon, 06 Jan 2020 22:24:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=B073zNTh; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725874AbgAGGXY (ORCPT + 99 others); Tue, 7 Jan 2020 01:23:24 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:13906 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbgAGGXX (ORCPT ); Tue, 7 Jan 2020 01:23:23 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1578378203; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=/5Cj4kGBRUTN/E1SEncRP8qPjJOV4btr6EY3RJAXrPE=; b=B073zNThg88rkch1IErlVPqKAm9JcC4w1YPjtv3W0Ybug7pGlz3J/V35jhOb4fdy/llJ2ztS B3kkngWb0Sz8Jyi9VlsTy+XY4yw4SlEM9yngeM07rppXDsY3doCXvkEAui1pNFqzNLsZNixu 6p15N1+dPPMyi9hTlb8MCv9PBRA= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e1423d6.7f0161be7a78-smtp-out-n02; Tue, 07 Jan 2020 06:23:18 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 543C5C4479C; Tue, 7 Jan 2020 06:23:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from che-swdbs-01.qca.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mkenna) by smtp.codeaurora.org (Postfix) with ESMTPSA id 55525C43383; Tue, 7 Jan 2020 06:23:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 55525C43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=mkenna@codeaurora.org From: Maharaja Kennadyrajan To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Vikas Patel , Maharaja Kennadyrajan Subject: [PATCH] ath10k: avoid consecutive OTP download to reduce boot time Date: Tue, 7 Jan 2020 11:53:15 +0530 Message-Id: <1578378195-25780-1-git-send-email-mkenna@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Vikas Patel 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 Signed-off-by: Maharaja Kennadyrajan --- 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