From patchwork Wed Jul 13 09:44:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 590818 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 743E2C43334 for ; Wed, 13 Jul 2022 09:45:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236242AbiGMJpg (ORCPT ); Wed, 13 Jul 2022 05:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235743AbiGMJpN (ORCPT ); Wed, 13 Jul 2022 05:45:13 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16489E0279 for ; Wed, 13 Jul 2022 02:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=lJBSwg/SVx5pUshcnIiKChSII5Xqe79jbTlXiQEbcHo=; t=1657705512; x=1658915112; b=Usk93poo0tm+JmKQR5N4/oLXN8i3jDwhWLJ9s5Va/pjkB9l wL6ksV1rW/tqs1Ga3tGpLFYvPHWInXq8bsap50z5wP/O9DgCrUq1US4jq3WcL82vOpMv+sfcKOxcI LXnhlhEHMDH0WhfpZpgBzjNPvnuVOTvh4p1OdZ2Oh9la8RfSTP21WvTCmEP6GAaYDfsnQbU+CMqUg SeW8rdxz3/5pSiGwMMFpdcTUUFuQ1rYGiW1GkA2CQe+A61S3vqXzXrhk4Sb+fMQHIk2sRXrSf0xad ugL6v5UM6aSgvlIXxVEPIas35vvVrehjK93H8Gua+dK8epLSMxRQ3avSFWTCcc4Q==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1oBYve-00EgvB-Fe; Wed, 13 Jul 2022 11:45:10 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 20/76] wifi: mac80211: skip powersave recalc if driver SUPPORTS_DYNAMIC_PS Date: Wed, 13 Jul 2022 11:44:06 +0200 Message-Id: <20220713114425.fa593e78de9a.I67a99fcbfcac0cefb4dcbb85e8b7d719b16d8a7c@changeid> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220713094502.163926-1-johannes@sipsolutions.net> References: <20220713094502.163926-1-johannes@sipsolutions.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg There are a few places that check ps_sdata and/or the dynamic PS timeout, but they're erroneous in case SUPPORTS_DYNAMIC_PS is set by the driver. Skip the entire recalculation in this case so we cannot get into those paths elsewhere, and so we simplify this for the purpose of implementing MLO. Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 28bb7609cd4c..74676bbd6e23 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1818,7 +1818,8 @@ void ieee80211_recalc_ps(struct ieee80211_local *local) int count = 0; int timeout; - if (!ieee80211_hw_check(&local->hw, SUPPORTS_PS)) { + if (!ieee80211_hw_check(&local->hw, SUPPORTS_PS) || + ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS)) { local->ps_sdata = NULL; return; }