From patchwork Thu Sep 16 15:56:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 512997 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1375940jao; Thu, 16 Sep 2021 09:30:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhbCCdxPuVTzdxg7ZAYPX6ZglTzFCD4JMf3yOXCID/72Hnw2FEtZ+m1jzIKLAVN4eqheyb X-Received: by 2002:a17:906:2505:: with SMTP id i5mr7172463ejb.450.1631809859431; Thu, 16 Sep 2021 09:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809859; cv=none; d=google.com; s=arc-20160816; b=DYkxH3VxH7sOOgwYcx9WtxP4AZUmObfxUAKkg3390QZ8KwPkkXG9JLcYkdOOBw2hc0 gs0smhGgWm2NIpdqJfabMDsGX6mIdbGWUg+ax9dUN4J7saU0GkzzJbu3u5Y2sfwQaC+7 996ystbe0M81Lcj+2bVkPqF9zX8P90dP/tMhyF7DzttXdhFQm+Spcj9JqyxR5IQI9KE0 IcENdkm2ZKLSNomG8f1SfPvKBWYBQ5dz5rGHs8gc/314Jcbtkvv7852IgHpoJYF/NmKJ ukuoSk4iFVKmT5MuiVxBiOXxd2FXGRTCo67D93yh8H+GuBbgP59+uoszGnzlD0yaNoyW Zkmw== 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=2/uvdpumGK202pQkmyjHm4UBVt9Hq88Gg9LgfMsutDY=; b=k9xk9b+32icyC28o+zpgjzgOHTwDXPnfX/2awfl0XKsDWiNpSDp8RSbQnKFoi8dJR3 izJxTKcIdUDOVPB0DGuqUw63gO0n8j2z9mzVAdtPuExLrwrboR5dvDWLrqf2z2O4huT0 mSzPZx8XMJUOtlGyQv0Kj5v2pNRuAp54kZx0U2d15QvOoHT9eNkr8rRe+vHOn/iZjHwa 92HDBqZGVnSl+Nvh6eZ7NnZje+1MLaHzRaUZN35fwecOUu5aBerhuPgoXJz9cRUosX8Q Cf116IfKnF68gifPtGRhvsJXCO6GDEPu2uXh1Rzia0e20wHRem+ODzHdam1GS4bpdp+J AJUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a9LWaMH2; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 j6si4255101ejj.365.2021.09.16.09.30.59; Thu, 16 Sep 2021 09:30:59 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=a9LWaMH2; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S234180AbhIPQcI (ORCPT + 11 others); Thu, 16 Sep 2021 12:32:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:38076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242770AbhIPQ3c (ORCPT ); Thu, 16 Sep 2021 12:29:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A65B9613CD; Thu, 16 Sep 2021 16:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809116; bh=CZX9hFEuuv+TvcCH68DWtIHvUD6Zy5/Gc52/zDqW/9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a9LWaMH2v3y90MwCeggvqlP5TtfZvITdsH+lb9YKfVhteOc/Haxv58I/kaf2/NBPR lPTAI6kOxwarbWCkxX7XtqOkOrbt7pr82Q7Q6jYuOBQlWh54hETO6XmTXaCHTcnAES xmhM9e4Z7hDd8MruG+gPF5ZG6GqkyDO6YKUUa954= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joseph Gates , Loic Poulain , Kalle Valo Subject: [PATCH 5.13 035/380] wcn36xx: Ensure finish scan is not requested before start scan Date: Thu, 16 Sep 2021 17:56:32 +0200 Message-Id: <20210916155805.156512644@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Joseph Gates commit d195d7aac09bddabc2c8326fb02fcec2b0a2de02 upstream. If the operating channel is the first in the scan list, it was seen that a finish scan request would be sent before a start scan request was sent, causing the firmware to fail all future scans. Track the current channel being scanned to avoid requesting the scan finish before it starts. Cc: Fixes: 5973a2947430 ("wcn36xx: Fix software-driven scan") Signed-off-by: Joseph Gates Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1629286303-13179-1-git-send-email-loic.poulain@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/wcn36xx/main.c | 5 ++++- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -405,13 +405,14 @@ static int wcn36xx_config(struct ieee802 wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel switch=%d\n", ch); - if (wcn->sw_scan_opchannel == ch) { + if (wcn->sw_scan_opchannel == ch && wcn->sw_scan_channel) { /* If channel is the initial operating channel, we may * want to receive/transmit regular data packets, then * simply stop the scan session and exit PS mode. */ wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN, wcn->sw_scan_vif); + wcn->sw_scan_channel = 0; } else if (wcn->sw_scan) { /* A scan is ongoing, do not change the operating * channel, but start a scan session on the channel. @@ -419,6 +420,7 @@ static int wcn36xx_config(struct ieee802 wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN, wcn->sw_scan_vif); wcn36xx_smd_start_scan(wcn, ch); + wcn->sw_scan_channel = ch; } else { wcn36xx_change_opchannel(wcn, ch); } @@ -699,6 +701,7 @@ static void wcn36xx_sw_scan_start(struct wcn->sw_scan = true; wcn->sw_scan_vif = vif; + wcn->sw_scan_channel = 0; if (vif_priv->sta_assoc) wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn); else --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -232,6 +232,7 @@ struct wcn36xx { struct cfg80211_scan_request *scan_req; bool sw_scan; u8 sw_scan_opchannel; + u8 sw_scan_channel; struct ieee80211_vif *sw_scan_vif; struct mutex scan_lock; bool scan_aborted;