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 9B2281F91F6 for ; Fri, 3 Jul 2026 07:10:29 +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=1783062631; cv=none; b=STFUXvCWEOO0uAnz3rd/m5gXkZor46cSjjBTuO2gJ0AE/75gcUhxaoNQ71QV/3mtD7RN9qi/R3cZdW/EzGy7gjP/XOh4vBVnHESZehS92O/8MD+aHCfQkeboaUwAVK1mpz05kt9tCEBImpntaChZGwVke9lnmHzrC6fXp14JE/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783062631; c=relaxed/simple; bh=enGfy3ekhl+RPZmTV6Ozm2VO+TiPvTzd4OHW3UfAjrA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ndwXSqnEZpQEGr13MmKYeG8BJK2mDps922KV5dNi8eWX/vd5YwnxT8690QzsqkzII1hSMdkKbjNs1O42ave5kwBV7BgCwxiDkx3Y+FL3nDeFI5PuAPxQM3+12R2aiDX6tBOGOV24i/gPg7tJaXtYCCVROsmECGZKWHsvEhKBzps= 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=oI1GY7pI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OXLXSBwR; 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="oI1GY7pI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OXLXSBwR" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6635rqs83135225 for ; Fri, 3 Jul 2026 07:10:28 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= aq6TBwc51LH5Mew9JVDw6URTUq6CcWxDYoLHE7QMsv0=; b=oI1GY7pIl1HvWLR9 sGyhg/5WXqmZMAQk4Ux3hUFN2ngP2MVS7mHV3JjFmM7vuyLue4zsc1pPDtfwRNAy kdihSJV4jyJObCP10IdlGr4n4nJlLAwHu4lbHNMHxZmXxFPEfiPOvZIkFKtuL6nH 4obE31mEIDjcRak06TVEGoTSklRZ59tRSJQgPYp1Sg2wma1v/zTiNkLJRt1w9kgE 5uF4ZdvQpuOzoYyRjtxZhwdLFuxJyaV9cvvf21HwD4RnPvWZD6V+5QNWIpbobtBY WrZpqWcPXxlVJ2bcsiwkXh36PgZT7hC3G2Fp2lzjHviGiMNwY+XL/L/td+0EdAUS pyoH2g== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f65qcguxx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 03 Jul 2026 07:10:28 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2cacaf479f9so5531655ad.3 for ; Fri, 03 Jul 2026 00:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783062627; x=1783667427; 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=aq6TBwc51LH5Mew9JVDw6URTUq6CcWxDYoLHE7QMsv0=; b=OXLXSBwRsx8lwM1Y/cHw1V9LWvxlorgpfCXeuNT3w7KXgLiS0jp6ly/5aKonSo4P7E iT/o9wDtbZrYPfa2P5MUeSonS0PFcUseaNXS1xw9B9x3sER5+My7+4NrvAZ80SwTxlIU 2Fv9xGkP5LNgxSbCaCfcK4Wav2AfC/PSDGU1shU7t06piuvD7UH1QWiK4QhzJHoE5LbC IjHnPTJyXCDi+eVawSnW8c+I1KTGvXR0elnxFdiulKWaEWsrn4M5C/OpZMSHZCoFl77O 0GAJEBdYYjRhbg8gIr6LWFURZgei5bQ5DJg4c/hydN/nQU86QbyU+9+bv1n67f1zPoFE ukGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783062627; x=1783667427; 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=aq6TBwc51LH5Mew9JVDw6URTUq6CcWxDYoLHE7QMsv0=; b=PYLwb2+CIUplwryvuQ/tqa5Agk1GgN7I5+rHnkd3UdYwFyeoeFPdV/Bb/w7SPHeBem xRsQ2RlZ6CjIbiUd0R2C84XgzLspm8Erj4vzG67yjPN4C7J5c2YUvFwAOCSlTtInp4e/ +YRxwrj+Osy7xrQgJ1M3UOmK0eCyLn7ccIlFLPOTL0w5EttfyXnkYjvy2pQQELssPiH9 dPgB9sHM1tyXlayhLXlQDFvkNLya9m8MhhEdUEiJz2eo1gi+5qhoGij1CH/us6CcrqXx fKm6/zKzi7T6tfncYRy8VUtZ+K51b5M4wlbqkT6Kib2qOmgeqGnVxAhRHHSLVEzbdJSw UqTw== X-Forwarded-Encrypted: i=1; AHgh+Rqc4Bl8DR5cFHd/Dp6XIhbndusEjewVAt5P+AiIEI7te8BCbPyOVgdR17swUWpbnPplqYgOTJp8yQJri34=@vger.kernel.org X-Gm-Message-State: AOJu0Ywdhp1FlZLqiNWTnjFvwErTCp8csYaplgUITL6AsTJwGIra/pGu wtpJHGyQs0AaRjQWmk68zeRmYUlyPInJv66cqwec58SYtQITJUF4Tf95RPFx8oHZ36CR3ior60w HXe0A+bCeAf3O1gPV+D6WhudYy5i+l1izM/iarA2+Ms+4QyPfaP68lKSd/e2pB7PANjQ= X-Gm-Gg: AfdE7clNByQ1kjl9oOxHm81UeGbY5fViHBT2s1G3ZCNnxcw/Rv7DCbxd+oAL95pNx3M sbnqib7IDdN7ll85KDIqNOQkdC7ogMVPHsK3zSueIXW6S0IekEi/74yxtpj9yiLOtEqR2SYSFIQ tCIc7drzOsW1YdorD8rF8qyPyD5toELav0M/h6FHqxxyiqoRClZk5nCB1P3hhqS2oOrPEL8eQPP 2MGo7iO+YgIkz8RzZdEeR/i8jbLyDpDP3NOsl4AJO32a8x8gIYAPRFs9OYldb70XBv8Izra0OkR HqsrPra2gyJOGTqLqj3AIfnf7s5mYzVC3oSYlTAZFZlV9kf0o5wd3xCJGCW6lvPUpxaZS46m3Y1 ouN7kCbwCduaebzKfnhBluh4EpPHcUXoVjoo7OS2xNU+m54b926ECIiP3UU6SGQ5VrmzN7OeidV dSlhnJ6WA8 X-Received: by 2002:a17:903:234c:b0:2c0:b6c7:2271 with SMTP id d9443c01a7336-2ca911121e5mr88935155ad.4.1783062627440; Fri, 03 Jul 2026 00:10:27 -0700 (PDT) X-Received: by 2002:a17:903:234c:b0:2c0:b6c7:2271 with SMTP id d9443c01a7336-2ca911121e5mr88934765ad.4.1783062626960; Fri, 03 Jul 2026 00:10:26 -0700 (PDT) Received: from [10.133.33.211] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cad78a9f83sm4888795ad.83.2026.07.03.00.10.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jul 2026 00:10:26 -0700 (PDT) Message-ID: <606bc37c-45ff-41d3-8f0f-942c3009c4b4@oss.qualcomm.com> Date: Fri, 3 Jul 2026 15:10:23 +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 RESEND] wifi: ath12k: fix MAC address copy on big endian To: Alexander Wilhelm Cc: Jeff Johnson , linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260629-fix-mac-addr-copy-on-big-endian-v1-1-3de40f74c13e@westermo.com> <980e1f5c-a845-4180-970d-02f6496f2956@oss.qualcomm.com> From: Baochen Qiang Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: 1Qn9Saq-QWqpYUM4EtqlPiltWf9dSiLC X-Authority-Analysis: v=2.4 cv=Bb7oFLt2 c=1 sm=1 tr=0 ts=6a476064 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=Iwk81yimAAAA:8 a=L-SkCVRlKA2wWS2LGbwA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=PqBb7rsBcpu_OT3Qf5tX:22 X-Proofpoint-ORIG-GUID: 1Qn9Saq-QWqpYUM4EtqlPiltWf9dSiLC X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAzMDA2NiBTYWx0ZWRfX3wCsnZJo0N8s 6DH5X+n5aPJlHNzoLi+BYbEQ6YW4h8LooEsJ2cQgroHPdcEUc85rHIydBHBwt7XVTOqnr46pdLG nSnjXgDKB7EM89r5TNM4Ds3S/q/W5P0PTbQz7CyGAyzuZRRNW5/QR1A4jDuVrnKWKNSFF1B3ppt 9+Ojcfbbqjir0a9dQvSpW8k/OVkkjO29JEGdgukuHfdd18UwG45tT9baXktsOMyLafB2otEG4mn bINgj8ZQ6Fq0HPRopT2TEbDEHgy7ZQpiTjuV+7foCE/eD96iuXwXREH8gUPDcLhmjdLXcD1uCY3 gAixQliyHC+AACUrJqRfWhH7l8XLHnZZCYmShiW3f4pnTWhgkLmQ72wwsf51UBpvUnA5uDd/OFE XpPbI66CC9c3UBnVQ0k1ShEK7bkr6S2McRqxNrN1EC6Y+WQnnzsO2v9Jxbg/cDWORxCH/2g0v6x HAhe/smtN+sPfTiLqww== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAzMDA2NiBTYWx0ZWRfXztx9oHcpPD6j /DZoEhINEKJRL5mGXtvy+zTcXlzGyc45UWCuw19tv2cGS7sfQ2aJ0A2azbru3f1VlBSxyUWPCMi Y+ui1fuaPUflq/YsUotNUNcnKF0lyYk= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-07-03_02,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 impostorscore=0 suspectscore=0 phishscore=0 adultscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607030066 On 7/3/2026 2:36 PM, Alexander Wilhelm wrote: > On Fri, Jul 03, 2026 at 12:04:10PM +0800, Baochen Qiang wrote: >> >> >> On 7/2/2026 8:06 PM, Alexander Wilhelm wrote: >>> On Thu, Jul 02, 2026 at 05:56:01PM +0800, Baochen Qiang wrote: >>>> >>>> >>>> On 7/2/2026 5:17 PM, Alexander Wilhelm wrote: >>>>> On Thu, Jul 02, 2026 at 10:41:25AM +0200, Alexander Wilhelm wrote: >>>>>> On Thu, Jul 02, 2026 at 04:12:00PM +0800, Baochen Qiang wrote: >>>>>>> >>>>>>> >>>>>>> On 6/29/2026 3:55 PM, Alexander Wilhelm wrote: >>>>>>>> The ath12k_dp_get_mac_addr function performs a simple memcpy from a >>>>>>>> CPU-native data types into an u8 array. On a big-endian architecture, this >>>>>>>> later results in a null‑pointer dereference. Convert the data to >>>>>>> >>>>>>> Alex, did you find a time to investigate the root cause of the null pointer? >>>>> >>>>> Hi Baochen, >>>>> >>>>> I am now running kernel v6.18.26, and it looks like the null-pointer issue is >>>>> gone. I only see the following log messages: >>>>> >>>>> ath12k_pci 0001:01:00.0: failed to vdev 0 create peer for AP: -110 >>>> >>>> what is the actual mac addr reported from firmware in the PEER MAP event? My understanding >>>> is that, without this patch (if we really need it) we get a wrong mac addr, then in >>>> ath12k_dp_link_peer_map_event() we are more likely to fail the peer look up hence would >>>> create a new peer and wakeup the waiting thread. But the log here clearly indicates that >>>> the wait timeout, which does not make sense to me. >> >> I think I can understand the behavior here: even if wakeup happens, the waiter in >> ath12k_wait_for_dp_link_peer_common() checks the map result by calling >> ath12k_dp_link_peer_find_by_vdev_and_addr(). Since the mac addr of the newly created peer >> does not match, check failed. Finally we get timeout. >> >>> >>> I have now added the following debug output for `peer_map_ev` inside of >>> `ath12k_dp_htt_htc_t2h_msg_handler`: >>> >>> /* DEBUG */ >>> switch (type) { >>> case HTT_T2H_MSG_TYPE_PEER_MAP: >>> case HTT_T2H_MSG_TYPE_PEER_MAP2: >>> case HTT_T2H_MSG_TYPE_PEER_MAP3: >>> ath12k_err(ab, "[DEBUG]: resp->peer_map_ev.info: %08X\n", le32_to_cpu(resp->peer_map_ev.info)); >>> ath12k_err(ab, "[DEBUG]: resp->peer_map_ev.mac_addr_l32: %08X\n", le32_to_cpu(resp->peer_map_ev.mac_addr_l32)); >>> ath12k_err(ab, "[DEBUG]: resp->peer_map_ev.info1: %08X\n", le32_to_cpu(resp->peer_map_ev.info1)); >>> ath12k_err(ab, "[DEBUG]: resp->peer_map_ev.info2: %08X\n", le32_to_cpu(resp->peer_map_ev.info2)); >>> break; >>> default: >>> break; >>> } >>> >>> Here is the result: >>> >>> ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.info: 0002002B >>> ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.mac_addr_l32: C921F004 >>> ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.info1: FFFF0EE0 >>> ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.info2: 000502F5 >>> ath12k_pci 0001:01:00.0: failed to vdev 0 create peer for AP: -110 >>> ath12k_pci 0001:01:00.0: failed to create vdev 04:f0:21:c9:e0:0e ret -110 >>> ath12k_pci 0001:01:00.0: failed to assign chanctx for vif 04:f0:21:c9:e0:0e link id 0 link vif is already started >>> ath12k_pci 0001:01:00.0: invalid vdev id in vdev delete resp ev 0 >>> >>> Let me know if you see anything suspicious or if you need additional debug >>> information. >> >> I am not really sure about the final mac addr and vdev id passed to >> ath12k_dp_link_peer_map_event(), so can you also add print below? >> >> diff --git a/drivers/net/wireless/ath/ath12k/dp_peer.c >> b/drivers/net/wireless/ath/ath12k/dp_peer.c >> index 47d009a0d61f..3e8201d536a5 100644 >> --- a/drivers/net/wireless/ath/ath12k/dp_peer.c >> +++ b/drivers/net/wireless/ath/ath12k/dp_peer.c >> @@ -162,6 +162,9 @@ void ath12k_dp_link_peer_map_event(struct ath12k_base *ab, u8 vdev_id, >> u16 peer_ >> struct ath12k_dp *dp = ath12k_ab_to_dp(ab); >> struct ath12k *ar; >> >> + pr_info("peer map event: vdev_id %u peer_id %u mac_addr %pM ast_hash %u hw_peer_id >> %u\n", >> + vdev_id, peer_id, mac_addr, ast_hash, hw_peer_id); >> + >> spin_lock_bh(&dp->dp_lock); >> peer = ath12k_dp_link_peer_find_by_vdev_and_addr(dp, vdev_id, mac_addr); >> if (!peer) { > > Sure, here is the output: > > ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.info: 0002002B > ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.mac_addr_l32: C921F004 > ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.info1: FFFF0EE0 > ath12k_pci 0001:01:00.0: [DEBUG]: resp->peer_map_ev.info2: 000502F5 > peer map event: vdev_id 0 peer_id 2 mac_addr d902298bM ast_hash 5 hw_peer_id 757 what is d902298bM? are you using Linux? seems %pM is not properly formatted in your environment. > ath12k_pci 0001:01:00.0: failed to vdev 0 create peer for AP: -110 > ath12k_pci 0001:01:00.0: failed to create vdev 04:f0:21:c9:e0:0e ret -110 > ath12k_pci 0001:01:00.0: failed to assign chanctx for vif 04:f0:21:c9:e0:0e link id 0 link vif is already started > ath12k_pci 0001:01:00.0: invalid vdev id in vdev delete resp ev 0 > > > Best regards > Alexander Wilhelm