pch_gbe: Fix the issue which a driver locks when rx offload is set by ethtool
authorToshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Wed, 9 Feb 2011 20:28:06 +0000 (12:28 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Feb 2011 20:28:06 +0000 (12:28 -0800)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pch_gbe/pch_gbe_main.c

index 1bf12339441bb5887a4cfaf2c81abea647a41923..4c9a7d4f3fcabc0e63047e73ceaaaa18bc15b128 100644 (file)
@@ -519,7 +519,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();
 }
 
 /**
@@ -528,14 +530,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);
 }
 
 /**