From patchwork Thu Sep 16 15:56:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 512975 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1351171jao; Thu, 16 Sep 2021 09:05:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhpY4fULOL9cfzYKUSbJRjeIamwJiOE33qNpeRoeSOUYCLDTDKoXo3Uo6OayfwQJNYVZBa X-Received: by 2002:a05:6638:2385:: with SMTP id q5mr5037573jat.5.1631808305868; Thu, 16 Sep 2021 09:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631808305; cv=none; d=google.com; s=arc-20160816; b=lL4/4UdZvT0QQHAKkrGUK3BetmVuC18cs73muRfctqFiTpoW4yZGvj0CI/s2sCrLNJ cuHHljYCEIsMG7E8Du2DY6JirNMXB6SBk2GmFd2+ayh5w9DNw/5F4gbPshpvA1+ARvE/ RFny56cNNfF1zWIzg2SNA0xcWYnWTxrlJevmRzqNSX2n5D1/xOv6ml8R95PrXkeg1fLb PsyyDak41btTd2ggPPsFST93JyMH8Rg3MOiHHClmjq1OjqsqwK80Vq2pYsEv2M9s7bZn jB+llw2WVRi+WXVGHCO+A+dEqSmbCq5GOC1xJOTweBGVAHsjyxCbx9ReuR4n/jfEnD/Y cowg== 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=xB3TPLq8QN7Y7ExbgsvHwqa8O90zYYhmz1NIhAJERe4pYPyXDC3J+Zyehdhhp5BwyM h3MmSrVg+blV1nk2rgHqc0M5yvhNYodqdyJAK4Vc7Lrmn8KGoyI6AP2bWRpRNPtK/JIe ftLv1EFj7jX7IckoAk9JUAeutf0XKmEQYzGtL8XMSxEfPl1sDpRHHb4JB0zouBHFd5x8 m3PL4f0y7FCb5lh9bRaJw6BAUN3bI/R7iTnox+5ExUCugKCj3fILMO7C8CyxUQtggAVS jKMvYp7SPo/jwAUopFCpatIVaXGlYHsI1veCY1diFR421JLm/h5zoXwBRA/SxivpTQwJ itMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bJ5HTwjU; 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 b18si2958472ioz.23.2021.09.16.09.05.05; Thu, 16 Sep 2021 09:05:05 -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=bJ5HTwjU; 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 S233142AbhIPQGY (ORCPT + 11 others); Thu, 16 Sep 2021 12:06:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:45208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240686AbhIPQGC (ORCPT ); Thu, 16 Sep 2021 12:06:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8022560232; Thu, 16 Sep 2021 16:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808282; bh=CZX9hFEuuv+TvcCH68DWtIHvUD6Zy5/Gc52/zDqW/9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bJ5HTwjUq6U3mzacvpJcvicAohsp3vKH0J4Ai1z0WylL0ISDxK44lQtMGouZBpOlT KJgcfKgX8f3xsKZkYWfZYWtQ6B0lp29weco7NC1dWCTJCFWbuK8joTCogigojPxbRf UzNrxAOQlj3p8vzkTORfaUfqt9zWr0RnMPt581yk= 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.10 029/306] wcn36xx: Ensure finish scan is not requested before start scan Date: Thu, 16 Sep 2021 17:56:14 +0200 Message-Id: <20210916155754.934611386@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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;