From patchwork Fri Nov 20 02:14:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 329139 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp888570ejb; Thu, 19 Nov 2020 18:13:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLAbaJEstEj1qC+xgcCFArHd7mnxk0D0KEoc9tM+xpIq9eIwLePKbRWH6By/8zhoAW8hH3 X-Received: by 2002:ac8:431c:: with SMTP id z28mr13977170qtm.118.1605838390899; Thu, 19 Nov 2020 18:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605838390; cv=none; d=google.com; s=arc-20160816; b=EIu83izjNR1IM/D7+PXDP98SBbaqoBQk3AnrrTps8N09RsSKlRc9oRqPQ13Z9nvVau 21NBzZuVWU2ImiqGsfsPSfn8evrhTj/wxfxU5jsfCRvdJ0VSQ2JXhVetzSLpWyRZ50La 2bGf4r8CzWNsmpv0/p5NWdrHME60VEcxmDiQ0fRa7a64YwsAFG8DEYSaita2kaJnnQeA KugrU4ty5v/uMudH8toK4PHmL59YASg/IAEUKWanxPyFpPLb4Nvaen1PZWgcSZ6bpkZz xQtjGdBYu0E/iRVs5/4nc0eAIfcZLbTiulo+GMfxmtc/uGRwhOjrQ6PSvtF9hZwWhlR5 SNcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=igf9eVXZgaJSFQ++rQPD2t7gQdAjFUbProsfUBMMJVo=; b=KPgk4vaZXaH5gw4VGV+mXAZmy6MS9Q9R2TDKRwakj3ssK5fwfKOaMSYix4VboN8MW3 bRwOBttfIR5Mmx1F1jAGa6i2Z3lF4QpFqdkB2pcLULSXCC/XzbcirsnFXM7j9XaHrpc+ pS1pM5dEJLawdWaWDfBsbiWQTXeA+9Gh4mZ/uyObzg7TAr2xdRvoCCVRpuoEchdqx8O8 9GacMb9bDLrCRSwaOJYSbKkXbiqqfZSZKXOMR6LIwQq364Lfz2ctbMc0lEwzVs/TpAHZ gBqXJtWKe9AVcToqX0ErMTRmKw/hc1ajdqiKXQYmp/w1bjqiiIdAIEdwelU+fEe7hvax rcZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=hg8LoQbi; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="VT/LmiGP"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id o11si826737qvq.141.2020.11.19.18.13.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 18:13:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=hg8LoQbi; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="VT/LmiGP"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=igf9eVXZgaJSFQ++rQPD2t7gQdAjFUbProsfUBMMJVo=; b=hg8LoQbis4Qgy59cPHvzAZdNZy N78HCBa1aFdMYei0WYX1DzQZbiuAs2dGa9gc3CCRdONhEQhKaGx5Ntua4OszPifQ5b3QMLdGShkT8 Zc+3Jps1Ys+vGdKLoGgTvGlw8+mxMH9iBVu1ohSMGOlpN9gE62cs3vmSOfSJlqB/pC/EOK2PDCRc4 nCPawJqO4Tb180nHf0Pq+2MWyzasXtLsDvuelOhxV6I8SgAtl+dJAs+MLja4pLwG86RIQJL8mTtwe PqsiDpGkO3GZnbhmSKasJOvEqo5imWNVpxD9cM95KsDlvMw4xRdeIQrvS3IPilnSXg9mar6KIlBLv GNsPpfbQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfvvB-0003YF-5V; Fri, 20 Nov 2020 02:13:09 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfvv8-0003Xa-1T for wcn36xx@lists.infradead.org; Fri, 20 Nov 2020 02:13:07 +0000 Received: by mail-wr1-x444.google.com with SMTP id r17so8529975wrw.1 for ; Thu, 19 Nov 2020 18:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QTXtYshgBx4QZ9Jmd3XHSEpqTndirQEx843ji2frBOM=; b=VT/LmiGPZg6SfpY7DYUOD7vMYBoXdxmFUFH2LYt/uhtPFpQGJOg7eQbi4KuvKwiYLD 4upHxJ6O411pvXxSBYQrHQ6ii8o03rijMpHG5dG/uHf8bXUu28AZmY2wG1su/apphQYa xPxF3YWLwnMUCA46KZosUIADedRe1rDEj0LWsDZbsSnEoKk+nRDEgWvXKqTE2mus/xuz 4ZRG0BpupdYGiBUnLAOppayd5/pZgooSLw51oxHCyDgU9ZynOp5xDWI4K/cW6MxsAWVK JsJDqGZbhzBUlzKm+lGS0r4POgZjeiQKY4nu0qHIiUCvwAP+eyxXGl6kNK3NfqJpR1A+ CD4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QTXtYshgBx4QZ9Jmd3XHSEpqTndirQEx843ji2frBOM=; b=W0v0h4IIDzu9sLoF0qgTDb3yg6ftVY1I4pD8Exprj+3Fr8LOUMJPf5LH6PVp8NcWQm yXXQYE8IWUMygGXNXdO4sSOlGFoFrFfTA0qO/kugMOYqePCTNkjXWy3kFVghwW4+ciRa nWclwBfOxitTgXpBMnQCFsDjnsAu56bk1RLd9ROLmWRwJc0Lj0J4AI8+gU/HJg0jRq1B 4R2wM1ebXUYJ74PmN4oDN1p3as9ScNdKyYuMfozvDU4kGJcXvxwzcHWxkG2fmRi9Aio5 nSRQ0/MLTMllNx+sXS3mlHf3xO/guwJWPBXtD0SfXXMJXgC5JFjDKiu7ZBos65BEtT2Q 1TFg== X-Gm-Message-State: AOAM533+iyzngCLQ7eKETCUbaPHz1p5zozUjSagPn5Al2DIbwOdxjXZ1 uhyiyrqyyuwao4oumdb5F/wc1w== X-Received: by 2002:a5d:44d1:: with SMTP id z17mr13893629wrr.423.1605838383568; Thu, 19 Nov 2020 18:13:03 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c187sm2918261wmd.23.2020.11.19.18.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 18:13:02 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH] wcn36xx: Don't run scan_init multiple times Date: Fri, 20 Nov 2020 02:14:02 +0000 Message-Id: <20201120021403.2646574-1-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_211306_363092_4AEAD410 X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org Run scan_init only once. There's no need to run this command multiple times if it has already been run once. The software scan algorithm can end up repeatedly calling scan_init on each loop resulting in between four and eight milliseconds of lost time on each callout. Subtract the overhead now. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 6 ++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 2 files changed, 7 insertions(+) -- 2.28.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index acf533fae46a..ec082cf3ab09 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -706,6 +706,10 @@ int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode, int ret; mutex_lock(&wcn->hal_mutex); + if (wcn->scan_init) { + ret = 0; + goto out; + } INIT_HAL_MSG(msg_body, WCN36XX_HAL_INIT_SCAN_REQ); msg_body.mode = mode; @@ -731,6 +735,7 @@ int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode, wcn36xx_err("hal_init_scan response failed err=%d\n", ret); goto out; } + wcn->scan_init = true; out: mutex_unlock(&wcn->hal_mutex); return ret; @@ -761,6 +766,7 @@ int wcn36xx_smd_start_scan(struct wcn36xx *wcn, u8 scan_channel) wcn36xx_err("hal_start_scan response failed err=%d\n", ret); goto out; } + wcn->scan_init = false; out: mutex_unlock(&wcn->hal_mutex); return ret; diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 71fa9992b118..156df6d184c8 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -235,6 +235,7 @@ struct wcn36xx { struct ieee80211_vif *sw_scan_vif; struct mutex scan_lock; bool scan_aborted; + bool scan_init; /* DXE channels */ struct wcn36xx_dxe_ch dxe_tx_l_ch; /* TX low */