From patchwork Sat May 28 14:25:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12864046 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2EC4C4332F for ; Sat, 28 May 2022 14:26:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236490AbiE1OZ6 (ORCPT ); Sat, 28 May 2022 10:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235857AbiE1OZz (ORCPT ); Sat, 28 May 2022 10:25:55 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E22861834B for ; Sat, 28 May 2022 07:25:53 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id ck4so13389355ejb.8 for ; Sat, 28 May 2022 07:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rhuLu/zc6OSTKdNFD0CtRWDuw0q1u1ps2N0Jk8WZLn8=; b=i5OtqQLUDHdTR+E/1nfw5rm0SWku8A2ArnSqQ5MjjVfEgdflXStu8Y5IxDokOjW33D QlrRLXuCgVl+2+6o3hbA6kEbWEuv2Qo+fAecaRwxgojMMJMLtgnm9o8pz4oNb6g3HKVt Uqt5UUwwT0IHLX0n6tNZZs+XyxWgwogTZfw1LwWFuVREg19Q/+OwuVRynsEl0BG2AKHS hmm1G8GupHgh3Pzu82gmDKH8xaetu1Vh/RGFPyu0F04baR9Zvq75I3MRDKj61TMPHVqE weffu4Glu1ZZ7hStiFx7/Ci6v9irO4LMJbUUyKIL/JdfB98VZ2tkz6uO6pzOjfBxtKZV i2oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rhuLu/zc6OSTKdNFD0CtRWDuw0q1u1ps2N0Jk8WZLn8=; b=BFdYg4sPESx0RjmMHXc254j+toY9wGA4T2W/lmmYqlGXQojrkF6n91Aoll3F2540br blgD6YR6v5ArHFlL1IB1dIG9c78H78+WbUa7o/fAsNaAXQz6sVixcPRmAlGSdv9ccz2K WvheFZ5nj8YTC9xHUiIeUnsIvAVmBth+5VxVTPKz3k7dJoSBkLHkahCZrLmnYXZuHzp8 TZp89a2/NXG8OPDC0vQAAoOXfXXuMcR2Xnku1tRBFqRJ5VoIM57O6O6nCFOASr2NDutK Wd+WncSeXJGmObrdK9rqHM6y3/1BD/02eaZPXih3WSUyaVQnhtQNodHQv7OjbtpYwKNB qTZA== X-Gm-Message-State: AOAM533AHp8xHXl+xnTYLkzO2CtI3TLu0qdVDA5ziwx5xkQ4u4yiKNBt 8hiA/Y3n/eu2vsFQKAXZgBYjbmvEWaM= X-Google-Smtp-Source: ABdhPJyRFIGi2kNZzGDKQk8oaZCc1Y0dRXWTC/qPVxQZeILkTHiFhlp0g4V8NR7jRAlh3uX77gXLSw== X-Received: by 2002:a17:907:162a:b0:6fe:c691:47f5 with SMTP id hb42-20020a170907162a00b006fec69147f5mr30975173ejc.289.1653747952236; Sat, 28 May 2022 07:25:52 -0700 (PDT) Received: from localhost.localdomain (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.googlemail.com with ESMTPSA id m3-20020a50d7c3000000b0042bc5e8f7fdsm3601915edj.16.2022.05.28.07.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 07:25:51 -0700 (PDT) From: Christian 'Ansuel' Marangi To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Christian 'Ansuel' Marangi Subject: [PATCH 1/2] ath11k: fix missing srng_access_end in CE Date: Sat, 28 May 2022 16:25:15 +0200 Message-Id: <20220528142516.20819-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When a CE completed send next operation is done, the srng access end is never called. Correctly end the srng access to make sure we have the correct values in the srng struct. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Christian 'Ansuel' Marangi --- drivers/net/wireless/ath/ath11k/ce.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c index c14c51f38709..665205d2322e 100644 --- a/drivers/net/wireless/ath/ath11k/ce.c +++ b/drivers/net/wireless/ath/ath11k/ce.c @@ -490,6 +490,8 @@ static struct sk_buff *ath11k_ce_completed_send_next(struct ath11k_ce_pipe *pipe pipe->src_ring->sw_index = sw_index; err_unlock: + ath11k_hal_srng_access_end(ab, srng); + spin_unlock_bh(&srng->lock); spin_unlock_bh(&ab->ce.ce_lock); From patchwork Sat May 28 14:25:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12864045 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54C72C433EF for ; Sat, 28 May 2022 14:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236437AbiE1OZ6 (ORCPT ); Sat, 28 May 2022 10:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236354AbiE1OZz (ORCPT ); Sat, 28 May 2022 10:25:55 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B8418365 for ; Sat, 28 May 2022 07:25:54 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id h11so8498187eda.8 for ; Sat, 28 May 2022 07:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KbxWDlL+f31Iv4yXrvS4EjbF/ghfF72fs8lCTuVNEck=; b=bxjjLNS6XZw7QGXX5R+4Jf0lwNKpUqVRrxJataQlYji7m3EUis/wMQhmoW9bglan4M /UZSk+W3vUM/S67Fhk7RW5yi+n2BqJbUXg8teg7fS3l5g9iz++mQrbkhMrE6B3WobQjh MxDcYq2y+JktasQOXhELvnDKsTSInvOj8y9liVQ/A8mEcwo+uoGLs2QeR2pFpS2ZOjgd tZ3bd8zIvOFwX6luOaC6dF5JP/xKFh0afLaSN/F7EArwrmfg2XQSEjgcYfe74Ozi7s6b NOZpkaALfL8C3ZXOQpRuIhNnTYKfZ7s2c3bI41TczZtNpK/5bccbv7+3gs03ymeD1o8o lExg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KbxWDlL+f31Iv4yXrvS4EjbF/ghfF72fs8lCTuVNEck=; b=6TBNwjhk4iKbgJFe59C3xG9n5osxxsZE+AjO7gfxdmrcl6f7Uj7523/Q3Gyhh0C6tA 40R1JdNaUPU7/ohrSsmtRz1MdfrTHafTAHrza0PpT12RBs547Y00JdM9yes56jvjxhuU 9GvBcYrDETzgpwfJV142RsfUT7AjKYjWMMLZl8DbADvBg4rHknmlFzU7W2Pw7Bfn0etM yb7cbt4XIPDVfxR6ZaQfHa3a3Qf3ZWjCm2V8M6or1y1vEYkFo4mqIidgAbGfQ/qR3mer HkbALXkzW/2LTLdBFQYeqAZfjCDcu8ibuEV4bTSy1CroCCg5foPQA0eToMDyr4fF0xbu A4Gg== X-Gm-Message-State: AOAM533NOICKGMt8nWamCacmD1G1qNKwwXX3HNvxhHU8XS93RuVnxfKz 5bC7SoAfulq6LKtRh9sfc52aFQC3LPs= X-Google-Smtp-Source: ABdhPJyfxT8XAzGJC0dKREtecTLuyCjugmGL4SpYp30E2dfWq45XCrO/Sz1dg8SdzdayCNAjoJVh6A== X-Received: by 2002:a50:d0da:0:b0:42b:cfa8:f1ce with SMTP id g26-20020a50d0da000000b0042bcfa8f1cemr16534313edf.365.1653747953124; Sat, 28 May 2022 07:25:53 -0700 (PDT) Received: from localhost.localdomain (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.googlemail.com with ESMTPSA id m3-20020a50d7c3000000b0042bc5e8f7fdsm3601915edj.16.2022.05.28.07.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 07:25:52 -0700 (PDT) From: Christian 'Ansuel' Marangi To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Christian 'Ansuel' Marangi Subject: [PATCH 2/2] ath11k: fix missing skb drop on htc_tx_completion error Date: Sat, 28 May 2022 16:25:16 +0200 Message-Id: <20220528142516.20819-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220528142516.20819-1-ansuelsmth@gmail.com> References: <20220528142516.20819-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On htc_tx_completion error the skb is not dropped. This is wrong since the completion_handler logic expect the skb to be consumed anyway even when an error is triggerer. Not freeing the skb on error is a memory leak since the skb won't be freed anywere else. Correctly free the packet on eid >= ATH11K_HTC_EP_COUNT before returning. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1 Fixes: f951380a6022 ("ath11k: Disabling credit flow for WMI path") Signed-off-by: Christian 'Ansuel' Marangi Reviewed-by: Jeff Johnson --- drivers/net/wireless/ath/ath11k/htc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/htc.c b/drivers/net/wireless/ath/ath11k/htc.c index 069c29a4fac7..ca3aedc0252d 100644 --- a/drivers/net/wireless/ath/ath11k/htc.c +++ b/drivers/net/wireless/ath/ath11k/htc.c @@ -258,8 +258,10 @@ void ath11k_htc_tx_completion_handler(struct ath11k_base *ab, u8 eid; eid = ATH11K_SKB_CB(skb)->eid; - if (eid >= ATH11K_HTC_EP_COUNT) + if (eid >= ATH11K_HTC_EP_COUNT) { + dev_kfree_skb_any(skb); return; + } ep = &htc->endpoint[eid]; spin_lock_bh(&htc->tx_lock);