Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2177840rdd; Fri, 12 Jan 2024 01:30:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBZkbEL9kWYuHjnckLapSNOAioJxjObk6AP4dbiy2HkOV26scXjMZREYmPZuOdwd9dDBgl X-Received: by 2002:a17:906:2319:b0:a23:4973:eda5 with SMTP id l25-20020a170906231900b00a234973eda5mr442919eja.126.1705051814211; Fri, 12 Jan 2024 01:30:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705051814; cv=none; d=google.com; s=arc-20160816; b=haz7C/bOMW7Xrn4EhhPRxNK79coVwKfxGfZz7ST/q7e0Egxv5ELJ20HlVoFB0HuJw4 He7LJTJ6CeFhThoEdn1W+W4kbtOGxfwlM+EkPdB49Nv53vjZLA6zBpJb/kigHjN9NJ+l Yaz0NflQiUd1IXNrcBmIVcfiVb8oRkRSGuYS4gX8kEiI9cPOOUmPurwWRr9rvcvm3mfQ f6dW2yWpQM5NeOs3EKr9KzY+oQ/xSDLSvBjpfhlHKsGairkc8pezwXcQ44gqSMbDHZ4c +ZA99844mEfXiGY0dzzZ3Kxbb/WmXi8ExxVqElMfvidmRlrgwjh7NkxSJJhEohzEYVED 2asA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yiii4WNJ08UCJ25Bg/Du3YqiS1dWKr9sCMUJz026c3U=; fh=nsXMNwyQ6Js4V/BswY1tH4B32D/qQcO3q9PUs38uuf4=; b=c+vnDFtfxfRa+y4pzOxFQSos9Q6yp03hChK6tRyE/+GANBFRZ212Mpny9KNloUcHtr o61Mv5MWPmypuPyNzuknYDPkKHDKA3xsMcTZy6VKB1QvfADiDRxYi7dhOmf7I3O1XvFg HtXO9kTGMSXdRJfjhkmtjngPPDQmu/P18jE2uCdIoqRwO2YDoFvWZJvWfzeX66MZG40W fC7raHKuxdiVRJ9kyKiC65UbwrVR7El+FxUluAEPIDLcupUpfZedmI/tAT//VyGnM2nQ cT28KzdBY24r3pAltHAz3WM/Ok7hTJGlsDdDmUBKuS9qs/GibHqSDOFZHI4lLftrepkl XRyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KMH1Yjhw; spf=pass (google.com: domain of linux-wireless+bounces-1800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l8-20020a170906a40800b00a26965f7fcbsi1274304ejz.810.2024.01.12.01.30.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 01:30:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KMH1Yjhw; spf=pass (google.com: domain of linux-wireless+bounces-1800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F2BAE1F26794 for ; Fri, 12 Jan 2024 09:30:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F257B5DF29; Fri, 12 Jan 2024 09:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="KMH1Yjhw" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92A825DF1D for ; Fri, 12 Jan 2024 09:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40C2vZAb009733; Fri, 12 Jan 2024 09:28:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=yiii4WNJ08UCJ25Bg/Du3YqiS1dWKr9sCMUJz026c3U=; b=KM H1YjhwgXYXcUho0BB1lQvBPmKGLpk2TJUzpAS00SCQfwvP0iohY5RvMD6ydz/Bdf agcU9ULA2mBnC5WvrUVY6nEaOxCq+teo482zLg/mJIMQfD9/By1OXke6yXCpDyM2 +hXYixPpzDsn/5buVEcoUbLb91gl+DR2LmBwVifjAzem2/zDj9j4EjI0XE5V05Rp 7NZcVB5ExNE2SQ82Y+oXsAKQTaGNXT1Y0TNdqvbEDoO1lGkARaOQ4Fe6UVvEja89 HpMjMbYrDjtmpzpqFMf9GgRIVhfyTc5ualha+1oNIx3Qa85VksSt+8Pc6HRRR8Qk lxbqCeE0+L86yqacZZiw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vjv4js2bm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 09:28:48 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40C9Slte026701 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 09:28:47 GMT Received: from yk-E5440.qca.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 12 Jan 2024 01:28:46 -0800 From: Kang Yang To: CC: , Subject: [PATCH v2 06/10] wifi: ath12k: allow specific mgmt frame tx while vdev is not up Date: Fri, 12 Jan 2024 17:28:20 +0800 Message-ID: <20240112092824.7664-7-quic_kangyang@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092824.7664-1-quic_kangyang@quicinc.com> References: <20240112092824.7664-1-quic_kangyang@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: jGQzOermFvhOyu24ABdtBG0kL0dBasa3 X-Proofpoint-ORIG-GUID: jGQzOermFvhOyu24ABdtBG0kL0dBasa3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 malwarescore=0 adultscore=0 impostorscore=0 phishscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401120072 In current code, the management frames must be sent after vdev is started. But for P2P device, vdev won't start until P2P negotiation is done. So this logic doesn't make sense for P2P device. Also use ar->conf_mutex to synchronize vdev delete and mgmt, TX. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Kang Yang --- v2: add Tested-on tag of QCN9274. --- drivers/net/wireless/ath/ath12k/mac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 92ba88d5e4e9..70726e810093 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4995,8 +4995,8 @@ static void ath12k_mgmt_over_wmi_tx_work(struct work_struct *work) } arvif = ath12k_vif_to_arvif(skb_cb->vif); - if (ar->allocated_vdev_map & (1LL << arvif->vdev_id) && - arvif->is_started) { + mutex_lock(&ar->conf_mutex); + if (ar->allocated_vdev_map & (1LL << arvif->vdev_id)) { ret = ath12k_mac_mgmt_tx_wmi(ar, arvif, skb); if (ret) { ath12k_warn(ar->ab, "failed to tx mgmt frame, vdev_id %d :%d\n", @@ -5010,6 +5010,7 @@ static void ath12k_mgmt_over_wmi_tx_work(struct work_struct *work) arvif->is_started); ath12k_mgmt_over_wmi_tx_drop(ar, skb); } + mutex_unlock(&ar->conf_mutex); } } -- 2.34.1