Patchwork [v2] pch_gbe: Fix the issue which a driver locks when rx offload is set by ethtool

login
register
mail settings
Submitter Toshiharu Okada
Date Feb. 9, 2011, 8:12 a.m.
Message ID <4D524C7F.1000700@dsn.okisemi.com>
Download mbox | patch
Permalink /patch/82435/
State Accepted
Delegated to: David Miller
Headers show

Comments

Toshiharu Okada - Feb. 9, 2011, 8:12 a.m.
Hi Devid

I resubmit this patch that removed compiler warning.

Best regards
Toshiharu Okada(OKI semiconductor)
---
This driver will be in a deadlock, When the rx offload is set by ethtool.
The pch_gbe_reinit_locked function was modified.

Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
---
 drivers/net/pch_gbe/pch_gbe_main.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
David Miller - Feb. 9, 2011, 8:28 p.m.
From: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Date: Wed, 09 Feb 2011 17:12:47 +0900

> This driver will be in a deadlock, When the rx offload is set by ethtool.
> The pch_gbe_reinit_locked function was modified.
> 
> Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
index 76a31b0..8ec48ad 100644
--- a/drivers/net/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/pch_gbe/pch_gbe_main.c
@@ -520,7 +520,9 @@  static void pch_gbe_reset_task(struct work_struct *work)
 	struct pch_gbe_adapter *adapter;
 	adapter = container_of(work, struct pch_gbe_adapter, reset_task);
 
+	rtnl_lock();
 	pch_gbe_reinit_locked(adapter);
+	rtnl_unlock();
 }
 
 /**
@@ -529,14 +531,8 @@  static void pch_gbe_reset_task(struct work_struct *work)
  */
 void pch_gbe_reinit_locked(struct pch_gbe_adapter *adapter)
 {
-	struct net_device *netdev = adapter->netdev;
-
-	rtnl_lock();
-	if (netif_running(netdev)) {
-		pch_gbe_down(adapter);
-		pch_gbe_up(adapter);
-	}
-	rtnl_unlock();
+	pch_gbe_down(adapter);
+	pch_gbe_up(adapter);
 }
 
 /**