Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp509517imw; Wed, 13 Jul 2022 02:49:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ut1PjEeWvSi/DB14Ia1bZbBeL6FQeUXMWkXqWf9Q1LXv6D+kfyqF9w65auUB9Pfu3PqG2d X-Received: by 2002:a62:1891:0:b0:528:5d43:c3ab with SMTP id 139-20020a621891000000b005285d43c3abmr2524077pfy.79.1657705709698; Wed, 13 Jul 2022 02:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657705709; cv=none; d=google.com; s=arc-20160816; b=MjQdJ5JVxVtdAwsvB6Rrx6ajQsHmaOMOfy0DOo1hinmRwKOUiHjuftvawxcsw4IxPk T+bbSfoZCHE2a/fATCInKtbsawulo50cz1cZ4ceWdJeWoSYyvQoh1a2WZ0E7cuZYyJmE QuBXXcT1rQzJca6OR0sEvPJplZ7Supl4XeCnWlceMjwbvSeL8B4ow5QEyEuruiIuA7fL x6tueO2vDaR9Xhe2X1LBlrWOpsqx4P5M05Pmm8ktXBZhav/aVt16r3do+xYys01eIC+K wyL7TDCnmEwZkgQenB52BIeBSJBUBq4k+L79hZiAom0Laja0Uv+UZhQZ/z67hWbSP7KK NcdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lJBSwg/SVx5pUshcnIiKChSII5Xqe79jbTlXiQEbcHo=; b=ouhfY1BMbF80UU0m2AvMXzpNq5qm/xcTZhHufh5j1v/ANDyMkdq4UzR4O/nPA6Sdbe ivYrbCsXerC9NKHuLQFw+wNG2CDODFGHhGKlaI5TWom5YJDOZS7ZjlHdqM7k8p2abWsG kUH6uvdSmUChKZUaVeyW8CQVOkFYUsx+qdPCLNcUFU+YN1ALl7EJX9/xnr7Gnss/dgDx NrneaI6F+kfoXpdovJugYQh/eoaxEfK46/ckUrpaCRmBBOX1snw7u6i+hAhfgec//Hg8 V3z/V95VObSm9jmScTy9CWIVfhJi8OijsnIxLoCexF9EqeiWjDLjbk4qNkr+0YTk2U4L h7yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Usk93poo; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a056a00150f00b00527cbdcec81si17990130pfu.127.2022.07.13.02.48.22; Wed, 13 Jul 2022 02:48:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Usk93poo; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236242AbiGMJpg (ORCPT + 65 others); 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 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; } -- 2.36.1