From patchwork Fri Mar 19 16:15:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 404808 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511050jai; Fri, 19 Mar 2021 09:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW/tVHbxlEyJ5rMDGe49X8AVZ2cp48e2hxjGdcsfTEYfCvzaL3WwjaNBZevQUHkoCuXBec X-Received: by 2002:a1c:4b15:: with SMTP id y21mr4554274wma.94.1616170440995; Fri, 19 Mar 2021 09:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170440; cv=none; d=google.com; s=arc-20160816; b=RAKQ75fPHhb8AtZMEcTJoRpePrEDemRhf0u0JPXzKwXEkofwRhHdRnWW3GS4WMEI1K ddSXw5AidaydS1LiUTzBmLFcEW3+zq287HjpbpTVbqewfEpDFjdlc3CkczapFKMon5+b Ec08XhZ3lgRPUaUFXPFkSpURAUHSyt5dkcsNy+vthCeZDZxD5bs0sLIZDjAC6Tt10Wru Ssjkt6C+YwnUlsNXD6GEZvs6TYFwcj+0ZDpxJMAxpUvGjtEl8D7kl1sfS+9ZVayhZMob zrWnIfHWZa04QU0JwfkRjj4+HVbmpaP9pGCVB0HiuEuGy30Ib4YSu0t4txLezIlq2AfL p3ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=o8fAenoFlnSlV36U48yb6QP9ENkXDuWvkUY+yXUw1LI=; b=J2k7Yg3YEC6kI166gn7Cuzngqa4fzPGbgFBQukZ6sHBNBT27j1ndLj4/ZBlJZoz0vD XDY6Y4c1Er8bRq9g34QQa5eWnnKf7jGfMd9xrRPU5PqPe6BfOBbwU9KToIsVyRvgi7k5 LHpXjMAyJzl4Bv1fKA9QGwDZVjaxe9pwmncFJ9U6gXUOLcrbGuVuRWRkQiZ7+BKK3Kbh 76E8Cr93sLZeiLDwQBU+gk7/Y5BXx4edOjI7OcGgY5gZmII11vWQfjMrKnl9l+9jjTJ+ fqnbbo8Ylzp1pKm2b7sRAZfYKDUT7f1nwWE20+pH6IO6r3WkI7Pesv4rv+XF5OIvzQC9 GBmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=KEsc+Kda; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=k3FG7wJB; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id p25si11210985wmi.2.2021.03.19.09.14.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=KEsc+Kda; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=k3FG7wJB; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=o8fAenoFlnSlV36U48yb6QP9ENkXDuWvkUY+yXUw1LI=; b=KEsc+KdacZLqKfxEGGSg3EuF0 Ows8vAE8H4cKIlSIH69moLD8dsl6aKuoACnh0L337cZAnx3bQPhxiDKS9zKw+lOTEBrPxMb7CNohz 3T1Fn2j+KVtTQslLpgmO4eJKSiDrh1WLcgeVbdEFV0XlWyzelh/6Btkr4KlzcaZRBCkIm8g54gDUc lT6kGmBdY2XDlqIOsPzlF5kS4A9OgnYM1Y22rVhS59N0LWswuJyU5cRioKb84iavh3SjbsRoovgAt 82GvkJYN42M14q8fKz2Xlarr8qc7HTuEFG6uv+9uB+WKUD6TRuekVNtRB/YXMc05DuZMbLwDLQXF1 0ERYZm/Ew==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlA-007fpQ-1y; Fri, 19 Mar 2021 16:14:00 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl4-007fn4-5W for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:57 +0000 Received: by mail-wr1-x435.google.com with SMTP id v4so9659128wrp.13 for ; Fri, 19 Mar 2021 09:13:53 -0700 (PDT) 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=jZ3WKCazIuoUxdRWj4Ban4JPE+r27UOCDH/EMw86Dwc=; b=k3FG7wJBZz1iduVEW3wZy1SPnWvZELKBBbQbcDV//CRTtVHBesiBTWh9RaTdZ0rymx 9Tk8VAswPI8ggFJLzgvbDSV+7+sRTpAhjTcNOQylgw6PVOt/ehUHty+4OBEp0SPWuCp9 FM/9KDPz6SgqR3IA+NlsAR0cgwiy+fgM2s9VNdafH0Rp1/urcy+afUY+hilSkIybj8nH liRyMCRS4SPW6HGl1733KuaXJ3k3hFyV04+oxwzXWJCSe+ZxP2+7ICOwrUCX9tfpaY2T ZFa07xcMgKOB9ysCz0m06qDDq0y7+HPhThMgIp5QqhTUju/S1XzlNgGp9BZ3hktEhWCT Jh/g== 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=jZ3WKCazIuoUxdRWj4Ban4JPE+r27UOCDH/EMw86Dwc=; b=nbGv4p7WyLeEcLb1FLbb+rI0GHbHWSnRi065Q9xxXNDw17Iw9AkbcXkb/j2h1duREG 38vZRRFzQnjVgTZP9+0Ckn8c7MslsPLeeE+vESXFGHXuWLLAhwTZ59Kf3KvmSxNiAd+Q svLyx2HwTxcxIfChlV/8X+xoC9oqWAKtquFdM6xLwWyAs0l7DAsacttqMeW6TNhAZoC0 KstiuoyExwHP+fVpPCN0HEYRElkNCor94btNZoNrTitnfUD3y9OcKami43LRexhrilUH qkyRbalZpPY94RjYHqe6Hf72fspFGKMcZvWYUcDBFrR3+PwSBvEXBrgJGk2icJHmJSNM hM9A== X-Gm-Message-State: AOAM532uUfZchqGJ1p5n347g3X31ECmk88rrfqZvWsR7txV2j0USmUIS pfsWsJMuhcYwhtYj4naW3ETrTz43xygsBmWr X-Received: by 2002:adf:f648:: with SMTP id x8mr5331023wrp.157.1616170433548; Fri, 19 Mar 2021 09:13:53 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id h8sm8432495wrt.94.2021.03.19.09.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:53 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 02/12] wcn36xx: Run suspend for the first ieee80211_vif Date: Fri, 19 Mar 2021 16:15:10 +0000 Message-Id: <20210319161520.3590510-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161354_405281_292A5930 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: A subsequent set of patches will extend out suspend/resume support in this driver, we cannot set the firmware up for multiple ipv4/ipv6 addresses and as such we can't iterate through a list of ieee802 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:435 listed in] [list.dnswl.org] X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org A subsequent set of patches will extend out suspend/resume support in this driver, we cannot set the firmware up for multiple ipv4/ipv6 addresses and as such we can't iterate through a list of ieee80211_vif. Constrain the interaction with the firmware to the first ieee80211_vif on the suspend/resume/wowlan path. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 43 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) -- 2.30.1 _______________________________________________ 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 b361e40697a6..c0c1ea18864f 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1088,15 +1088,39 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, #ifdef CONFIG_PM +struct ieee80211_vif *wcn36xx_get_first_vif(struct wcn36xx *wcn) +{ + struct wcn36xx_vif *tmp; + struct ieee80211_vif *vif = NULL; + + list_for_each_entry(tmp, &wcn->vif_list, list) { + vif = wcn36xx_priv_to_vif(tmp); + if (vif) + break; + } + return vif; +} + static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) { struct wcn36xx *wcn = hw->priv; - int ret; + struct ieee80211_vif *vif = NULL; + struct wcn36xx_vif *vif_priv = NULL; + int ret = 0; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); flush_workqueue(wcn->hal_ind_wq); - ret = wcn36xx_smd_set_power_params(wcn, true); + mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_vif(wcn); + if (vif) { + vif_priv = wcn36xx_vif_to_priv(vif); + if (!vif_priv->sta_assoc) + goto out; + ret = wcn36xx_smd_set_power_params(wcn, true); + } +out: + mutex_unlock(&wcn->conf_mutex); return ret; } @@ -1104,11 +1128,24 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) static int wcn36xx_resume(struct ieee80211_hw *hw) { struct wcn36xx *wcn = hw->priv; + struct ieee80211_vif *vif = NULL; + struct wcn36xx_vif *vif_priv = NULL; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac resume\n"); flush_workqueue(wcn->hal_ind_wq); - wcn36xx_smd_set_power_params(wcn, false); + mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_vif(wcn); + if (vif) { + vif_priv = wcn36xx_vif_to_priv(vif); + if (!vif_priv->sta_assoc) + goto out; + + wcn36xx_smd_set_power_params(wcn, false); + } +out: + mutex_unlock(&wcn->conf_mutex); + return 0; }