Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3629677pxb; Mon, 24 Jan 2022 13:56:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUNV1aB0NpywXrZQhqa+y8u3C3OEmH24obhXfq/EPqcdaxsKNMi85i4YA1vl1xiK5YvxX2 X-Received: by 2002:a17:90a:4407:: with SMTP id s7mr334241pjg.126.1643061275561; Mon, 24 Jan 2022 13:54:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061275; cv=none; d=google.com; s=arc-20160816; b=E4nAv1Qj8dg1XFuz93iBxbSwJTzgK/aTzb64VWHmOi5XrgTo+vAybaTpCKp4P0fmvN rnIiZ1W455gY2g83757snNW9o0N85GsMlNbFPaFzoag+cm7g/aeHzU5EpDIyUP2HnduA vQmDj6FmRdvPzs+OH7L/2RMBM9ZrCvL+FFp42a5cp6mkZWvexbyaCCCvqo3TK1a4ORqx B5udbKE+c+bS/m7Uz5Cp2Ab+OYRIoCPy1WE08YxW+woYJvlaqQMVQyf/TYghKeOlxRVS pON5/h+Ib6HqeLSOTwoWNKthmgoV6Y2Pzkf1IdmS1bd9nFUmSkPN5y8Yqv4X2G108I37 3faA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hztpD773E9vdT7dbyn7cMr/PBNw6YPPqb34ZbeUDIpM=; b=k6p1wrqI3NXdGMsWhJQSpLuxdLfGkZU+NlAosoyZRrX2IcM1C2rkygQ2U/PK8jbvci xEVe1PJ8GxXbKByV1U3Pz9MgsRDKI3WWpb178qUsX2Qz93A0TVw6SNdbCmwUUDzb/hfl SwANPZw9OEadpj4c4lLdoISbgnMr6o9Sn7aRvIKL+Hg+8SgxG04aGFTxaYZ8rwX1RIdM YdDDsQeHO03glh5Wap2xR+AVD0TbJbEe4Ij43VoydlpyROrgoZREj7JcVZWE1xCLoisn wRnUlG1qgtmn2vbpLegL0G4k21ZP8gsJ26J0VUaKAWtPIc34hg5KdODYoWHKJnm1gIzL C0ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=baQuRUrv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si2950410pfi.188.2022.01.24.13.54.20; Mon, 24 Jan 2022 13:54:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=baQuRUrv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1458173AbiAXVms (ORCPT + 99 others); Mon, 24 Jan 2022 16:42:48 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:59368 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446847AbiAXVJc (ORCPT ); Mon, 24 Jan 2022 16:09:32 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 421E4B811FB; Mon, 24 Jan 2022 21:09:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 590CEC340E5; Mon, 24 Jan 2022 21:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058569; bh=HAxnIYUvZDrbYUQuiX/NRDtGF45GALErTHSE5Q6bXDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=baQuRUrvVBNidnL6PACKoGwL++nySnoqvP32gIZ/XMIru3ef027SiL2pD0cHbHnP7 dgQ1BZOsO9ij4QQ6K36gF25BWSPgRt34phceq3m8X/jNIo57jF6FYX/Fr4v9Uy0S64 d1+ckjXFAj6qqT2D8wVka0jXBv+l/7ed1566M3Hw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Avraham Stern , Luca Coelho , Sasha Levin Subject: [PATCH 5.16 0330/1039] iwlwifi: mvm: perform 6GHz passive scan after suspend Date: Mon, 24 Jan 2022 19:35:19 +0100 Message-Id: <20220124184136.406568617@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Avraham Stern [ Upstream commit f4745cbb17572209a7fa27a6796ed70e7ada860b ] The 6GHz passive scan is performed only once every 50 minutes. However, in case of suspend/resume, the regulatory information is reset, so 6GHz channels may become disabled. Fix it by performing a 6GHz passive scan within 60 seconds after suspend/resume even if the 50 minutes timeout did not expire yet. Signed-off-by: Avraham Stern Fixes: e8fe3b41c3a3 ("iwlwifi: mvm: Add support for 6GHz passive scan") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.6d5c043372cf.I251dd5618a3f0b8febbcca788eb861f1cd6039bc@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index a138b5c4cce84..ab960f86b940c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -1924,22 +1924,19 @@ static void iwl_mvm_scan_6ghz_passive_scan(struct iwl_mvm *mvm, } /* - * 6GHz passive scan is allowed while associated in a defined time - * interval following HW reset or resume flow + * 6GHz passive scan is allowed in a defined time interval following HW + * reset or resume flow, or while not associated and a large interval + * has passed since the last 6GHz passive scan. */ - if (vif->bss_conf.assoc && + if ((vif->bss_conf.assoc || + time_after(mvm->last_6ghz_passive_scan_jiffies + + (IWL_MVM_6GHZ_PASSIVE_SCAN_TIMEOUT * HZ), jiffies)) && (time_before(mvm->last_reset_or_resume_time_jiffies + (IWL_MVM_6GHZ_PASSIVE_SCAN_ASSOC_TIMEOUT * HZ), jiffies))) { - IWL_DEBUG_SCAN(mvm, "6GHz passive scan: associated\n"); - return; - } - - /* No need for 6GHz passive scan if not enough time elapsed */ - if (time_after(mvm->last_6ghz_passive_scan_jiffies + - (IWL_MVM_6GHZ_PASSIVE_SCAN_TIMEOUT * HZ), jiffies)) { - IWL_DEBUG_SCAN(mvm, - "6GHz passive scan: timeout did not expire\n"); + IWL_DEBUG_SCAN(mvm, "6GHz passive scan: %s\n", + vif->bss_conf.assoc ? "associated" : + "timeout did not expire"); return; } -- 2.34.1