From patchwork Tue Jun 1 02:49: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: 451343 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331359jao; Mon, 31 May 2021 19:47:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd6FgN1aPy+ISnj1buDd+qUp+z2ICVO11iujjFvPPpaiQwjzM5Q0uWL9MLQmlbtCzMTS6F X-Received: by 2002:a17:90a:5405:: with SMTP id z5mr2219724pjh.38.1622515664570; Mon, 31 May 2021 19:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515664; cv=none; d=google.com; s=arc-20160816; b=CtvzyFQTyWkLVSCndf1YREwPXMeUgMtHlSGL2XcYakwH6A17Xc6hs0c1PJNNArjlsb F0W0Lrc6uDCbmSuPu190ibXb2kGLmZQG/WZhOS0btms0vZsmhszQ4g6cRO0UY97MKPms HfwRQ/qaezmoX0wrzaJ30p2NN9VytteFaDfJmMEL6e2hAQy0GRk+QVyIsLVkwLpjuRjm Y4uH3HrNq5KH5L8EZWSKeZIdxOXZlHFVzpEiUAltMoC4x4orSsjhnf8ENzSqIOGAYzJm 46LszF4Hc7juzOXTEQuTCbDImepknufLSP8ZqDqDUfo0zzXxSb76GOk1v7NByAJMk1PA R87g== 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=up/pnq+Lq2vqkduyQD9YNvjePSJBYaAKyFSoDkItQNo=; b=c+Am8oRBGzB3Z99KK3ls2QuahbryHsnnEgsrQPI/su3IUbLwCVKaTNrNn9HBYPPm3E LwCqU9RQgJqEAkTc94I7Fy9NRB/vW2sCUVsJ6dvu9/AZAIt3tLPpO4+eDAWf8SwBLx0w 8xDTcBVmGWP2WCCn2D6K1ZcgmRc3+AmSX4CtTG3fD8tbR50+CtFDdR4Jqzmrkd4dpXCF TrybY3llr1io83q6JuJJXe/ESlpJJJMjzFsNL9r1+4yaO9vti9UGme+gES2QJMjTvCxn 0EVYbGDgdaFw2QU+nOfe3wv1U2CUE0UjQ7rU4G/qo8reoe1aBfwoFqhYbSEEUaXdFi8e bQ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=aEYmcHuf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KPXxiBTA; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 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 bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id c3si18784174pgv.41.2021.05.31.19.47.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=aEYmcHuf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KPXxiBTA; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 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=bombadil.20210309; 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=up/pnq+Lq2vqkduyQD9YNvjePSJBYaAKyFSoDkItQNo=; b=aEYmcHuf4N1rlh zogdtOrJ6VgRKsVO9vw08PLxK2WPZatYaQ+tnA1hMP7ni6I4DjyNPiyAuspGiqss32EEleaGFk41F SlqXZuWPUKEAFIOFa1skCQjmjCsAFzGmALJICYgsnbSxRCnfR063veV1Pl1EoIuiiTZvvHLObjAI0 qyTRs0dzBQw474lELTYdyblHZmmfxv9U/3olntTdLXeNs3GaR2TCun17LRCds3seGOAYJtHX9fYXJ pu6DKmJY2pmN1rxemyjm3irTs+zMVIhQ5Hz0OmR+avot6Xtf6GqWBLZXyBPf/goSqWRMpRArKxdbI 2aWZ1acAHfbG72LTE0SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRT-00EJGu-Tu; Tue, 01 Jun 2021 02:47:43 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRQ-00EJEU-MM for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 02:47:42 +0000 Received: by mail-wm1-x332.google.com with SMTP id g204so3946680wmf.5 for ; Mon, 31 May 2021 19:47:40 -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=ONbc2ptFm/dZBx8XWwy/A/AaOhsPLbrPaqAnpZ4ZWqg=; b=KPXxiBTA8FxhMKM8KZz+vK8VjkqSPmQiNujL5TY+RPM5AHVzbRSuWPP90/09WzX4I7 ArL14S5OhYZgTICy1tZ5GtDi7CtDmshzwk7yi97HG7w3ZMMSaposNJk70digd9mF8i+f 5KU06iHAWwrKJgQ2SfvqF2YvA8uDs0UzqeE+3CHeEadj6X/t+QhZjhor6hAjoBXwKN9x hBj9kZwg83yfYjMkyYZzjjHVvGomG2mu2Sa3vMAHdwlaqULnEfTZYQs7aVqz+sknz5f/ cuAYC2vUjlxeuk+Ait4jfMO+3nohBq2bYx+aUj5l+rWoxdpUx4/sg26KXcGm3nmHN1rV E/Ag== 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=ONbc2ptFm/dZBx8XWwy/A/AaOhsPLbrPaqAnpZ4ZWqg=; b=MFcXuVK9SV4WYZI457E63okkpQVlNJY4VKRTCskxhx01UNBfHHPTv8VLDqmCWX9AA/ NtiK5xki0YQvvd37LB7h/6tTTFXgKpLwJC2XbVNMaKjbCmkRGWqyPpWfLLBWHpUCR8xP YPtgIQ7uqAe7nD4ELSvhFxatdiVR6rAW70SABKjYZr6DAU0y2MIrjwqutDO6vqAqxAOV 9RQL4RrH4uP1u86rf02sLouFaAP77mfQX3op/4aV/sA1aPDUwe76DsdR2aC6ZC6p35vt aozTRvGj9y0DaUQvnDh0goOM5Y7qXh3cH/tiO7EvM52uSZidBO940IQRXRmg5EaAr9So 3cxQ== X-Gm-Message-State: AOAM530Ww5HYzS1p1b3w7sroABhslhp2veaog89Njb7vre4RJgMTKYCc Fu2m3NygE5ktQ69FDVXSZLBzqQ== X-Received: by 2002:a1c:e343:: with SMTP id a64mr3209594wmh.114.1622515659249; Mon, 31 May 2021 19:47:39 -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 e22sm16774014wme.48.2021.05.31.19.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:38 -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 v4 02/12] wcn36xx: Run suspend for the first ieee80211_vif Date: Tue, 1 Jun 2021 03:49:10 +0100 Message-Id: <20210601024920.1424144-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-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-20210531_194740_751857_D8C36888 X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:332 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 Message has at least one valid DKIM or DK signature -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 -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/main.c | 30 ++++++++++++++++++++++--- 1 file changed, 27 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..6802dce2a02b 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1088,15 +1088,34 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, #ifdef CONFIG_PM +static struct ieee80211_vif *wcn36xx_get_first_assoc_vif(struct wcn36xx *wcn) +{ + struct wcn36xx_vif *vif_priv = NULL; + struct ieee80211_vif *vif = NULL; + + list_for_each_entry(vif_priv, &wcn->vif_list, list) { + if (vif_priv->sta_assoc) { + vif = wcn36xx_priv_to_vif(vif_priv); + 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; + 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_assoc_vif(wcn); + if (vif) + ret = wcn36xx_smd_set_power_params(wcn, true); + mutex_unlock(&wcn->conf_mutex); return ret; } @@ -1104,11 +1123,16 @@ 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; 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_assoc_vif(wcn); + if (vif) + wcn36xx_smd_set_power_params(wcn, false); + return 0; }