Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1378004rwe; Fri, 14 Apr 2023 20:51:41 -0700 (PDT) X-Google-Smtp-Source: AKy350ZROPKvwssku/jFIK2i/1sLnWWglut2S4BEwcSkDfgzHwisiGgevIzJ/KYfRIzcz2NOWdmA X-Received: by 2002:a17:90a:2b0e:b0:246:f8d7:3083 with SMTP id x14-20020a17090a2b0e00b00246f8d73083mr7704971pjc.16.1681530701491; Fri, 14 Apr 2023 20:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681530701; cv=none; d=google.com; s=arc-20160816; b=eAkDfS99xrfgDpOmDa0e+dtBSVdAgLTTf3/hZ2vXdafkV8/CCedwYqiPIAd9fRWbJ4 FI5KEgoE9WsVZ8PBMCUZk8Xui6lmpBrsQMiPTgftt6+KjvA/sMDW0UO5zDhQAmVQuJsY jg+WmtltzSAD7gbqkzljKhlLZ9frH0S+W2tiqvcuIhXec3gVLX4cz05Q7MQQFV9lNvPm jJGLdiFHP2XfR+Za4Nk8bllHvFu6+0RlN8vvMtJxEauVo8tZGJkEWTl4AyteKh5b1Dz3 Hvcy/+iPS/XYMGkefc4mCx7OWUvr/dDtW7kP0qfRKL6IGZzSw+Khj+PkbypVVxEmxzPy 2bgw== 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 :authenticated-by; bh=GdvQoZ7i9+Rf/N5cZ2LnAnT/KwFZY1edwbkWGH1/uig=; b=tqshsF9J9S4Ps4cSJoVFKRSl/MST5brVKpqVsmc+UBe3fu7Xa1wGeIO0YfzeHqIddZ GYqAYrT7tsV821omx7H5gPB2U3zWJiRJkAAEHhUiBTsgKDNU0eZt0PwcYwRvY7yc9q3C mD8F3Y0H1vXghH97rqoD0tS2UlERURPRBlXd7rOU/GG5BUFkrQb1z5hK2/4wqr/7VI92 Nzz4gOVIkwEnYWSmHgJg65UWCDx/cPo1v5fTjzsWJ0gyJTXrhB1k7xvwrxuZqSxlwZU/ iamMXS35h7P6vVg2WxKzfsMSHC9qlJhxZo7KJ7bZt8r6YXNlvK/Nh2VUdi4oA92ZPCNS FPww== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i190-20020a6387c7000000b0050c0674ab43si6534509pge.378.2023.04.14.20.51.32; Fri, 14 Apr 2023 20:51:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229625AbjDODuW (ORCPT + 63 others); Fri, 14 Apr 2023 23:50:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbjDODuT (ORCPT ); Fri, 14 Apr 2023 23:50:19 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4011955B4 for ; Fri, 14 Apr 2023 20:50:10 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 33F3ngpJ7021908, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 33F3ngpJ7021908 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Sat, 15 Apr 2023 11:49:42 +0800 Received: from RTEXDAG02.realtek.com.tw (172.21.6.101) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Sat, 15 Apr 2023 11:49:25 +0800 Received: from localhost (172.16.20.53) by RTEXDAG02.realtek.com.tw (172.21.6.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Sat, 15 Apr 2023 11:49:24 +0800 From: Ping-Ke Shih To: CC: , , Subject: [PATCH v2 1/6] wifi: rtw89: prohibit enter IPS during HW scan Date: Sat, 15 Apr 2023 11:48:55 +0800 Message-ID: <20230415034900.15679-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230415034900.15679-1-pkshih@realtek.com> References: <20230415034900.15679-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.16.20.53] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXDAG02.realtek.com.tw (172.21.6.101) X-KSE-ServerInfo: RTEXDAG02.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, 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: Chih-Kang Chang Mac80211 core may ask driver to change to idle mode during HW scan, then H2C command for HW scan will send failed since chip is in idle mode. Therefore, We check the SCANNING flag before entering IPS to prevent this behavior. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/mac80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c index b059aa8d88dbf..b5cbfc15ebad8 100644 --- a/drivers/net/wireless/realtek/rtw89/mac80211.c +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c @@ -105,7 +105,8 @@ static int rtw89_ops_config(struct ieee80211_hw *hw, u32 changed) } if ((changed & IEEE80211_CONF_CHANGE_IDLE) && - (hw->conf.flags & IEEE80211_CONF_IDLE)) + (hw->conf.flags & IEEE80211_CONF_IDLE) && + !rtwdev->scanning) rtw89_enter_ips(rtwdev); mutex_unlock(&rtwdev->mutex); -- 2.25.1