From patchwork Sun May 29 21:39: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: 9139965 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 BE44E60755 for ; Sun, 29 May 2016 21:41:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5E22796F for ; Sun, 29 May 2016 21:41:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F98428187; Sun, 29 May 2016 21:41:03 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 525782796F for ; Sun, 29 May 2016 21:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753006AbcE2Vka (ORCPT ); Sun, 29 May 2016 17:40:30 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35325 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752848AbcE2Vk2 (ORCPT ); Sun, 29 May 2016 17:40:28 -0400 Received: by mail-lf0-f67.google.com with SMTP id q63so2891325lfi.2; Sun, 29 May 2016 14:40:27 -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=VdYB21tHrBvBFqlwnRFOgfU/u9FLb8Up1bKxG/y0Jrs=; b=GTsxrJKQlCDV6tCJpYMmfmNzhetWoTfYJXM9CrGq/A11jmRTQD7sfkjgbKF8T3Oq2y M3ub9xHof+wfJ5k+INtx5IAH80rclReQa9p2F/lSML5cGwMM3H5IeDlgM56hPLRpIDHg CnSIqhlf2rHtGZwXdxL8Y2I0uFzJQB5wc5QkFKemsidZgIpfZ8RMHLLSsnQA5LYkeUKo rhgEfuxOfm2LrLzpc/Ejnc6IgKKNe2KMWQ2jsuRcKjmtLS5V5u0O1yW50yytNlr9hsre FhWeykoD+PXUk7ERp5tUs2ByPt8E78jZgLbCYcaFr9zbkHQabhKEP7v2YherWn7QjRi/ zE1A== 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=VdYB21tHrBvBFqlwnRFOgfU/u9FLb8Up1bKxG/y0Jrs=; b=BHKt2EXDutN61rseGuRNnpYThuxDeYvJ2LngZV0pIqOI/va8JpZiXhBSM4zs4wckjr roG+n3Pj9q8kVMM+KUY2a37r3vUk2LTz/Sz8USRRIJU2mUjPTryCZ3Aj1AvVuABhH8nW anpgV3GcN9vEk/T40nB4lF3XWITwfAK+q37PW8jSVnStsx0QVyDXliL29i+INnARKlRp gn4Al/Y7BoBs+2BBAT+3KPK97UA3S0TdwwN5JPtT4gFAMVTqq6lTuNV2bFRCSpGeQU7Q D+e3+s+Uj0IQH3cphjeX8C1j46Z3dL/n/0WXNcV70JduJgV5Sx46BHEVfR/lfq5aMWaX uo1g== X-Gm-Message-State: ALyK8tKxAhwTnXTyEigEsxKBGRLuXmkJUv9R3nX8IWpRD8+UWbkX94n4GTmqSWDZ8VcQLQ== X-Received: by 10.25.207.70 with SMTP id f67mr1176869lfg.62.1464558026177; Sun, 29 May 2016 14:40:26 -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 h18sm4433971lbb.8.2016.05.29.14.40.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 May 2016 14:40:25 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , Pieter-Paul Giesberts , linux-wireless@vger.kernel.org (open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER), brcm80211-dev-list@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 next] brcmfmac: don't remove interface on link down firmware event Date: Sun, 29 May 2016 23:39:28 +0200 Message-Id: <1464557989-20003-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 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 There are two firmware events we handle similarly in brcmfmac: BRCMF_E_LINK and BRCMF_E_IF. The difference from firmware point of view is that the first one means BSS remains present in the firmware. Trying to (re)create it (e.g. when adding new virtual interface) will result in an error. Current code treats both events in a similar way. It removes Linux interface for each of them. It works OK with e.g. BCM43602. Its firmware generates both events for each interface. It means we get BRCMF_E_LINK and remove interface. That is soon followed by BRCMF_E_IF which means BSS was also removed in a firmware. The only downside of this is a harmless error like: [ 208.643180] brcmfmac: brcmf_fweh_call_event_handler: no interface object Unfortunately BCM4366 firmware doesn't automatically remove BSS and so it doesn't generate BRCMF_E_IF. In such case we incorrectly remove Linux interface on BRCMF_E_LINK as BSS is still present in the firmware. It results in an error when trying to re-create virtual interface, e.g.: > iw phy phy1 interface add wlan1-1 type __ap [ 3602.929199] brcmfmac: brcmf_ap_add_vif: timeout occurred command failed: I/O error (-5) With this patch we don't remove Linux interface while firmware keeps BSS. Thanks to this we keep a consistent states of host driver and device firmware. Further improvement should be to mark BSS as disabled and remove interface on BRCMF_E_LINK. Then we should add support for reusing BSS-es. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 38df1be..26ff0f4 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5439,8 +5439,6 @@ brcmf_notify_connect_status_ap(struct brcmf_cfg80211_info *cfg, ndev != cfg_to_ndev(cfg)) { brcmf_dbg(CONN, "AP mode link down\n"); complete(&cfg->vif_disabled); - if (ifp->vif->mbss) - brcmf_remove_interface(ifp); return 0; }