From patchwork Tue Jul 11 12:35:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 9834609 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 2A3CD602BD for ; Tue, 11 Jul 2017 12:35:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16B401FF2C for ; Tue, 11 Jul 2017 12:35:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0700722B26; Tue, 11 Jul 2017 12:35:16 +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, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 40B451FF2C for ; Tue, 11 Jul 2017 12:35:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932158AbdGKMfN (ORCPT ); Tue, 11 Jul 2017 08:35:13 -0400 Received: from mail-qk0-f178.google.com ([209.85.220.178]:33177 "EHLO mail-qk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752533AbdGKMfM (ORCPT ); Tue, 11 Jul 2017 08:35:12 -0400 Received: by mail-qk0-f178.google.com with SMTP id v143so102107603qkb.0 for ; Tue, 11 Jul 2017 05:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=/4tL4hlXDgSu8/7+BRTGmwkxRz/4ON+RFCBjV2QFt3I=; b=UcxJnBqVW+VYJR6jqnhEU9/PM7bi1X67aPTFi71Z+id72TLmd+CJqkZohVv6XbZCeR 6vnvIBFCrOlFZ02haGfjJfhwapvEzWoN9sOt1zV3MNZftT/tlePhbhT2QHJJSB/Ka2sO EfbeqMLSs74PDiLRaLEp/a6iSgRrMSS+EWpPI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/4tL4hlXDgSu8/7+BRTGmwkxRz/4ON+RFCBjV2QFt3I=; b=IVammbBW50G8uHtfx0StCVpKjUpnwwtttBz7pVMbs+N6rCEI09OPhVktIr7O6GqQ+r z5aJRI8LkAqaHFAZZdck/PqzCyrfe224ZNo7Zb2Yl44fpkH94pVBb2XRbztevPOcbWLe SSS5+Lj2ZY5MCoG8t0bcb71RWB1dLi5AUIgbbWumQBSA/GMNGFq/jLkYIQFUqIsKImfU 7k4EKL4plHc5lMGRodNgLsHuZZzURTr9NWW+ebVt3bYgv5yjdp5y65fWBoY3sc0+crLy Ld8FydfrgPwjIqdoOfo48unc9jxOzhVV5HrIORGmpIIcdDRUfXMdyuFmsEkvuGtRDkJe XYKQ== X-Gm-Message-State: AIVw1136S7NULcwpklQCwXxDFQsJdTQ4XNI9EUAK3g/rY2VoyL6cG0Yg BkdXfQMnsizteVlP X-Received: by 10.237.54.225 with SMTP id f88mr10095625qtb.240.1499776511031; Tue, 11 Jul 2017 05:35:11 -0700 (PDT) Received: from [10.177.251.162] ([192.19.248.250]) by smtp.gmail.com with ESMTPSA id i85sm10268409qke.66.2017.07.11.05.35.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jul 2017 05:35:10 -0700 (PDT) Subject: Re: [BUG] brcmfmac: BRCM4354 cannot connect since commit 270a6c1f65 To: "S. Gilles" , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com References: <20170711122125.5epcjhcyneiwxyse@number18.npnth.net> From: Arend van Spriel Message-ID: Date: Tue, 11 Jul 2017 14:35:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170711122125.5epcjhcyneiwxyse@number18.npnth.net> Content-Language: en-US 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 On 11-07-17 14:21, S. Gilles wrote: > Hi, > > I have an Asus C201, which comes with a BRCM4354 (SDIO). On boot, > dmesg shows > > brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Apr 8 2015 13:03:52 version 7.35.79.79 (r547158) FWID 01-7f29997a > > Since 270a6c1f65fe68a28a5d39cd405592c550b496c7 (brcmfmac: rework > headroom check in .start_xmit()), the machine cannot connect to any > wireless network. I can fully reproduce this, and have bisected it; > I'm mailing this from the commit before: a833f3d4de. I only have > access to WPA2 networks, in case it matters. The relevent part of > dmesg from a bad boot is > > [ ... ] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready > [ +0.000767] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [ +0.905426] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [Jul11 11:02] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [ +0.983406] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [Jul11 11:03] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [Jul11 11:05] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [ +0.981930] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [Jul11 11:07] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [Jul11 11:09] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [ +0.698295] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > ... (etc.) > [ +0.918891] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > [Jul11 11:18] dwmmc_rockchip ff0d0000.dwmmc: Successfully tuned phase to 204 > [ +12.545604] brcmfmac: brcmf_proto_bcdc_hdrpull: wlan0: non-BCDC packet received, flags 0x0 > ... (etc.) > > meanwhile, wpa_cli is full of output like > > ... > <3>CTRL-EVENT-NETWORK-NOT-FOUND > <3>CTRL-EVENT-SCAN-STARTED > <3>CTRL-EVENT-SCAN-RESULTS > <3>CTRL-EVENT-SSID-REENABLED id=1 ssid="{known SSID}" > <3>Trying to associate with SSID '{known SSID}' > <3>Associated with {MAC} > <3>CTRL-EVENT-SUBNET-STATUS-UPDATE status=0 > <3>Authentication with {MAC} timed out. > <3>CTRL-EVENT-DISCONNECTED bssid={MAC} reason=3 locally_generated=1 > <3>WPA: 4-Way Handshake failed - pre-shared key may be incorrect > <3>CTRL-EVENT-SID-TEMP-DISABLED id=1 ssid="{known SSID}" auth_failures=26 duration=120 reason=WRONG_KEY > <3>CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD > <3>CTRL-EVENT-SCAN-STARTED > <3>CTRL-EVENT-SCAN-RESULTS > <4>Failed to initiate sched scan > <3>CTRL-EVENT-NETWORK-NOT-FOUND > ... > > The `non-BCDC packet received' messages in dmesg occur just before > the `timed out' messages in wpa_cli. > > Please let me know if more information is needed of if there are > patches I should test. Looking at the diff of the bad commit, I came up with the patch below. Can you try it and let me know the result? Regards, Arend --- /** diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index fbcbb43..c3ecec6 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -2053,12 +2053,13 @@ static int brcmf_sdio_txpkt_hdalign(struct brcmf_sdio *bus, struct sk_buff *pkt) atomic_inc(&stats->pktcow_failed); return -ENOMEM; } + head_pad = 0; } skb_push(pkt, head_pad); dat_buf = (u8 *)(pkt->data); } memset(dat_buf, 0, head_pad + bus->tx_hdrlen); - return 0; + return head_pad; }