From patchwork Tue Sep 20 22:00:22 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: 9342543 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 4037E607EE for ; Tue, 20 Sep 2016 22:01:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31CA3297D1 for ; Tue, 20 Sep 2016 22:01:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2624D2989F; Tue, 20 Sep 2016 22:01:15 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 2FC0B297D1 for ; Tue, 20 Sep 2016 22:01:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932167AbcITWAw (ORCPT ); Tue, 20 Sep 2016 18:00:52 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35048 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755134AbcITWAu (ORCPT ); Tue, 20 Sep 2016 18:00:50 -0400 Received: by mail-lf0-f68.google.com with SMTP id s64so1530347lfs.2; Tue, 20 Sep 2016 15:00:49 -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=tcx2nplFdfZMGRRAJH1bnrTOtYG64uZjDU3hBCbMiQg=; b=DJ91PYWMosJ8QfghMXZqH/Cdey/zHjMeIajh1h78iWv0BJNk0RJ1r4AHgMqoxJhOOe AU/1hTEgV9VPrP6POPPuVYXbU9tQY9pkZmd0DhYJrOy5HQDlJBJ/z+SShZLkxrMvHD3k epegpUC1HxNsv0vqZcAmaL2E0lWeyJGwCdF8Q38zzmwh8WZdTycDL1AQfGe2/kZKDuhH /4gwSPUEtFq/oY/+YeWKBLO6jpFUi0YlLz6WlEumUqhWsL/ZnAzF4nDcSl4DmJLj28NJ +zhZB0j3kCC9xWxFNR7H5stxnXJFTOj/51sQ8BdT8doh7rRGBQ58uW/jp3gPNcADjwDd aTiA== 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=tcx2nplFdfZMGRRAJH1bnrTOtYG64uZjDU3hBCbMiQg=; b=bo20rgKV22MKbRwLl+CBVNZfZq8nprF5XsQPQjZyc+UF8xrn/04xtTdeE3mD4m/hQ5 5FFGAHzbxDVr+kiQAv+bwnIwAn+gQUPBAd/al3JObBTlvh/bwAQUdJR+kNkwhrmkIQl7 h+lEv24t8Bf8sY+xTrmifUmf4Eo4ULiE+5I0w565oxwGZP+FebSgeT5dPWUFSvC2L3MD uS7d34Yx9IdF7IgEc4q+Ql4Xx3hvsv5FPg83zj26qpE/1GIBTZJT10WNdIlkFxJtFFbn JiyyGDdR9gzNIc2zCYMNAoxr8374cSIXXspJmGYppgZkSWS1apyG1KwZruEe5LZzfDD/ bkRA== X-Gm-Message-State: AE9vXwNdhNjYmJ97KtCeVMQfyVHMLStIig3tT5CV8ETzmWONKcLa5BhF9f2LsGfWnRO6CQ== X-Received: by 10.46.1.156 with SMTP id f28mr11036174lji.36.1474408847982; Tue, 20 Sep 2016 15:00:47 -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 f3sm6132609lff.21.2016.09.20.15.00.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Sep 2016 15:00:47 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Hante Meuleman , Arend van Spriel , brcm80211-dev-list@broadcom.com Cc: linux-wireless@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Pieter-Paul Giesberts , "Franky (Zhenhui) Lin" , brcm80211-dev-list.pdl@broadcom.com (open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER), netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH RFC] brcmfmac: stop netif queue when waiting for packets transmission Date: Wed, 21 Sep 2016 00:00:22 +0200 Message-Id: <20160920220030.10257-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 Sending a new key to the firmware should be done without any 802.1x packets pending. Currently brcmfmac has very trivial code waiting for that condition and it doesn't seem to be enough. We should stop netif from sending any extra packets in order to: 1) Make sure new 802.1x packets won't be coming over and over 2) Avoid a race with netif providing a new packet right after our waiting code Another solution would be to accept only non-802.1x packets. This would require enqueuing all packets and hacking brcmf_fws_dequeue_worker to dequeue only non-802.1x ones but that would most likely result in too hacky code. --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 201a980..1791060 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -471,11 +471,14 @@ send_key_to_dongle(struct brcmf_if *ifp, struct brcmf_wsec_key *key) convert_key_from_CPU(key, &key_le); + netif_stop_queue(ifp->ndev); brcmf_netdev_wait_pend8021x(ifp); err = brcmf_fil_bsscfg_data_set(ifp, "wsec_key", &key_le, sizeof(key_le)); + netif_start_queue(ifp->ndev); + if (err) brcmf_err("wsec_key error (%d)\n", err); return err;