Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1576041pxb; Tue, 8 Feb 2022 22:51:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMMVq3v0hFxtxtwvUCizEU2mgnLBdGiB+m+Rb1+etH88qIwfs5MDYxbfwDCOjDYkMqG4YN X-Received: by 2002:a17:902:d502:: with SMTP id b2mr762663plg.111.1644389489721; Tue, 08 Feb 2022 22:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644389489; cv=none; d=google.com; s=arc-20160816; b=HfCLf1w3jVx8o90Bdjg94bx+DNdMMSre+DRwbXYOpDOWdAOUI/92hqEO+WjIy90hxf kLvBF0T2G1R0g5tGr8bWUvsoeV0uMErOIq7lEVuqwlN2NDPoVOBEBHtPsKfIUIZncSEL LEQ5hG2w4iEc0PeXrQd0WjDw9KgeFTaGF2rMzrjnDRYl5aAT6ykXRF3nGXEWB72Iivlh QLcIsjiesuEL8gRdxwItA7vzicx1faznvzGEi7PgHA8Flxooj9QCiXzgd4uOyt+6/MPK k/q6UPUTl2C2jk5S4jcDduk99Dd+hzwy6cMCYtAslV+Ee8rP7IekvE0dgEtxssMpohIR Zwbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/ufmgCZhNxrixdb0AmdDBdKngGMzV7q8LdIDmTSoE1c=; b=hVPozMjuCQW0sGja1HCLklPL1gFs4CYOM5Ud/G7bn4GFJWv3yjFXHV4a/sblchtPmL UsPR/jwybNoI92JzXtQyWM9DHvlpll7kZWZJQxdZPdWhhSPxLrktrDqBb6s/gg8miftN EI7fdxV3zg8GQuX+OOiXsplU7/J6CVOX4E3/aCZFZuFhXKF94PNsL+orxfFXHPQ0EZLP 31CwCQUjeB7Ro4H+aC9Bu2qjG8dVYwa0EDa2WAyT/JOinv4h9DI2GCTL+Q2ujoa/EZsL B5VsQGraa3v3RCC+vLUFkSFO1ThGIoUa1HLrA4z5R4kibGLFRUrIXcmWc3YdcmCAjCNJ 9Dpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=LPO7t1RK; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q4si16169640plk.96.2022.02.08.22.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 22:51:29 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=LPO7t1RK; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DD022E04EFC9; Tue, 8 Feb 2022 22:23:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348975AbiBHIP7 (ORCPT + 72 others); Tue, 8 Feb 2022 03:15:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349101AbiBHIPp (ORCPT ); Tue, 8 Feb 2022 03:15:45 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E86A5C03FEC1 for ; Tue, 8 Feb 2022 00:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644308144; x=1675844144; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=/ufmgCZhNxrixdb0AmdDBdKngGMzV7q8LdIDmTSoE1c=; b=LPO7t1RKtzsDCZulkU2GvdkvZJdAKY6hNpbRviW7k/lQw2J/fWbdexHO zPtRHKtZvZ43OHbLISExXqBJtqpbhAw7BHT6CX1+NNZ+MuRFd33ChJ6Kt dvQ2+7PUp1lNTZ7FFuAIcpnhlgiogktQPvrQLQ23aRs5xn3whpI25ze4w s=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-01.qualcomm.com with ESMTP; 08 Feb 2022 00:13:42 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 00:13:42 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 00:13:42 -0800 Received: from cjhuang2-gv.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 00:13:41 -0800 From: Carl Huang To: CC: Subject: [PATCH v3 4/6] ath11k: purge rx pktlog when entering WoW Date: Tue, 8 Feb 2022 16:13:24 +0800 Message-ID: <1644308006-22784-5-git-send-email-quic_cjhuang@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644308006-22784-1-git-send-email-quic_cjhuang@quicinc.com> References: <1644308006-22784-1-git-send-email-quic_cjhuang@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This change is to purge rx pktlog when entering WoW and reap the mon_status buffer to keep it empty. When leaving WoW, host restarts the reap timer. In WoW state, it's not allowed to feed into mon_status rings per firmware team's recommendation. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang --- drivers/net/wireless/ath/ath11k/core.c | 3 +-- drivers/net/wireless/ath/ath11k/dp_rx.c | 1 - drivers/net/wireless/ath/ath11k/wow.c | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index cf1c5f32fe49..7659dd78d2a5 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -521,8 +521,7 @@ int ath11k_core_resume(struct ath11k_base *ab) ret = ath11k_dp_rx_pktlog_start(ab); if (ret) { - ath11k_warn(ab, "failed to start rx pktlog during resume: %d\n", - ret); + ath11k_warn(ab, "failed to start rx pktlog during resume: %d\n", ret); return ret; } diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 99dc9b5bbf4b..2e34b508a358 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -5573,7 +5573,6 @@ int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab) /* start reap timer */ mod_timer(&ab->mon_reap_timer, jiffies + msecs_to_jiffies(ATH11K_MON_TIMER_INTERVAL)); - return 0; } diff --git a/drivers/net/wireless/ath/ath11k/wow.c b/drivers/net/wireless/ath/ath11k/wow.c index 63577e018518..f798b5c30e47 100644 --- a/drivers/net/wireless/ath/ath11k/wow.c +++ b/drivers/net/wireless/ath/ath11k/wow.c @@ -13,6 +13,7 @@ #include "debug.h" #include "wmi.h" #include "wow.h" +#include "dp_rx.h" static const struct wiphy_wowlan_support ath11k_wowlan_support = { .flags = WIPHY_WOWLAN_DISCONNECT | @@ -562,6 +563,14 @@ int ath11k_wow_op_suspend(struct ieee80211_hw *hw, mutex_lock(&ar->conf_mutex); + ret = ath11k_dp_rx_pktlog_stop(ar->ab, true); + if (ret) { + ath11k_warn(ar->ab, + "failed to stop dp rx (and timer) pktlog during wow suspend: %d\n", + ret); + goto exit; + } + ret = ath11k_wow_cleanup(ar); if (ret) { ath11k_warn(ar->ab, "failed to clear wow wakeup events: %d\n", @@ -595,6 +604,14 @@ int ath11k_wow_op_suspend(struct ieee80211_hw *hw, goto cleanup; } + ret = ath11k_dp_rx_pktlog_stop(ar->ab, false); + if (ret) { + ath11k_warn(ar->ab, + "failed to stop dp rx pktlog during wow suspend: %d\n", + ret); + goto cleanup; + } + ath11k_ce_stop_shadow_timers(ar->ab); ath11k_dp_stop_shadow_timers(ar->ab); @@ -645,6 +662,12 @@ int ath11k_wow_op_resume(struct ieee80211_hw *hw) ath11k_hif_ce_irq_enable(ar->ab); ath11k_hif_irq_enable(ar->ab); + ret = ath11k_dp_rx_pktlog_start(ar->ab); + if (ret) { + ath11k_warn(ar->ab, "failed to start rx pktlog from wow: %d\n", ret); + return ret; + } + ret = ath11k_wow_wakeup(ar->ab); if (ret) { ath11k_warn(ar->ab, "failed to wakeup from wow: %d\n", ret); -- 2.32.0