From patchwork Fri Feb 24 17:24:23 2017 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: 9590835 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 50274601AE for ; Fri, 24 Feb 2017 17:24:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46FCC286EE for ; Fri, 24 Feb 2017 17:24:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BAA42871E; Fri, 24 Feb 2017 17:24:39 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 C6A3B286EE for ; Fri, 24 Feb 2017 17:24:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbdBXRYi (ORCPT ); Fri, 24 Feb 2017 12:24:38 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:36022 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbdBXRYg (ORCPT ); Fri, 24 Feb 2017 12:24:36 -0500 Received: by mail-lf0-f65.google.com with SMTP id p197so1896181lfp.3 for ; Fri, 24 Feb 2017 09:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SR8sQBHSM5XC710uRbJe9IgI2ngB3djKVugF1J9wMAI=; b=nMaNmZy/uYhBidfFBn2Nw+7bYIEtrTQjAXmRtaCfle59rSZQss8ckJGOcjsAK36KFi pYiShuIk+12/MPz17J32I450B2++7VOCozUtfSgaOlUS0WNNfshtWMLQcBQaBfu3AoK9 eId8M8hM37gldyRbj3Q3NOomfoKicKFK8WTUpuB15DaOVjTqUaUbedp7L9SUzdwF9NB3 Ih0uAOaLYHGrpMeIBSqjCF+fzIEaBUxzcqX3tR+L4xRmLB2vcDg+7AqkeG6uNUYew6s+ PYM/Obb4BvK7LaqsiOk/LsQMhlF/+jXKy+DT6RT+z+QZ0ruYauWqukdTPP/IGsHJRixm 8a+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SR8sQBHSM5XC710uRbJe9IgI2ngB3djKVugF1J9wMAI=; b=i3gUvcrjIViQg1hcuRa5ZolPXNk5eKC1P1YTwrs9e6BVQPUMwj4I8zrAxEOCrzkR+2 qOCqTv+SbVg4MXlKPADrfWnUQCoHjpexyQf3QdGh2BLXTAsHWoqRrshYjednwJPPa/wM IEO7HH9mmAUVPBDcTi6zrtqk7tdhVJlKX2D+paWclnFriVMRzYCiGUowXvwjWxZS127Q THO4Ti/FM7LPynQ8s9ch6XEqFNyhl2pig+OGbfACwH7ub+hExBuOdrbIYqPMKBN5lRAj nLdqYYhCOUvxZdWsXwx8yMYaPpTMwFa5BAHlbeAKRIzLngZJUS6Oom9NpptQPjzMGvqr vI2Q== X-Gm-Message-State: AMke39k8C3OZ8T5azvHr0ANECEoXusFfRafVXHbD2F7CQUGdkjyo+xQy2CSDqZlrvXVTMw== X-Received: by 10.25.28.199 with SMTP id c190mr1160856lfc.173.1487957074202; Fri, 24 Feb 2017 09:24:34 -0800 (PST) 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 u18sm2134166lff.48.2017.02.24.09.24.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 09:24:33 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH RFC] brcmfmac: shutdown interfaces on PSM's watchdog fire Date: Fri, 24 Feb 2017 18:24:23 +0100 Message-Id: <20170224172423.10980-1-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) 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 When PSM's watchdog fires hardware / firmware is not operational. It seems there isn't a way to restart firmware & reapply all settings so instead shut all interfaces down. This is at least some signal for the user things went wrong and allows reacting to it. Signed-off-by: Rafał Miłecki --- This patch is RFC as I'm wondering if there is any other way to handle such errors. I couldn't find anything except for that cfg80211_shutdown_all_interfaces. Unfortunately hostapd doesn't seem to react to this except for sth like: Fri Feb 24 13:41:07 2017 daemon.notice hostapd: wlan0: INTERFACE-DISABLED Shall we introduce some nl80211 even for such cases maybe? Or maybe I'm totally wrong and there is some simple way for a driver to request reconfiguration of all interfaces? --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 +++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 1 + drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 10098b7586f3..520d397bb963 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6981,3 +6981,8 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg) wl_deinit_priv(cfg); brcmf_free_wiphy(cfg->wiphy); } + +void brcmf_cfg80211_shutdown(struct brcmf_cfg80211_info *cfg) +{ + cfg80211_shutdown_all_interfaces(cfg->wiphy); +} diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h index 8f19d95d4175..77dafe03bb31 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h @@ -385,6 +385,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, struct device *busdev, bool p2pdev_forced); void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg); +void brcmf_cfg80211_shutdown(struct brcmf_cfg80211_info *cfg); s32 brcmf_cfg80211_up(struct net_device *ndev); s32 brcmf_cfg80211_down(struct net_device *ndev); enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 2f2f3a5ad86a..c6c0f3e8ef00 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -753,6 +753,10 @@ static int brcmf_psm_watchdog_notify(struct brcmf_if *ifp, if (err) brcmf_err("Failed to get memory dump, %d\n", err); + brcmf_cfg80211_shutdown(ifp->drvr->config); + + /* TODO: Stop the firmware */ + return err; }