Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp556589imi; Fri, 22 Jul 2022 04:58:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vNZ6mitRDpiIuBsv9HjlTqlwhkm7Ni89hIfMCWtOYgL+b2RpF3dEwGwgO4qVrFgWOcB3K5 X-Received: by 2002:a05:6402:270b:b0:43a:d89e:8c2d with SMTP id y11-20020a056402270b00b0043ad89e8c2dmr232285edd.413.1658491097994; Fri, 22 Jul 2022 04:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658491097; cv=none; d=google.com; s=arc-20160816; b=fGN6gI5bfZ20+x8ebA0cbgzYT+zW6iI1qldmTgV32+O26IutOIkOBS1jCgMBRceaXm V3Vn5NiDYL3wFfdBJrr3SZy/tLqgeznDETUNckuj2a1641/mI6kLRx73dEeZY2o0PdHH gthbqfa9S2E+FQROsBxaY6ZA9Z5+iX2I9viXopaC7VAajZFMthvcU3OSSPJ8CTQid+G3 v1syNeTBVsQON3HELFCp3vUcI1/VN3hz2WjeV8on2+j+5mqKiIoPeg2PH2JwpiDYbzCN mz7B4vDF6sdZJwWClUQAb9Isv9GeorxZr2T07TQ67V3NBC8SDIRHE3LILAFj3Gklbscp oJmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=flnEvotZidaUh2ykk93snCPMpbwPpMdDiRUs0F6eFEc=; b=zzc0WBvtyFsnh3sT4tL9YRUCSZfqICz2ohfv0YcPcdftKXRMJ4hqkpAmaGsHgLsSxo EvuLHR6mw090UBh68kv+Bw7tv+cHpL2lZhXYbinHo2fExfV6Sv8ZELREZ6/jhuRHccb+ R9ZdFnqnrhy1nDysDDY80+pnxWhhotW4JhPygQqabBU61pFvAIHeYrCSuP/Wy3FwubIK FlVCpezkGgF52zJR1qRZbSCX07y3CH1fFdk+Zn8+wLOM5nlpps3RjHv74ER2D7cjdprn NolWf8mGD8J/psyfGIR97qZsxaH3RRrNMO6xyYrpgIzr2Z8hSubcbKvOu/In8glTaW4W whhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@pqrs.dk header.s=google header.b=Z6SfeP8z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs10-20020a1709072d0a00b0072b53db6bf0si6435621ejc.621.2022.07.22.04.58.00; Fri, 22 Jul 2022 04:58:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@pqrs.dk header.s=google header.b=Z6SfeP8z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235100AbiGVL5F (ORCPT + 65 others); Fri, 22 Jul 2022 07:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbiGVL5A (ORCPT ); Fri, 22 Jul 2022 07:57:00 -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 08289BB203 for ; Fri, 22 Jul 2022 04:56:59 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id c72so2682744edf.8 for ; Fri, 22 Jul 2022 04:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqrs.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=flnEvotZidaUh2ykk93snCPMpbwPpMdDiRUs0F6eFEc=; b=Z6SfeP8zsYcJua2iTIQeZidzdyHntaXwsRbowZ7wR2rGGaujqr2+mDU88XYuiwUBD/ bNxPs/fLEpfyBMPa42WlZXmp2Nslb7bqnMpqo70+FQBVckDSgAhrA6PVgtnBV+V75ane 6vvH1huOD+yEuf8CiQ1EQSX/rYqyYpAZaLH1I= 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=flnEvotZidaUh2ykk93snCPMpbwPpMdDiRUs0F6eFEc=; b=a5JVVhrVCNBil5LIt0/RPGj0K0xkIwr6ztWkYMJ4slbzwmgHf2e2mrJo7vtNoKClm7 hJ9wc9H82NR9MYoe3RV3+V0PsMuwctA+GXcNHCzJ6eb0zx4WXxvfHq11ZWBCfLwAzoWW 6cNKa7SjAETgHaCqtV2k4Mv2FoKjEPXg8WbbNKs3qJ4wwfwNNAKwBeO97DD7wzWoHQvY Tnt2Wd1qxZ6HiI6RTHoIGROnhewdbftJe3kY0cB9fG1MULI1PZ7SAyCGJuEXDaOIzlf6 4GLbk4pb2q5o3nhSE9YK0dX95j6fU1pLzCqs6E4aQwyyx2WsFMK+QIoRZkKi4g8f4ZfQ Dyrg== X-Gm-Message-State: AJIora/YOTLJkvbzNgXT1RS6A42THuGtQufJHQXsFv+78v1Sve3AtW8j 6TZSx+16iGC0Y7DZvLWABEVscg== X-Received: by 2002:a05:6402:2789:b0:43a:de54:40fd with SMTP id b9-20020a056402278900b0043ade5440fdmr234482ede.319.1658491018561; Fri, 22 Jul 2022 04:56:58 -0700 (PDT) Received: from localhost.localdomain (80.71.142.18.ipv4.parknet.dk. [80.71.142.18]) by smtp.gmail.com with ESMTPSA id kx6-20020a170907774600b0072b3182368fsm1934370ejc.77.2022.07.22.04.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 04:56:58 -0700 (PDT) From: =?UTF-8?q?Alvin=20=C5=A0ipraga?= To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Wataru Gohda , Chi-hsien Lin , Ahmad Fatoum , =?UTF-8?q?Alvin=20=C5=A0ipraga?= , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] brcmfmac: Fix to add skb free for TIM update info when tx is completed Date: Fri, 22 Jul 2022 13:56:30 +0200 Message-Id: <20220722115632.620681-6-alvin@pqrs.dk> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220722115632.620681-1-alvin@pqrs.dk> References: <20220722115632.620681-1-alvin@pqrs.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 From: Wataru Gohda The skb will be allocated to send TIM update info in brcmf_fws_tim_update. Currently the skb will be freed when tx is failed but it will not be freed when tx is completed successfully. The fix is to free the skb when tx is completed always. Signed-off-by: Wataru Gohda Signed-off-by: Chi-hsien Lin Signed-off-by: Ahmad Fatoum Signed-off-by: Alvin Šipraga --- .../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 3 +-- .../broadcom/brcm80211/brcmfmac/fwsignal.c | 16 ++++++++++------ .../broadcom/brcm80211/brcmfmac/fwsignal.h | 3 ++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c index 2c95a08a5871..02a56edf08ba 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c @@ -368,8 +368,7 @@ brcmf_proto_bcdc_txcomplete(struct device *dev, struct sk_buff *txp, /* await txstatus signal for firmware if active */ if (brcmf_fws_fc_active(bcdc->fws)) { - if (!success) - brcmf_fws_bustxfail(bcdc->fws, txp); + brcmf_fws_bustxcomplete(bcdc->fws, txp, success); } else { if (brcmf_proto_bcdc_hdrpull(bus_if->drvr, false, txp, &ifp)) brcmu_pkt_buf_free_skb(txp); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index d58525ebe618..85e3b953b0a9 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -2475,7 +2475,8 @@ bool brcmf_fws_fc_active(struct brcmf_fws_info *fws) return fws->fcmode != BRCMF_FWS_FCMODE_NONE; } -void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb) +void brcmf_fws_bustxcomplete(struct brcmf_fws_info *fws, struct sk_buff *skb, + bool success) { u32 hslot; @@ -2483,11 +2484,14 @@ void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb) brcmu_pkt_buf_free_skb(skb); return; } - brcmf_fws_lock(fws); - hslot = brcmf_skb_htod_tag_get_field(skb, HSLOT); - brcmf_fws_txs_process(fws, BRCMF_FWS_TXSTATUS_HOST_TOSSED, hslot, 0, 0, - 1); - brcmf_fws_unlock(fws); + + if (!success) { + brcmf_fws_lock(fws); + hslot = brcmf_skb_htod_tag_get_field(skb, HSLOT); + brcmf_fws_txs_process(fws, BRCMF_FWS_TXSTATUS_HOST_TOSSED, hslot, + 0, 0, 1); + brcmf_fws_unlock(fws); + } } void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h index b16a9d1c0508..f9c36cd8f1de 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h @@ -40,7 +40,8 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb); void brcmf_fws_reset_interface(struct brcmf_if *ifp); void brcmf_fws_add_interface(struct brcmf_if *ifp); void brcmf_fws_del_interface(struct brcmf_if *ifp); -void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb); +void brcmf_fws_bustxcomplete(struct brcmf_fws_info *fws, struct sk_buff *skb, + bool success); void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked); void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb); -- 2.37.0