From patchwork Tue Sep 27 09:14:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9351619 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4DBB06077A for ; Tue, 27 Sep 2016 09:15:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DF2C29144 for ; Tue, 27 Sep 2016 09:15:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 305BB2914B; Tue, 27 Sep 2016 09:15:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AACAD29144 for ; Tue, 27 Sep 2016 09:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932289AbcI0JOo (ORCPT ); Tue, 27 Sep 2016 05:14:44 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33513 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752831AbcI0JOm (ORCPT ); Tue, 27 Sep 2016 05:14:42 -0400 Received: by mail-lf0-f67.google.com with SMTP id l131so1477541lfl.0; Tue, 27 Sep 2016 02:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0B8+t5xQXcCNtiu1V47D4R2xJt4kJxzgbKsFszigZ+g=; b=L7yYIQYcGSrInby3K5liN3RcuLot7bh7UoFboj8oy/ZVsWHBuGQ1VWueXzOvMkaPEm FhIBI39K0b6nQdcfRi+U2XB0GYZeoR7tPggIQi9EyuVHuwPdQBRCjzeNHH8pAx58mhMm HzxGyeIQvh5wbgRoJzTZZ93bCH33KSYa+UszkYAZg931SVoyXCcNxxLOtV5assCwOHFv 3RbEUmNTSfMlQHCHmbqr7bRkqNfFla4sbZvzn3THrVmQXrjc8joVA4bOK0Byq4in4vzW YNAX0S/WP17JrnzGgMEDVdVVERAW4FcWZuyffsjZmg2G+gi8hDoa659/XjdzFuBteYUP tvwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0B8+t5xQXcCNtiu1V47D4R2xJt4kJxzgbKsFszigZ+g=; b=Tam4qgtwKOzDSJaJtrcWHP0hSKMsoSTDJbdbD1O47jGukxoTp9pI7VK6HLa1PO9qxf tLkP9Wx+oZ5BFWUPyPSjGmRlIzqQJNyUV3ByDQjnkBd/SzptBPra/sG/4KCeHLy0vGuo RS66izRpCDH1apClNdogdpCVmwmL3VpUYdB6OIvO+Nc1gFd9Z7IK5mQ6mvWKUqpxOYWR chmca39EVmYG6evrA9qt3gqQrZ70hRp7mzjDa1H7vgCBtiUeh8uvMOoI+qQX+EOBDlRj ADArnPoOiL1CVWhNGTwBChXuM+R9ZWtQlEw9Pd6zB9GbR5V4drcUDkFEF0bsbDLy+3jW I1JA== X-Gm-Message-State: AE9vXwOXgv2hmYhnuAEh7pR0LB9iqLQW5Sz49hZsUA8hQO4GBbM7be0R5NMD1I8v7B0u9g== X-Received: by 10.25.201.81 with SMTP id z78mr7508820lff.113.1474967680331; Tue, 27 Sep 2016 02:14:40 -0700 (PDT) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 78sm259366ljj.4.2016.09.27.02.14.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Sep 2016 02:14:39 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 4.9] brcmfmac: use correct skb freeing helper when deleting flowring Date: Tue, 27 Sep 2016 11:14:28 +0200 Message-Id: <20160927091428.19223-1-zajec5@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki Flowrings contain skbs waiting for transmission that were passed to us by netif. It means we checked every one of them looking for 802.1x Ethernet type. When deleting flowring we have to use freeing function that will check for 802.1x type as well. Freeing skbs without a proper check was leading to counter not being properly decreased. This was triggering a WARNING every time brcmf_netdev_wait_pend8021x was called. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel Signed-off-by: Rafa? Mi?ecki Acked-by: Arend van Spriel --- Kalle: this isn't important enough for 4.8 as it's too late for that. I'd like to get it for 4.9 however, as this fixes bug that could lead to WARNING on every add_key/del_key call. We was struggling with these WARNINGs for some time and this fixes one of two problems causing them. --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c index b16b367..d0b738d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c @@ -234,13 +234,20 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u16 flowid, void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid) { + struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); struct brcmf_flowring_ring *ring; + struct brcmf_if *ifp; u16 hash_idx; + u8 ifidx; struct sk_buff *skb; ring = flow->rings[flowid]; if (!ring) return; + + ifidx = brcmf_flowring_ifidx_get(flow, flowid); + ifp = brcmf_get_ifp(bus_if->drvr, ifidx); + brcmf_flowring_block(flow, flowid, false); hash_idx = ring->hash_id; flow->hash[hash_idx].ifidx = BRCMF_FLOWRING_INVALID_IFIDX; @@ -249,7 +256,7 @@ void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid) skb = skb_dequeue(&ring->skblist); while (skb) { - brcmu_pkt_buf_free_skb(skb); + brcmf_txfinalize(ifp, skb, false); skb = skb_dequeue(&ring->skblist); }