Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp169765lqp; Wed, 22 May 2024 00:15:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQd0NRDh3CB09hHWaS7Jd/WANP+s9/4h45NLR8jxH50/d+CQdfbdQKyN15FOrwjfisKOi1AST1+mPuj9jIwVdM76be6WU/HG+efyJoBw== X-Google-Smtp-Source: AGHT+IHWTKF7AuMWYJxPfe7zQGyW1XHkKj7MD3ckmyhvzyAcqesb6OJMsrMbb4ptc9wql7BhCUcT X-Received: by 2002:a17:906:3989:b0:a5a:8248:253e with SMTP id a640c23a62f3a-a62280969bamr62256966b.36.1716362146081; Wed, 22 May 2024 00:15:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716362146; cv=pass; d=google.com; s=arc-20160816; b=cD56H8MlFN3U/M9sdoTvWVjn1KiJu3mhFdOxNB0Lmqv/ij2jqL1Xfl7RpZcv/xPqJR TLj8aEB5Gg0EbUP0VuhZ0welAiHeI6+mqPWKvbBSSoCfjF4sg9oNdr/Mux4R1NTWHdAm fMJ/Y3c/n6snAUJgjDy8JUribPtE41FhWF0SxgpzAweIO6Nw7p2vpZB6nVUTYLoZWZsX D2XhaeT/Ujusvx1fOwoqtFzBisc2/C1UhofINfk3mp8l1oPyC5q/OqIxdfjefaEIWfWj f1mNTbT/ItoQhQQiJ63JSX0MGOgr9qhG5gkZE2ORkFsyjM7E2KaRonNaDIKSQQRvrdgL Rw1A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=vzUzrX/LNPuxUvUqwfWKebP0lXXR0PgGNnddI0sfHbg=; fh=chEIbkEvMIeRVV34q3+5ycr9OAG9bmwHWGyG8pP1K7M=; b=nb96UWqXuppAB95Hw7duFiMOtnCMejJdZAsP5K/VsUiYUx7wx9RsqkcimrkaOOgbzv u5Hhaom9HuS7WvXlUipMy7p7hPVfxLxUt601fInr6ts9w9jSmRg8Ctq8Ei2Ddt21zooo rOt94veGucXBaSbYHBxDMzDntbzos2ma9t5a7Oirj0fwP0Weh75dDSIHVZOQ/dworklw qZ39SQO5ivhUSACW/gv/b+BFpyaWhqUVyx9jY+2k/kCslcVjdup6uYP30wx+jcyThcSp 4hWRpbz81B360aTpeilAmUJlpuLkJYeGPjeSf91lc+MSrC/tHzF1LdSj2NjLCq3tMmz6 oQwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cNd+wkT3; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-7934-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7934-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 a640c23a62f3a-a5a1797cd11si1460854166b.260.2024.05.22.00.15.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 00:15:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7934-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=cNd+wkT3; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-7934-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7934-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 A4C151F22058 for ; Wed, 22 May 2024 07:15:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9A2A56448; Wed, 22 May 2024 07:15:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cNd+wkT3" 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 0E5602233A for ; Wed, 22 May 2024 07:15:39 +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=1716362141; cv=none; b=JaeYbQHsgzzEvBEPjag5y1evcN18FlPjSBbnvNjlYRDiPsHRkGADylmB7xfCagHGp6hL7LR35+RC+3ZEBE9aNRbV0gNqqBhfq7Pg4j402rIpRo9XCARS7vytEVEwkSsrzxK/f/bsVIVaaliZYBC8kKzbSWSzn39DOXLsG92ZniE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716362141; c=relaxed/simple; bh=RLzFy1HWbH8NQB04D1B5Dl4qcykaNniECOeU/TWZh04=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=J1S62Nd9p+SP/dFykQ1mB3uJJwsd9vj3lSTfIx30w2SFcEyELhYiaeC9wzPFjT+b+NHq/mHLPsRxmdTETn5WpmzNyoNipqWLJWcHsyZOr2jzETOk87eutFA2Rp9ftWmuWbryNU8JJKheb/4cb5t7mUwecUvNKrnEqcvAkZmlAgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=cNd+wkT3; arc=none smtp.client-ip=205.220.180.131 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 (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44M05QvM008814; Wed, 22 May 2024 07:15:33 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=vzUzrX/LNPuxUvUqwfWKebP0lXXR0PgGNnddI0sfHbg=; b=cN d+wkT3PL9BvLxWxtqCz8NUlesNShOw5vDy+BO1LWf8LwBAOxf/0lRjrg9sh4lmA4 yw0ZeP4uF25GLSOXdS0IOmdghpDJPgGOaUA+GwzFeYc21ZVtkYCek+T3+WOpQIXv j59J3/FZ7qZKD7srK3mXR91O3LDRf7WYYuYLgXBuUjFztEw8kaYc87N21OhwhIrh idlDFDYnOhIpGBZQ8C6cVwKC873wQT8QsFc3u5T0uGcgFhRb0tPDhqxDS1ur8Tlg qCugNVY1qJT8Kaw+ZiA3M4ZR3GGOcPJJxPDQC1WJNH+HtU25Fo69dWKCg0LS3nuo EONffCS0LDARDW5jgu9Q== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y6n4gg3sk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 07:15:32 +0000 (GMT) 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 44M7FVM8020667 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 07:15:31 GMT Received: from [10.50.28.77] (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.1544.9; Wed, 22 May 2024 00:15:29 -0700 Message-ID: Date: Wed, 22 May 2024 12:45:25 +0530 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] wifi: ath12k: fix firmware crash during reo reinject To: Nicolas Escande , CC: References: <20240520070045.631029-1-quic_ppranees@quicinc.com> <20240520070045.631029-4-quic_ppranees@quicinc.com> Content-Language: en-US From: Praneesh P In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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-GUID: CfNI3NDXlAGEW_vqdKqjD-trzLHQQtaY X-Proofpoint-ORIG-GUID: CfNI3NDXlAGEW_vqdKqjD-trzLHQQtaY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-22_03,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405220052 On 5/21/2024 2:20 PM, Nicolas Escande wrote: > On Mon May 20, 2024 at 9:00 AM CEST, P Praneesh wrote: >> When handling fragmented packets, the ath12k driver reassembles each >> fragment into a normal packet and then reinjects it into the HW ring. >> However, a firmware crash occurs during this reinjection process. >> The issue arises because the driver populates peer metadata in >> reo_ent_ring->queue_addr_lo, while the firmware expects the physical >> address obtained from the corresponding peer’s queue descriptor. Fix it >> by filling peer's queue descriptor's physical address in queue_addr_lo. >> >> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00209-QCAHKSWPL_SILICONZ-1 >> >> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") >> Signed-off-by: P Praneesh >> --- >> drivers/net/wireless/ath/ath12k/dp_rx.c | 14 ++++++-------- >> 1 file changed, 6 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c >> index 2bfcc19d15ea..2adb6c7d4a42 100644 >> --- a/drivers/net/wireless/ath/ath12k/dp_rx.c >> +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c >> @@ -2967,7 +2967,7 @@ static int ath12k_dp_rx_h_defrag_reo_reinject(struct ath12k *ar, >> struct hal_srng *srng; >> dma_addr_t link_paddr, buf_paddr; >> u32 desc_bank, msdu_info, msdu_ext_info, mpdu_info; >> - u32 cookie, hal_rx_desc_sz, dest_ring_info0; >> + u32 cookie, hal_rx_desc_sz, dest_ring_info0, queue_addr_hi; >> int ret; >> struct ath12k_rx_desc_info *desc_info; >> enum hal_rx_buf_return_buf_manager idle_link_rbm = dp->idle_link_rbm; >> @@ -3060,13 +3060,11 @@ static int ath12k_dp_rx_h_defrag_reo_reinject(struct ath12k *ar, >> reo_ent_ring->rx_mpdu_info.peer_meta_data = >> reo_dest_ring->rx_mpdu_info.peer_meta_data; >> >> - /* Firmware expects physical address to be filled in queue_addr_lo in >> - * the MLO scenario and in case of non MLO peer meta data needs to be >> - * filled. >> - * TODO: Need to handle for MLO scenario. >> - */ >> - reo_ent_ring->queue_addr_lo = reo_dest_ring->rx_mpdu_info.peer_meta_data; >> - reo_ent_ring->info0 = le32_encode_bits(dst_ind, >> + reo_ent_ring->queue_addr_lo = cpu_to_le32(lower_32_bits(rx_tid->paddr)); >> + queue_addr_hi = upper_32_bits(rx_tid->paddr); > Shouldn't there be a cpu_to_le32 somewhere here ? It just seems asymetrical > between the two values extracted from rx_tid->paddr le32_encode_bits of queue_addr_hi does that conversion, so there is no need to explicitly convert cpu_to_le32 while fetching rx_tid->paddr's upper 32 bits. >> + reo_ent_ring->info0 = le32_encode_bits(queue_addr_hi, >> + HAL_REO_ENTR_RING_INFO0_QUEUE_ADDR_HI) | >> + le32_encode_bits(dst_ind, >> HAL_REO_ENTR_RING_INFO0_DEST_IND); >> >> reo_ent_ring->info1 = le32_encode_bits(rx_tid->cur_sn, >