From patchwork Mon Dec 28 16:28:28 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: 352756 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp10027813ejs; Mon, 28 Dec 2020 08:27:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzu3x2WpdiS8ekd5Iirst5rRuTiDcAH4E5C4gEK8FAeZDWbtMPRdwyjbKreh3+cBt1pTgCH X-Received: by 2002:a02:5e81:: with SMTP id h123mr39246472jab.36.1609172863631; Mon, 28 Dec 2020 08:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172863; cv=none; d=google.com; s=arc-20160816; b=Bx0zxRfKiL4oYd/BWUbNcAilpKxKu9lYy3XoURtazE5o8pvrkKNLncXDoNRkUsHXE0 RTdrmnDX7kRhRgG4Ac24Dj57CcBbqK+D7tjlIg6Rptm5uEkszgBJj5f6uLFiuDKB7lNB yybDkmKIZmvBLxBorsm1nWZ2NPO6vGzBwR2nDKZSbhFyZMpvP+KJZT/9Bm20wtBSUeA1 eXAm7mUc/JkIZZp8zLWTL7Jo9C55J4ZmS4OUASlltpeW9+OXh+HwWElewFIm79viCR7v 4ko4gwBi19gpKkmvHrXCyP2RAVHmxk882gGFQBBh9TfjHFOjquXB3gTP9fmm6N7AVgpu BqSQ== 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=qCQ5t7RSx/3/DA1PowlYXau7XMqq7ZvuWoshx65lql0=; b=RF2fBhiB+/vg2F9odgBSHxklw5dk69ujU3ytimyKVSwCDaEbWI16Hz7HEpy9nDcWjG GbVYk9lGHi6ISYID4pSBJmK4s2AmWNYjHHVeGHMJIVYyZCd4MI6+lIysUD8rtWxTE6VG OMJvo+Lo2pBZZi3ZwdGOQKPF7KIC7QgXd8CXT8xHiQCoKNF18sTswacHCc2GvCApqIlQ GFFjEj0tM1/TGe2CGhqwWbBnC9kYJg2dM1A71FH4JnNttRRik15sh/w6fIYvgQnqL6mg Qy5yC5tBZNrMQqHaeLtigdr/+U9Xwwab6pb6QGWqDaw5MLfGZQB+RRFjBXknAUeVQlPD e+rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=MVCOq2SM; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gMjL3dHh; 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 l4si27156991ilg.22.2020.12.28.08.27.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:43 -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=MVCOq2SM; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gMjL3dHh; 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=qCQ5t7RSx/3/DA1PowlYXau7XMqq7ZvuWoshx65lql0=; b=MVCOq2SMzk2bHBsC5QnyZFHrL nazTxdGJ9K4GRuHNm8tvm50YYmdHeLmgO9li8GaZQqCpxxCq4i1iPdWSlI1bKbU10VIunOWbMmU4U GG5JwqVQwJSNknStGRBMxViEf9VYYUGMbN0lSqtSIJDD3Q69rAmiwIE/ci9zvn07QKwfH8c7nCR7u xZzs7wyYXHkALUQVoWYrWXYseMM/66QbcNv+GyQkCfbngKsewvtxdbvHVwyVmIkEXUNAXSmqBwpDH HENcO5QBafI2gVUF1cS53f5RoWzDytcV1Py0Kx+u+QqXH5AzFooxWAwifV5NwvlfaAMwrnsn9gqZa 2T0YbJg7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvMt-0004Ve-Pr; Mon, 28 Dec 2020 16:27:35 +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 1ktvMr-0004UH-Lq for wcn36xx@lists.infradead.org; Mon, 28 Dec 2020 16:27:34 +0000 Received: by mail-wr1-x434.google.com with SMTP id t30so11797290wrb.0 for ; Mon, 28 Dec 2020 08:27:33 -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=b09nwm7NaeS1J9x71TcNl2allAdNLCiHKyq9pTgIlF8=; b=gMjL3dHhsy2tfSfXubl1Td3kE3jdr+nWcP/IaMuZUtClF/usQU9BEY4wiqWeG/Ip36 sYe+UCnI6Lgbgn4KT2APFWFdAlXD1kRSDlzn8yDEK2Zup5+Ntuvy8jXG1M5K9X8H8MIz ZXhFT1Tk+FfJLbNS/FHsT3Yz45uWXLsPGybv++12wxhooX5lZdY+DcHoEyYqb/4N9YRz Al/Z56dPnS+8jgu9VpZiY6JxiwRTsiujTplUO9jBR6uTdwUJtNAueGpRwkv/IUOGToYh QvogNviebwyhN6q38sWAJFAKw7kzb4teoOCUoj1X06k8WSvnUQbcPoCPjPNxDdH+/3ir Iipw== 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=b09nwm7NaeS1J9x71TcNl2allAdNLCiHKyq9pTgIlF8=; b=cZcHLmdirikEVh+gzazmGA+16PCIsMC2e36SfKp6wE1VQDtOuEM1XXRytJYgAw7MXR /ThMm41cTkt6Pw/TeINmaJFprMfUVapL+qhAGO259FrYcWkAy33T9URp7ozkrs3kLeGu Lzi06D5Zdm2cXJ3GZOESHg2TnS6VeiEXSaW5KBk0aqZZNAlveOeEBtv+LL0e0peN764H IknnWxRq8/WnqSX2Sbqktelu7BDVlTU2a9KSzU4mvKWBXe9DIE91ambSOxIpZWq5A2a2 Sq3be3ba/TxiS/5xb/XET2pcXCak9KhKLGxUZgBaCFh60u4NXl8WFthwTDBz3QPyB1np DZRA== X-Gm-Message-State: AOAM533uVlHem5PZVj7fgIfX6rUr5XeCflJpJm6Scd5vGv8f/HrtYQNq vA5CIsyscsR63GmFoOaVOy8bYw== X-Received: by 2002:a5d:4641:: with SMTP id j1mr52201878wrs.94.1609172852271; Mon, 28 Dec 2020 08:27:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:31 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH 02/13] wcn36xx: Run suspend for the first ieee80211_vif Date: Mon, 28 Dec 2020 16:28:28 +0000 Message-Id: <20201228162839.369156-3-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_112733_767804_9188AD38 X-CRM114-Status: GOOD ( 13.21 ) 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 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. This patch constrains 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.29.2 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Reported-by: kernel test robot diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a863a90232c9..b90664bdf6ee 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; }