linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] brcmfmac: shutdown interfaces on PSM's watchdog fire
@ 2017-02-24 17:24 Rafał Miłecki
  2017-03-07 13:32 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Rafał Miłecki @ 2017-02-24 17:24 UTC (permalink / raw)
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
	Pieter-Paul Giesberts, Franky Lin, linux-wireless,
	brcm80211-dev-list.pdl, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

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 <rafal@milecki.pl>
---
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;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] brcmfmac: shutdown interfaces on PSM's watchdog fire
  2017-02-24 17:24 [PATCH RFC] brcmfmac: shutdown interfaces on PSM's watchdog fire Rafał Miłecki
@ 2017-03-07 13:32 ` Kalle Valo
  2017-03-07 14:38   ` Rafał Miłecki
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2017-03-07 13:32 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
	Pieter-Paul Giesberts, Franky Lin, linux-wireless,
	brcm80211-dev-list.pdl, Rafał Miłecki

Rafa=C5=82 Mi=C5=82ecki <zajec5@gmail.com> writes:

> From: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>
> 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=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
> ---
> 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?

Did you notice this on your email:

To:     unlisted-recipients:; (no To-header on input)

--=20
Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] brcmfmac: shutdown interfaces on PSM's watchdog fire
  2017-03-07 13:32 ` Kalle Valo
@ 2017-03-07 14:38   ` Rafał Miłecki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2017-03-07 14:38 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
	Pieter-Paul Giesberts, Franky Lin, linux-wireless@vger.kernel.org,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	Rafał Miłecki

On 7 March 2017 at 14:32, Kalle Valo <kvalo@codeaurora.org> wrote:
> Rafa=C5=82 Mi=C5=82ecki <zajec5@gmail.com> writes:
>
>> From: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>>
>> 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=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>> ---
>> 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-DISABLE=
D
>>
>> 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?
>
> Did you notice this on your email:
>
> To:     unlisted-recipients:; (no To-header on input)

I guess I should have put linux-wireless in To. Normally I put you,
but since it's RFC, I left it empty and it went like this.

Anyway I believe it still reached linux-wireless. So any comments on this? =
:)

--=20
Rafa=C5=82

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-07 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24 17:24 [PATCH RFC] brcmfmac: shutdown interfaces on PSM's watchdog fire Rafał Miłecki
2017-03-07 13:32 ` Kalle Valo
2017-03-07 14:38   ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).