Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp637002pxb; Wed, 16 Feb 2022 00:34:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHsgfSpwgqk71kUpL3Y2J7RPT/oVwhK9B1aTFYAwJWVzvR63DURGSskD3HDC0j+taJVj8D X-Received: by 2002:a17:902:9a45:b0:14f:40ad:befa with SMTP id x5-20020a1709029a4500b0014f40adbefamr1448497plv.172.1645000484687; Wed, 16 Feb 2022 00:34:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645000484; cv=none; d=google.com; s=arc-20160816; b=Y0XU/yVcJ9F+PpWhVLL8phRV4azzvCM41vcp1u10uw7gYvCbuV5z6SCJXMz0cwZ93R 4cheakFjYeckdN4Ldxy4uXJyeDIZhWkaw8muISo/j/CWRun19if4151+NWgzl9L7JAiW FJNMIZuYzLnoaht7z3gDOcOtu4J+gQ0J4HDf0toAYrNySHKzeVOATwrT8bfP2I+eC+z0 Y2jLulH/tDKKtuMwfiTAL5UTfy5hgtLOH3TnAiLqnfx3KR7rP68PqNgY4yHyIl+cc7nb aQJ2HqD6t+agKB9TLaqq2ZXCdOvZmi2CLqQLHY6ksoBnzjj/1zRNUql975omP4SnqT6U CvXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=qRzxwrAzA775KEAgATuoX2mgiC3P40OgCfS9DVA/Gu4=; b=Fua8PyFjNUggA4GCQvjQr4ACPXi8lOvFjR30U2SkWU14yWS/ANKd/MWi7PN+TJlhZb YRRKkUvbGHYc3B1HDs6UbYpWUmIf3FSa5qYHN/G4AGqnhZfq+Y+ILc7u9+/va0YZy8mY 5GJXeSzTri6WwcNt1/VrraIOo+yaOAmuIll7gNARjTY9FgdvvEPLJr3aQq137yJLJCs8 mBxv0xPGyVxh6wVrS67+uVm4yqR0DeTPJ+MuK23exdKR2XyQLblvYEihlTDTY5tB3T0d 7xh3aFDiZdneY4V+XZ9M7+gwTooUpzEijNJWx36Yq2tyI2UnQ0g9uvcrmbYGA3OsPKN5 9Zjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vVC3UYhw; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j17si39871133pfj.170.2022.02.16.00.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 00:34:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vVC3UYhw; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2D4E4245AA; Wed, 16 Feb 2022 00:32:50 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbiBPIdA (ORCPT + 73 others); Wed, 16 Feb 2022 03:33:00 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:48408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbiBPIc7 (ORCPT ); Wed, 16 Feb 2022 03:32:59 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E94B31B7A8 for ; Wed, 16 Feb 2022 00:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1645000367; x=1676536367; h=from:to:cc:subject:date:message-id:mime-version; bh=qRzxwrAzA775KEAgATuoX2mgiC3P40OgCfS9DVA/Gu4=; b=vVC3UYhwhyFNQmlh62jV3Cepq0rt/zCYhgpvnex7VuRzm2S+T3Xo/8Yp icbSEc1zM4/M2dUlms6v9tz85LE3LsB+YuoWaouKO3emnJuaAvzQEIMMC oPy9V54dbBfXrxT9N53jMa3UN1+8/WuyRREmU6TF/ZF6UhoQVY5te5hRc A=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 16 Feb 2022 00:32:47 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 00:32:47 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Wed, 16 Feb 2022 00:32:47 -0800 Received: from ramess-linux.qualcomm.com (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.922.19; Wed, 16 Feb 2022 00:32:45 -0800 From: Rameshkumar Sundaram To: CC: , Rameshkumar Sundaram Subject: [PATCHv2] ath11k: Invalidate cached reo ring entry before accessing it Date: Wed, 16 Feb 2022 14:02:34 +0530 Message-ID: <1645000354-32558-1-git-send-email-quic_ramess@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org REO2SW ring descriptor is currently allocated in cacheable memory. While reaping reo ring entries on second trial after updating head pointer, first entry is not invalidated before accessing it. This results in host reaping and using cached descriptor which is already overwritten in memory by DMA device (HW). Since the contents of descriptor(buffer id, peer info and other information bits) are outdated host throws errors like below while parsing corresponding MSDU's and drops them. [347712.048904] ath11k_pci 0004:01:00.0: msdu_done bit in attention is not set [349173.355503] ath11k_pci 0004:01:00.0: frame rx with invalid buf_id 962 Move the try_again: label above ath11k_hal_srng_access_begin() so that first entry will be invalidated and prefetched. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Fixes: 6452f0a3d565 ("ath11k: allocate dst ring descriptors from cacheable memory") Signed-off-by: Rameshkumar Sundaram --- v2: - Updated commit log to describe the symptoms and the bug being fixed. --- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 89b77b94..99c7e8a 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -2652,9 +2652,9 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, spin_lock_bh(&srng->lock); +try_again: ath11k_hal_srng_access_begin(ab, srng); -try_again: while (likely(desc = (struct hal_reo_dest_ring *)ath11k_hal_srng_dst_get_next_entry(ab, srng))) { -- 2.7.4