From patchwork Tue Feb 8 08:13:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Huang X-Patchwork-Id: 541069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F2FAC4332F for ; Tue, 8 Feb 2022 08:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348975AbiBHIP7 (ORCPT ); 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 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) 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);