From patchwork Tue Oct 3 22:11:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 9983587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99A8E602B8 for ; Tue, 3 Oct 2017 22:12:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9112428895 for ; Tue, 3 Oct 2017 22:12:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8533E288BD; Tue, 3 Oct 2017 22:12:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BB4F28895 for ; Tue, 3 Oct 2017 22:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=kOJX14fkLh6p8rsY3ZYqh+DgSzykm4c4LwxS+C87o38=; b=AoJ Dp6AB2XiXXb9tO8L+5Ue8Zg9fU+m7wzQYbu5xDatpJI8DJE1sLLE4mQh8dnGwNkZw7rxBODO1qBIY 7gUVUNlcuOgpyc7F44+sbbIoQUWn01f7ZxHoffWjSy8JuLvUk96RCAExOXfyaDdUKRNK1TH9to26F n1Ej30tS+4OMcLBOOQiVslw8VV8FAJtClZ9YdHGJ2eFuz00pys6MvGCXElhnJ166PN71l0ENVlWa8 XtSAZC7pmGcFRDfau86X1IX3j8SrsRXld8EUSLEXjEauTdCfrxzmLBDmRZHyWbGXaeeKhtShhnPeI mLslq290lewHRJ0ur1bXjKTbSiWo/Bg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dzVQD-0004CY-3H; Tue, 03 Oct 2017 22:12:13 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dzVQA-00049l-5O for ath10k@lists.infradead.org; Tue, 03 Oct 2017 22:12:11 +0000 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id EF98B40A5C4; Tue, 3 Oct 2017 15:11:48 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Subject: [PATCH] ath10k: Store coverage-class in case firmware is not booted. Date: Tue, 3 Oct 2017 15:11:47 -0700 Message-Id: <1507068707-14050-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171003_151210_255894_78E8A3E1 X-CRM114-Status: UNSURE ( 8.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ben Greear , ath10k@lists.infradead.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear This way, we can apply the values when the NIC does come up. Signed-off-by: Ben Greear --- drivers/net/wireless/ath/ath10k/hw.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/hw.c b/drivers/net/wireless/ath/ath10k/hw.c index afb0c01..31c0589 100644 --- a/drivers/net/wireless/ath/ath10k/hw.c +++ b/drivers/net/wireless/ath/ath10k/hw.c @@ -454,8 +454,13 @@ static void ath10k_hw_qca988x_set_coverage_class(struct ath10k *ar, /* Only modify registers if the core is started. */ if ((ar->state != ATH10K_STATE_ON) && - (ar->state != ATH10K_STATE_RESTARTED)) + (ar->state != ATH10K_STATE_RESTARTED)) { + spin_lock_bh(&ar->data_lock); + /* Store config value for when radio boots up */ + ar->fw_coverage.coverage_class = value; + spin_unlock_bh(&ar->data_lock); goto unlock; + } /* Retrieve the current values of the two registers that need to be * adjusted. @@ -487,7 +492,7 @@ static void ath10k_hw_qca988x_set_coverage_class(struct ath10k *ar, ar->fw_coverage.reg_ack_cts_timeout_orig = timeout_reg; ar->fw_coverage.reg_phyclk = phyclk_reg; - /* Calculat new value based on the (original) firmware calculation. */ + /* Calculate new value based on the (original) firmware calculation. */ slottime_reg = ar->fw_coverage.reg_slottime_orig; timeout_reg = ar->fw_coverage.reg_ack_cts_timeout_orig;