From patchwork Mon Dec 28 16:28:37 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: 352761 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp10027879ejs; Mon, 28 Dec 2020 08:27:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2tI2Fm0RCD3ZsKK8td2WmOlqIqz0oYq5WgGD1JEF2JWA4pKONX6oKfxyL1rJ7MHO6Nu7R X-Received: by 2002:a92:c5a7:: with SMTP id r7mr43245642ilt.219.1609172868343; Mon, 28 Dec 2020 08:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172868; cv=none; d=google.com; s=arc-20160816; b=WDJLtAdJDVB/sKO0QWEh7ikJUvsOKCY/eS0KTLSbLJuGWRaFdVRsmWtzsbSNKdgG12 abC9D+3CbF7a30VTjRcl6W00usqF6NfeAbLLXeT7C13REcNTi0U0pw5475PSZFfQoCiF 09a0Q87sj2dSmmy9EVaWSgU4p0wn+4hUNAgaLqhM1xqjE82aHZVzMaz6cIUBJB1C9Vbm nTzKnZufvzCmWkc/wwg5A7G/xLmKO8Ai2fII9QP6v9d51wuntiTIj7eqsp7HyvIOtimS wxkeLAyBhidslLaI4zEk7PgAgD8PwUz3gEtjc1BovvoqsmJ4n7KFpv1GJdPv9ziw9LJd Z3HQ== 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:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=oVwxwzIX2tBv4bQpvfqCPMajHbIcawgc4QMWebD9O1k=; b=quam59MYDJxhGHG/0KAXYB9CcYPMNEZP0kU1tJPYRAwjQ3PqjagjjqYeAcYq9FwtBs 6ple/tI7FpgGTChSFjpmLJinNSUg0yZ1YJ5IkipJlcjwesGETeFZAbFpysTE4+ydEUwq lPRCzS6Vw5zCeOMyeA5CWJ59jco3UTJvITIAbpCE0kJmagYeIG2vnSIr/JrKiWqzW7XH qpPjx/Gy7rxKbMwhmKNQNITcBvwjvdcDNqjx7Bfbmvo4WA+o3egoh3NuWB20kfWKhzia /1lDbv5M2Ww6HkMQMVq7k8xI9kIcWDeWkseg6KQO12iMb/SkbtlbB/pYATc023x/SpK1 hJ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=GQE1+4iK; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=W68ezXvA; 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 b14si24693440jat.85.2020.12.28.08.27.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:48 -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=GQE1+4iK; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=W68ezXvA; 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:References:In-Reply-To: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:List-Owner; bh=oVwxwzIX2tBv4bQpvfqCPMajHbIcawgc4QMWebD9O1k=; b=GQE1+4iK7/etIzElmPww2x2V/ caxu06t9qNccSUnUG5UKNicGZY0QOVqgUF3iNz1aCOVRtX9Mf+GEWxwR3X/Lrhtm5fx3mVxva5p+V jDiC97GqYmaWonzgsjlEwvcWAy3QzMZinsrK+abysIqFHGu9pJJOxwvPW7zNZFpDzjOdfLWjHaUFa z40GIBw/fVNQBERTG3R03YnH+2/b7sdW4CpHypJ7gpke5FDEb2Xl+/I4cAucxH+V8Lmu/NWuJ2I92 F+bqyCbZcDV35X7SUqnUI33gQqsu50AQ5rAo3T/YPuz/aiKIJRXJC0e2SR2VPQrFyklUzciYPfwFG ff2SV717A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvN4-0004dh-Gp; Mon, 28 Dec 2020 16:27:46 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvN1-0004b2-Gb for wcn36xx@lists.infradead.org; Mon, 28 Dec 2020 16:27:44 +0000 Received: by mail-wr1-x434.google.com with SMTP id d26so11721613wrb.12 for ; Mon, 28 Dec 2020 08:27:43 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=DaRR0s0yK5BJ7snyCgYM3YYfv91qTFP1bIba/mfbIt0=; b=W68ezXvAn1yxyVAM4VLHizolz0Zwdnfq4KSit0A1itMtMF/iQt5vHWpmasiwR8uOY6 iANb9sWGbtrbzeK/2coyGmKHcgTznst/IFmzz58rglUrK3yrf/o0Unk1N9xqCNiv5K9G dVoRFsdMxtSBEIj5/lIAqGdf68XwohXZr4GkE03yD0sx3+Hpjl9Mf1+88LmEFof3f9A5 Gz0UF/f8vOQTFFO9Hi6Ul2dl5n/YNNa9bB7u66lD2wQ/VEWkiAAqdQpxOE5jPQMiNSDM UfTwZj/9RK4nNR1G8vwEERUulwQ/iXCaVMez0lxLzfkiizSQFW0gdJrSrYnJ/mhZ1RyT 3vlA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=DaRR0s0yK5BJ7snyCgYM3YYfv91qTFP1bIba/mfbIt0=; b=QvioNdOXgAu1CzecB10Nv+BS/3C6XW5bWypxciOnxKX5S2F8lF4Xpxw9ih/EjstN1o V2Aonb2AAfbixQQJwQkrDX/PmAW9aGMw+3X6LQbwuX+eO/CKqVquitWlMjf7NDHqlaI4 AVFhiydn7I6dCDUkMBsds2WRpUX9JkTDGyl829YRW5NfqB+Kt8xwgqQ1PIgtJ/82MHBD 13xkeVRg6QfM3jZagVmGN2eu7pqSestsubAaEMaaO+kp9rqCoNIrgNaRqDEAM0l5zokc 3YO5bQYU9nWMJFldw6eBxQPJA+P4QdweuQa/vylNH0XHz22HYjAaEWQTjWqyKivdZQu6 v5GA== X-Gm-Message-State: AOAM531sIYgqiFIcwVuKC29yG90Jkg2DEwjE9dURKyhtRqKx3SYueAb/ cBcjtuoVER/4kzufMca250X6lA== X-Received: by 2002:adf:ab56:: with SMTP id r22mr40739831wrc.351.1609172862552; Mon, 28 Dec 2020 08:27:42 -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 w21sm19523379wmi.45.2020.12.28.08.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:41 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH 11/13] wcn36xx: Do not suspend if scan in progress Date: Mon, 28 Dec 2020 16:28:37 +0000 Message-Id: <20201228162839.369156-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228162839.369156-1-bryan.odonoghue@linaro.org> References: <20201228162839.369156-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201228_112743_611027_5B24CCAB X-CRM114-Status: GOOD ( 13.15 ) 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:434 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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, loic.poulain@linaro.org, benl@squareup.com Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org If a scan is in progress do not attempt to enter into suspend. Allow the scan process to quiesce before proceeding. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 5 +++++ drivers/net/wireless/ath/wcn36xx/smd.c | 13 +++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 2 ++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 4 files changed, 21 insertions(+) -- 2.29.2 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index b48a3f0dcc0b..feb909192c8e 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1113,6 +1113,11 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); + if (wcn36xx_smd_is_scanning(wcn)) { + ret = -EBUSY; + goto out; + } + mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_vif(wcn); if (vif) { diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index dd12575f33c3..378282a93aa0 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -731,6 +731,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->scanning = true; out: mutex_unlock(&wcn->hal_mutex); return ret; @@ -807,6 +808,7 @@ int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg_body, WCN36XX_HAL_FINISH_SCAN_REQ); + wcn->scanning = false; msg_body.mode = mode; msg_body.oper_channel = WCN36XX_HW_CHANNEL(wcn); if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { @@ -938,6 +940,17 @@ int wcn36xx_smd_stop_hw_scan(struct wcn36xx *wcn) return ret; } +bool wcn36xx_smd_is_scanning(struct wcn36xx *wcn) +{ + bool scanning; + + mutex_lock(&wcn->hal_mutex); + scanning = wcn->scanning; + mutex_unlock(&wcn->hal_mutex); + + return scanning; +} + static int wcn36xx_smd_switch_channel_rsp(void *buf, size_t len) { struct wcn36xx_hal_switch_channel_rsp_msg *rsp; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index b225c805107c..3488abb201d0 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -159,4 +159,6 @@ int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, struct ieee80211_vif *vif); +bool wcn36xx_smd_is_scanning(struct wcn36xx *wcn); + #endif /* _SMD_H_ */ diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 6121d8a5641a..36ea768a5203 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -249,6 +249,7 @@ struct wcn36xx { struct ieee80211_vif *sw_scan_vif; struct mutex scan_lock; bool scan_aborted; + bool scanning; /* DXE channels */ struct wcn36xx_dxe_ch dxe_tx_l_ch; /* TX low */