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 76BCE318EE0 for ; Wed, 28 Jan 2026 16:36:16 +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=1769618177; cv=none; b=CQ4WDF8wBU1Zdm6J60Q2Gty49soen5vk+LCApBP4W5livplOOuz3fWaivaJWnXRKsEQINdeO/j3TdWc3ds5asnn1JnaJ3YMqgvx/uo2VUiVvIYRsCCVO/oQKPoWpNvGISDkKQD8DxClhlwD9X2DSfuFZc56SPnGcM3VWUCMXzf0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769618177; c=relaxed/simple; bh=8nIVMvGqv71MPrM8B1vjY5p7Dm8QTBBr6/QPYFxGtcc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=c05AJKqvvbW027/zHyBB5g6PcLnkWKPOD39h2p98ect+mJYeyIrOBGu17xFTsG+n5bVv1qUEd/gyu9+rcG0niXAq/zetbrQxd1JuJBEtsjY/TfcTCGX2AmetPwljXibfBYDiKceKa9RbogEqzIZiM/GlpPAgB8xZpJ3REh9lnxs= 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=nR4MLXs8; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=c8TyZsut; 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="nR4MLXs8"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="c8TyZsut" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60SFeG1O590341 for ; Wed, 28 Jan 2026 16:36:15 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= 726DQBzhA/EmumloQR+FME9Z+eEVaDFRgktcZxX0gsE=; b=nR4MLXs8PnRpPmqU nbYVgBIRd5rdwk47xM2Ln2D8SeCoWZIwIcQdDJ5vWtu06cB/OMNSeqO3u8GCjNsq g2WreKlURxjauc97Sqy5/DeSXo7Ie7+b32uQyhNuVCXmp4BwCkw1JbSvRe246nnP K20gpQoHHn4/OjZ6rWY472q6ajBuyMP9lDpNhhOphsE0o2+XRUUlbHn8TmHud6Y8 Kt/81YatcCvS7Ars82nvbYGoLCH5QM0yNBpi7l6+NQqHXYGmUef/FG0NX/wg2fjy AYpHlGAJlkgXtUpcX3H1nyv5VHP01ZRoceaj8TEBHTdTvoBQaNSLNit9VaWPeDuc F6jZeQ== Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4byna7g831-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 28 Jan 2026 16:36:15 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-1248da4d2d6so6161550c88.0 for ; Wed, 28 Jan 2026 08:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769618174; x=1770222974; 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=726DQBzhA/EmumloQR+FME9Z+eEVaDFRgktcZxX0gsE=; b=c8TyZsutIECowB+gpIAt+2wWtilVsTAYhMW3BWT2sfG4ncxKxuL743sxrBk6TcFII8 LnCrhHlDDgJyieuRxrSvDxZApbcfbFp60+6mKsvB0onQyydqzQ6FcsC2oqMZcdbi5LLW 5rxFFoGaabqW0Bno30iftGC5sGMEQ6yZ+uJYsY9P7+f/my5HVUCfBoEZb3jzAP/KI+hn oVjCESTxfXj3STuZsnxg8MtsP5X0pTqELnXYO8+JkA56SHAkTG6Z6fJYbhuGMBfif4Dx y+Cw7PeHsyvgGZMITdfeXzoRIgmzHpiqszCgpGXKzvxGmBpbafY+2N1qsPa6DLZ1DFIe qWCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769618174; x=1770222974; 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=726DQBzhA/EmumloQR+FME9Z+eEVaDFRgktcZxX0gsE=; b=wrNGVEdOspUrXZNaVmibYXlA+QzfKTNLma5D35z476TTIUD+my91M63KVdc/KMZJ6s Wc5uY24kWwHwWa2RlJEeLqvWnAtP4tPBexikQcEiX6fmrecWtR11ChM/C0oUi7miulkF JxSxGWA/rg60PGPCbjGHXfws9mvP0gc+jBciNFC6lt2NHeAwW/AmJH6cV6GbUHeL37qm lRMLtcBz1ErEodgVV0otaArVXtK4quf7zbDpwXh3aPGV+VBK4mzxyC4GHuxVejexqWFN xCVjlvGzVBkq6uHDZYW6Mh1TPmQGEc7wG7yc5dMRjXhN0PTmmMIyWoKCE11opNO6vGqQ dU5g== X-Forwarded-Encrypted: i=1; AJvYcCVnlvCl8C5zkdf6vQzyowb5fPS1CckGotNi7d4mSXrvtAe7HIQdSVBnSwmN1ujBmD2/GJCWe5xD1FrXIEY=@vger.kernel.org X-Gm-Message-State: AOJu0YzG1CDIhfv718HRyPibSSsB1RC/ed2MK3AFZ0v4+DInc2qPsgF4 xZW52MgVFXwWkmNe7gLw+8GSRr/JPllxPbKHficU0v7KRVEBC8UiAiQba0mQFIGowlV06+Vk6Vk HL5GB8GUFSJ37YV/Ui7jmD5B/kNfztUKPzSbiIDXMvW2k3+5Q3TRVCLQxvI38Pnxx7MA= X-Gm-Gg: AZuq6aJiJ8A0YokzhSFMRF9f3uPg1C3hTb3FaUxSO5P94RnUvfq3+e9KnG6f4e4dSI0 gj2J8jUW8p4zPdGWIjmjbKcM7wzTb6u+StbLltpl2TLwsFLrIerj1QhiN8E4ztiOICqfIUt6RgW Gfxse0qV+0GGIRmbyC3cIyOeT8CGcT5E3Df/O7rbGCJz/04luq/TuMnqyR9PLATHX6WpwT46py/ G3ajQnIMNEr+pLa2Mc9zg+dYTxvIg9kJa7WN9RNn2iS/tXxiakb6UCb0BMEEoG0Ht+uMo4AZ9xq DBe8mjDGkiTvhJoAKMVQOZse+SVRvCpo1rnIIYXGuMeRjpy72GtFr0OVR3oaHCc1Xto2nImiRaa oEA9BH2nVsfXto5QYXAUXG9/gW+Wgqlyie97vvYgoH5RgbxhhlC4VpCB8Kwdr9I8pl6Pj3w== X-Received: by 2002:a05:7022:128c:b0:123:361e:e87c with SMTP id a92af1059eb24-124a0098f90mr3452502c88.11.1769618174042; Wed, 28 Jan 2026 08:36:14 -0800 (PST) X-Received: by 2002:a05:7022:128c:b0:123:361e:e87c with SMTP id a92af1059eb24-124a0098f90mr3452478c88.11.1769618173391; Wed, 28 Jan 2026 08:36:13 -0800 (PST) Received: from [10.227.110.203] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7a16eab72sm3166931eec.8.2026.01.28.08.36.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jan 2026 08:36:12 -0800 (PST) Message-ID: <2bb1ebcf-1874-4b65-b4c6-30489747c594@oss.qualcomm.com> Date: Wed, 28 Jan 2026 08:36:11 -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: Jeff Johnson 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: EEXa_epY9dlgDT1Kfalf0JPylg7oa3av X-Authority-Analysis: v=2.4 cv=J72nLQnS c=1 sm=1 tr=0 ts=697a3aff cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=27jATeYspuGomxVIXMEA:9 a=QEXdDO2ut3YA:10 a=Kq8ClHjjuc5pcCNDwlU0:22 X-Proofpoint-ORIG-GUID: EEXa_epY9dlgDT1Kfalf0JPylg7oa3av X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI4MDEzNiBTYWx0ZWRfX4yuLpq5fAlHv ie/Wi7PbwLv9yy7cg9rJaGbmqBXjKdygkI6YNHyLzBGpLAZxYPI9Ql/aluqIHXFem1GYR3RueP6 ZwaaGvejUw7/f71YX6YLNpo18ipcgRe2jNFbCI6RqoatxdZiS9g2H3JgNS0NWtRZUrlRik5mtwC yH4yKQfQzKsLlZ79UdrXAa4DWgb5KO4ezamj0z9My3L9zTzOrhNnCulH70jvPDCtgNyO9M6UG8w hBmSC0g7VVyxmmmse1h1yc8QAp8dyg2VdpD6i7Er4lF4Pqpk1wXIeVgGTkcR0yLvQRtRI1BUGUW S/hmbDOrATIPHDsE9uK91i5aQObK16o6NNZHslzWhgKSAYdbaZzazEFRDNNYUTsxBHmLmv2OTCd 6a8/grLwAmOPO/tfAdd53ZD5123/MiJBpSWWYNyU+VXv4j5FwgZ8GeKSeatfYFE3JPA/NKCuVnf jCI7/7h1fbMx4Ac/TUg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-28_03,2026-01-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601280136 On 1/23/2026 9: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. > > 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); note that removing just this line results in an ath10k-check warning: drivers/net/wireless/ath/ath10k/wmi.c:5292: Please don't use multiple blank lines I'll also remove one of the blank lines when I apply this patch > > 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();