linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwifiex: replace netif_carrier_on/off by netif_device_attach/dettach
@ 2017-08-02 20:04 Ganapathi Bhat
  2017-08-08 11:47 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Ganapathi Bhat @ 2017-08-02 20:04 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brian Norris, Cathy Luo, Nishant Sarmukadam, Xinming Hu,
	Zhiyuan Yang, Ganapathi Bhat

Driver is doing netif_carrier_off during suspend, which will set
the IFF_LOWER_UP flag to 0. As a result certain applications
will think this as a real carrier down and behave accordingly.
This will cause issues like loss of IP address, for example. To
fix this use netif_device_dettach during suspend.

Fixes: 0026b32d723e ('mwifiex: fix Tx timeout issue during suspend test')

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 2be7817..83605a2 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -3391,11 +3391,8 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
 
 	for (i = 0; i < adapter->priv_num; i++) {
 		priv = adapter->priv[i];
-		if (priv && priv->netdev) {
-			mwifiex_stop_net_dev_queue(priv->netdev, adapter);
-			if (netif_carrier_ok(priv->netdev))
-				netif_carrier_off(priv->netdev);
-		}
+		if (priv && priv->netdev)
+			netif_device_detach(priv->netdev);
 	}
 
 	for (i = 0; i < retry_num; i++) {
@@ -3466,11 +3463,8 @@ static int mwifiex_cfg80211_resume(struct wiphy *wiphy)
 
 	for (i = 0; i < adapter->priv_num; i++) {
 		priv = adapter->priv[i];
-		if (priv && priv->netdev) {
-			if (!netif_carrier_ok(priv->netdev))
-				netif_carrier_on(priv->netdev);
-			mwifiex_wake_up_net_dev_queue(priv->netdev, adapter);
-		}
+		if (priv && priv->netdev)
+			netif_device_attach(priv->netdev);
 	}
 
 	if (!wiphy->wowlan_config)
-- 
1.9.1

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

* Re: mwifiex: replace netif_carrier_on/off by netif_device_attach/dettach
  2017-08-02 20:04 [PATCH] mwifiex: replace netif_carrier_on/off by netif_device_attach/dettach Ganapathi Bhat
@ 2017-08-08 11:47 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2017-08-08 11:47 UTC (permalink / raw)
  To: Ganapathi Bhat
  Cc: linux-wireless, Brian Norris, Cathy Luo, Nishant Sarmukadam,
	Xinming Hu, Zhiyuan Yang, Ganapathi Bhat

Ganapathi Bhat <gbhat@marvell.com> wrote:

> Driver is doing netif_carrier_off during suspend, which will set
> the IFF_LOWER_UP flag to 0. As a result certain applications
> will think this as a real carrier down and behave accordingly.
> This will cause issues like loss of IP address, for example. To
> fix this use netif_device_dettach during suspend.
> 
> Fixes: 0026b32d723e ('mwifiex: fix Tx timeout issue during suspend test')
> 
> Signed-off-by: Cathy Luo <cluo@marvell.com>
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

Patch applied to wireless-drivers-next.git, thanks.

bd69cddcdf47 mwifiex: replace netif_carrier_on/off by netif_device_attach/dettach

-- 
https://patchwork.kernel.org/patch/9877467/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2017-08-08 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02 20:04 [PATCH] mwifiex: replace netif_carrier_on/off by netif_device_attach/dettach Ganapathi Bhat
2017-08-08 11:47 ` Kalle Valo

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).