@@ -613,9 +613,11 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
613
613
return NETDEV_TX_OK ;
614
614
}
615
615
616
- static void fs_timeout (struct net_device * dev )
616
+ static void fs_timeout_work (struct work_struct * work )
617
617
{
618
- struct fs_enet_private * fep = netdev_priv (dev );
618
+ struct fs_enet_private * fep = container_of (work , struct fs_enet_private ,
619
+ timeout_work );
620
+ struct net_device * dev = fep -> ndev ;
619
621
unsigned long flags ;
620
622
int wake = 0 ;
621
623
@@ -627,7 +629,6 @@ static void fs_timeout(struct net_device *dev)
627
629
phy_stop (dev -> phydev );
628
630
(* fep -> ops -> stop )(dev );
629
631
(* fep -> ops -> restart )(dev );
630
- phy_start (dev -> phydev );
631
632
}
632
633
633
634
phy_start (dev -> phydev );
@@ -639,6 +640,13 @@ static void fs_timeout(struct net_device *dev)
639
640
netif_wake_queue (dev );
640
641
}
641
642
643
+ static void fs_timeout (struct net_device * dev )
644
+ {
645
+ struct fs_enet_private * fep = netdev_priv (dev );
646
+
647
+ schedule_work (& fep -> timeout_work );
648
+ }
649
+
642
650
/*-----------------------------------------------------------------------------
643
651
* generic link-change handler - should be sufficient for most cases
644
652
*-----------------------------------------------------------------------------*/
@@ -759,6 +767,7 @@ static int fs_enet_close(struct net_device *dev)
759
767
netif_stop_queue (dev );
760
768
netif_carrier_off (dev );
761
769
napi_disable (& fep -> napi );
770
+ cancel_work_sync (& fep -> timeout_work );
762
771
phy_stop (dev -> phydev );
763
772
764
773
spin_lock_irqsave (& fep -> lock , flags );
@@ -1019,6 +1028,7 @@ static int fs_enet_probe(struct platform_device *ofdev)
1019
1028
1020
1029
ndev -> netdev_ops = & fs_enet_netdev_ops ;
1021
1030
ndev -> watchdog_timeo = 2 * HZ ;
1031
+ INIT_WORK (& fep -> timeout_work , fs_timeout_work );
1022
1032
netif_napi_add (ndev , & fep -> napi , fs_enet_napi , fpi -> napi_weight );
1023
1033
1024
1034
ndev -> ethtool_ops = & fs_ethtool_ops ;
0 commit comments