From mboxrd@z Thu Jan 1 00:00:00 1970 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 40397279794 for ; Mon, 26 Jan 2026 02:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769393723; cv=none; b=ci2mjsXoJyL9mY1PJ7qLRyGnc9iSHdOHuTT5a19dIygfmhASTCYjn+ymggMZdANhICoJd895PbbUsdeID9tKvr1SCzecT73jI/xRRmgdXc2AJMr63uLIuWNzI95sY8ctIXbyIJg/MSUvFt0Y0yi+fItpdq1OxwAa+H5VhsBkRyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769393723; c=relaxed/simple; bh=w1GAQCf1HxThXzDyTuLGQBFSQXiEYFMA9Iwtcw41YCw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TtQsfN1EwljhFhXrZLYIrM9p8qaM3hAiBV5e7iAOp05GVFfefYQrrsfA10JWN/4XMFjw163OSlD+wxFt7+sH8t7T06GxsDWLwTEDsxFT2sPugDozBbhjBgBUR/36rfr9Kb7FUqi8Rxu+Ug4606qGaFlCndq6dOlec4xNMOK1UX8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lq1g+vHH; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=W8iMgL+/; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lq1g+vHH"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="W8iMgL+/" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60PBM7pZ2971875 for ; Mon, 26 Jan 2026 02:15:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= zwtxPTrPGzWPOqfN7gVyzUfj/+vOMn7+smpYP5omEwk=; b=lq1g+vHHhH3UUkxI DXt6YiKzlnEE5G6NZdVZvGt0pSt44uoshy5CUi8upSvODrNGu3a6CM+SNvcXhmNs 7LLdYf3mOvv+OTI1+G5JLuS+m2/HZW1H/rabifuJ3pPBPAsT/QS0iwu6HSxSC1nl PeloIFcPL12D2gpNO2NR8BDPKLsQFMhOGZk7GsI2uF4dgG56tNdwYfBfmrRI5MJ4 7ti2wIUlRhFRFqk+LeBzYTjasFnAi010wI1qfNsJYHP1jYw7LcoPVNgUFCMz0CJ9 AkIJ/clL8+VO131fY6OawF2mo1qVoniLG1sFBhH7447o8/9LMHIWFBCI/F/ZRq3T +ja++w== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bvq6xu33a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 26 Jan 2026 02:15:20 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2a755a780caso30914315ad.0 for ; Sun, 25 Jan 2026 18:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769393719; x=1769998519; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zwtxPTrPGzWPOqfN7gVyzUfj/+vOMn7+smpYP5omEwk=; b=W8iMgL+/XbAM0BNocQNAyRjw/arubjqg08Add9+xLwCNY2iz5wzrsLplLsFthQjIqY FKrNI7n017Y5QqUCzbs+zLxKgvhn7dO3QUTfEe+9l7AJ9CoqeRmq1GoHGbB/YDqQBwQ8 sjOwkCJDamvb0VNjPO68ze9QMrNANNSR6IaLqOrM/YUjepPffRyWUvqyEho54FL5GS7I LFoJq40m2wRWe/4jxGuUefcMDGSnLHXleQrhRZy6z1SoDtgcUzuUgVOehuBPo0pyHwSr 5D+2eND7gRI0alROvv8DoVlSGPfmD0j0095toR7jDeL3qrcVpsH22AB9XbbgghJiutw4 Mf6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769393719; x=1769998519; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zwtxPTrPGzWPOqfN7gVyzUfj/+vOMn7+smpYP5omEwk=; b=NnmTWUYEMzMJGKpPJdaH6aQmMxlpdYdUY37usp4SOoPTDsMKigjICXCD7+hnZds0mY GfAtR1RzwPPpH8ENqIKU1IR0x0HLCrVMYC8r03/W+UKah9uQaVjcqn3XhbxApCE/gIa4 L02GlNdxS4JpPZjnT/XaXFwzk43nR8fPDP3/XmbnBTQRzhDR1FeNU6QSEr52soChXWWF 1jFNZoUvlypxhb9NEXFKSr/f99N4F2c3e9kZxADF7CkP7/rnjlBAp281Hwl8Rl445O9b 3ELZq7Umys3gMUjpxR7hoaNu9SmGaQWU8GwObdmfQYauYVEN5eJgx+Iiev+I+ejfKAS8 g2gA== X-Forwarded-Encrypted: i=1; AJvYcCWuwshlqLkY7QrIA5Rp1q2mD+2ts4Iltstly4W96wHI8h7LhiqUx0WOPokAbvBsTi/Ks64q3y1rLJfqT6U=@vger.kernel.org X-Gm-Message-State: AOJu0YyYXf7kmSvpf5K4EprSA3Kp/Etwih+yyTyRncUmgGPkm6TgN9dv 8q3RiiV0+FHUYz4DuipVDMKS4btOoUJHlNRQZO8Hrd0OPmn+4rcHElG11229G34aAZvs0cSN06T 6YTV/IEg8/hymMnDPyna+4xC45/Jh7t6X5V5JJNj3y7XH5Rc/XzFNQ1sbO5PwDwoB0sB6ZSR/km c= X-Gm-Gg: AZuq6aLK25ORY+BMbwzA40v6dqQgtJZcHvopIrOqd2pz2uspMv02N3SQ+XAMhJ8PDz1 L0wanvBIAfoBV6GsmuNX84th8P+75Ts8V/hCoACMlBxVPfqi36h7jHTkp/eJQafMhEbm+PksAbx TyaRsaSz8APh8qp8QTe6IbimWMt/JApqd3pIThzHPH1SHJ+GBfWl5jkFmegYCR2YSUQ5sLfY7/Y 0NH6eAZ704Y+bBqOIpW03V2owtpx/Apf8AD4iGhPA0UKhg9Rgo6KJEP5nuj9W5/8YK/YB6CSPoB wOMvM8pau8xr+qwOV8rG/o+uGIOXrQdJA5auxP1R4jv/DjOqPyzOUFn8VsRJddIiY6T14g6VWBc c2shUKjYgOadTM9XTvXW5j7pQz040YyeJtLcrurChRqLTim9iXUhzLiAqY0mIVxO32UvylPCeeg 2D7GmePGs= X-Received: by 2002:a17:902:c94d:b0:294:f6e5:b91a with SMTP id d9443c01a7336-2a845502f26mr29584585ad.13.1769393719324; Sun, 25 Jan 2026 18:15:19 -0800 (PST) X-Received: by 2002:a17:902:c94d:b0:294:f6e5:b91a with SMTP id d9443c01a7336-2a845502f26mr29584355ad.13.1769393718834; Sun, 25 Jan 2026 18:15:18 -0800 (PST) Received: from [10.133.33.199] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a802f97ba6sm76776135ad.50.2026.01.25.18.15.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Jan 2026 18:15:18 -0800 (PST) Message-ID: <86af03f9-3823-4561-95ec-8b15ed88249c@oss.qualcomm.com> Date: Mon, 26 Jan 2026 10:15:13 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg() To: Ziyi Guo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260123175611.767731-1-n7l8m4@u.northwestern.edu> From: Baochen Qiang Content-Language: en-US In-Reply-To: <20260123175611.767731-1-n7l8m4@u.northwestern.edu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: nAUJB8fwzSy8UbNxM3v-RRtoQjlHvL59 X-Proofpoint-ORIG-GUID: nAUJB8fwzSy8UbNxM3v-RRtoQjlHvL59 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI2MDAxNyBTYWx0ZWRfX8mI9B4MXg8dz xuB7hmzdB7M/qnDkgz2/TorsUvEsHnMbtmkiymSszoreDwNsoUiHCDlHUgP6EbVml5fB2M5kCfZ V+Xatioebob+JJvY0h2D4ghJvL1hCudJrkAv/19j39m7eF/ptUXf8FLodgK8GnRBWLAAWTEdmX+ TVCoo7/TqUNhcOzvihx0AIO71mcx+Y651hno8/fF/HIkG497E5nJ1ngV71kmfi9phOLqTCv/Wui YI17ACBd4fSKHat1XypcK/EDeiOeSHcxwUDgN2IZ9zrLKfe5bdGP9BXkpeFHU5xRzF3NzjT35jl +rXB0qcDOoeogG8EUcrtEO8Au2H1qTNwkM1qpilZLa+gZZANgZjyUHbPsoZliwYafmdctSvGNEm 1zwtV79VE/hHGMFf3sZ73TN8B59D3bR7f+Q/2Uhbu1RaynlFf0bPbWStkie4p2bwa7tLZZYMN/O 1kGGVpORKh+19Kg8fyw== X-Authority-Analysis: v=2.4 cv=Htd72kTS c=1 sm=1 tr=0 ts=6976ce38 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=27jATeYspuGomxVIXMEA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-25_06,2026-01-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601260017 On 1/24/2026 1:56 AM, Ziyi Guo wrote: > ath10k_wmi_event_peer_sta_ps_state_chg() uses lockdep_assert_held() to > assert that ar->data_lock should be held by the caller, but neither > ath10k_wmi_10_2_op_rx() nor ath10k_wmi_10_4_op_rx() acquire this lock > before calling this function. > > The field arsta->peer_ps_state is documented as protected by > ar->data_lock in core.h, and other accessors (ath10k_peer_ps_state_disable, > ath10k_dbg_sta_read_peer_ps_state) properly acquire this lock. there is another instance in ath10k_sta_state() where the lock is not acquired, but I guess that is OK since during the NOTEXIST -> NONE transition no race is expected. > > Add spin_lock_bh()/spin_unlock_bh() around the peer_ps_state update, > and remove the lockdep_assert_held() to be aligned with new locking, > following the pattern used by other WMI event handlers in the driver. > > Signed-off-by: Ziyi Guo > --- > v2: > - Remove lockdep_assert_held() as suggested, since > we are now taking the lock internally. > > drivers/net/wireless/ath/ath10k/wmi.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c > index b4aad6604d6d..061a2fa8f00f 100644 > --- a/drivers/net/wireless/ath/ath10k/wmi.c > +++ b/drivers/net/wireless/ath/ath10k/wmi.c > @@ -5289,7 +5289,6 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb) > struct ath10k_sta *arsta; > u8 peer_addr[ETH_ALEN]; > > - lockdep_assert_held(&ar->data_lock); > > ev = (struct wmi_peer_sta_ps_state_chg_event *)skb->data; > ether_addr_copy(peer_addr, ev->peer_macaddr.addr); > @@ -5305,7 +5304,9 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb) > } > > arsta = (struct ath10k_sta *)sta->drv_priv; > + spin_lock_bh(&ar->data_lock); > arsta->peer_ps_state = __le32_to_cpu(ev->peer_ps_state); > + spin_unlock_bh(&ar->data_lock); > > exit: > rcu_read_unlock(); Reviewed-by: Baochen Qiang