Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp371849rwb; Fri, 18 Nov 2022 02:43:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yUYDgaXx++vQbsDEHH7Xo6okqW6pbYSasYdkP0u9eaHHaVNwVzektIhPZ6YSVVnLyeer+ X-Received: by 2002:a17:90a:d497:b0:213:1ce7:d962 with SMTP id s23-20020a17090ad49700b002131ce7d962mr7446966pju.63.1668768185476; Fri, 18 Nov 2022 02:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668768185; cv=none; d=google.com; s=arc-20160816; b=kWrqKwjpyILOxqBhpdtozlHyA/yr7T13CbH6spOQbNvGME0Jn0D+BrgSEfdON273la NGMVnrk1ALiKDPVf04i2JgbqdtDtDI61EMTpo2oc2ySWpDECm8lTaNzxj2ALTaR5ercY n79ghMMgESvdOlztLLIE0gjAqUNMfGel+LyHU/5Z8dM3LDu0z7Pta/EkwjgWRGnNDoRl 7wTswjrQXNYT7qFpkjt5YCkU2WGmVpEKydg9XwqX8BsdOjLUYbLYghFWIZd8PrpmcxVS 6JWmXB/ZqV4owtK7yYpzWry6GTGPRsO4pMEdT+WekzGrN+bM7cQM9JHLROsKPN/YUDGr dJjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=GiHEF5dV2KVSqC69lRuMtCY71E0Dcp9oocwYhqMtKdE=; b=kZOqnSMFLMQ29l/ryBpjrs4EwCmH393pMjsuhbSsUq8pK2vZsjzyvCmQJsUXfQgiEY kRV9f8ciT5EvqRKzZGRttLaX98N+i7ezRJUd7dMDiS3hc4V1Xn2vOsKCrubyuxmXQ3Jt xbXYXztumCDh9qiLIJ+LfC+iw+XPJe4bHkTMmxDA3e1KB/gFu+cmcZ72/NxFR3Jp5630 LFwuxfBwrYj/uFR/7Sc+ryCemaowevp/GWZQHFBa1gxOOk2GTIcrbhT0HWO93z95muo0 ih44HklWl41+yKP6lxVUHJCH6Esdgp8brE1hZgUkEdhSoT3OCiO9RX+7sJuHuqGInwIE 3ROA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=R1W9wfd3; 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=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v190-20020a6389c7000000b0046b1da8c356si3399071pgd.619.2022.11.18.02.42.52; Fri, 18 Nov 2022 02:43:05 -0800 (PST) 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=@quicinc.com header.s=qcppdkim1 header.b=R1W9wfd3; 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=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241493AbiKRK3o (ORCPT + 67 others); Fri, 18 Nov 2022 05:29:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241736AbiKRK3l (ORCPT ); Fri, 18 Nov 2022 05:29:41 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA4852716F for ; Fri, 18 Nov 2022 02:29:35 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AI9uI9h031832; Fri, 18 Nov 2022 10:29:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=GiHEF5dV2KVSqC69lRuMtCY71E0Dcp9oocwYhqMtKdE=; b=R1W9wfd32nR5fIfbaY4rE5J+EFs6zcWd754uqBgzlEPGdZ/qekCHRgwOCd/4Fn8rpOw+ AV26FVQGx/ilZvHjsiQvfSOwhQg7V3XGpqssJjwLDL2qbMe6PuCABh/aho9HpK/QPKuy Cdc5Qbl8DNHx+kqQMyNi4fMZGQpphn2xA969kE7SOaP1v3tarzadyXOfL6XHJ+XxIeik u5RK5MLaIYHAVmPbeTT0BOgZsUJZHmLz6TA7fKwyXvgOHBcAkyAuKJ3gAM/XVhdnf63e hLtRFJyDMZp8k1Iz6DxHyo9VnwGYjvdtYZp4dOldAolxyhk+VzWCqEf26yZLzvZBhGaq tw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kx0ra9bdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Nov 2022 10:29:26 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2AIATQQB028950 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Nov 2022 10:29:26 GMT Received: from [10.231.195.37] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 18 Nov 2022 02:29:25 -0800 Message-ID: Date: Fri, 18 Nov 2022 18:29:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v3 2/2] wifi: ath11k: reduce the timeout value back for hw scan from 10 seconds to 1 second Content-Language: en-US To: Kalle Valo CC: , References: <20221011072408.23731-1-quic_wgong@quicinc.com> <20221011072408.23731-3-quic_wgong@quicinc.com> <8735atg335.fsf@kernel.org> From: Wen Gong In-Reply-To: <8735atg335.fsf@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: KQh0TAfKxqRp9oqshfrI3S-_DLHSQojH X-Proofpoint-GUID: KQh0TAfKxqRp9oqshfrI3S-_DLHSQojH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-17_06,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 clxscore=1011 priorityscore=1501 mlxlogscore=999 suspectscore=0 spamscore=0 bulkscore=0 malwarescore=0 impostorscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211180062 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 On 11/8/2022 6:20 PM, Kalle Valo wrote: > Wen Gong writes: > ... > [...] > >> @@ -3682,7 +3677,12 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, >> >> ret = ath11k_start_scan(ar, &arg); >> if (ret) { >> - ath11k_warn(ar->ab, "failed to start hw scan: %d\n", ret); >> + if (ret == -EBUSY) >> + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, >> + "scan engine is busy 11d state %d\n", ar->state_11d); >> + else >> + ath11k_warn(ar->ab, "failed to start hw scan: %d\n", ret); >> + >> spin_lock_bh(&ar->data_lock); >> ar->scan.state = ATH11K_SCAN_IDLE; >> spin_unlock_bh(&ar->data_lock); > This feels like a hack to me, for example will these failed scans now > cause delays is connection establishment? IMHO it's crucial from user's > point of view that we don't delay that in any way. It will not delay connection. After wlan load, the 1st hw scan will arrived to ath11k, and then 11d scan will be sent to firmware after the 1st hw scan. It means the hw scan for connection is run before 11d scan, and then connection could be started immediately after the 1st hw scan finished. It means no delay for connection. > I would rather fix the root cause, do we know what's causing this? In firmware, hw scan and 11d scan are all running in the same queue, they can not be run parallel. When 6 GHz enabled, the 1st hw scan cost about 7s and finished, and then 11d scan cost the next 7s. After the 14s, the each hw scan arrived to ath11k will be run immediately. If the 2nd hw scan arrived before the 11d scan finished, for example, it arrived 7.1 seconds after the 1st hw scan, at this moment, the 11d scan is still running in firmware, then the 2nd hw scan will not receive scan started event untill the 11d scan finished, and meanwhile, the 2nd hw scan is holding the ar->conf_mutex in ath11k_mac_op_hw_scan(), it is not good to hold a lock for some seconds because ar->conf_mutex is widely used. So reduce the 10s to 1s to avoid holding ar->conf_mutex for long time.