File tree Expand file tree Collapse file tree 1 file changed +26
-4
lines changed
drivers/net/ethernet/broadcom Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -4019,7 +4019,7 @@ static int tg3_power_up(struct tg3 *tp)
40194019
40204020static int tg3_setup_phy (struct tg3 * , bool );
40214021
4022- static void tg3_power_down_prepare (struct tg3 * tp )
4022+ static int tg3_power_down_prepare (struct tg3 * tp )
40234023{
40244024 u32 misc_host_ctrl ;
40254025 bool device_should_wake , do_low_power ;
@@ -4263,7 +4263,7 @@ static void tg3_power_down_prepare(struct tg3 *tp)
42634263
42644264 tg3_ape_driver_state_change (tp , RESET_KIND_SHUTDOWN );
42654265
4266- return ;
4266+ return 0 ;
42674267}
42684268
42694269static void tg3_power_down (struct tg3 * tp )
@@ -18084,6 +18084,7 @@ static int tg3_suspend(struct device *device)
1808418084{
1808518085 struct net_device * dev = dev_get_drvdata (device );
1808618086 struct tg3 * tp = netdev_priv (dev );
18087+ int err = 0 ;
1808718088
1808818089 rtnl_lock ();
1808918090
@@ -18107,11 +18108,32 @@ static int tg3_suspend(struct device *device)
1810718108 tg3_flag_clear (tp , INIT_COMPLETE );
1810818109 tg3_full_unlock (tp );
1810918110
18110- tg3_power_down_prepare (tp );
18111+ err = tg3_power_down_prepare (tp );
18112+ if (err ) {
18113+ int err2 ;
18114+
18115+ tg3_full_lock (tp , 0 );
18116+
18117+ tg3_flag_set (tp , INIT_COMPLETE );
18118+ err2 = tg3_restart_hw (tp , true);
18119+ if (err2 )
18120+ goto out ;
18121+
18122+ tg3_timer_start (tp );
18123+
18124+ netif_device_attach (dev );
18125+ tg3_netif_start (tp );
18126+
18127+ out :
18128+ tg3_full_unlock (tp );
18129+
18130+ if (!err2 )
18131+ tg3_phy_start (tp );
18132+ }
1811118133
1811218134unlock :
1811318135 rtnl_unlock ();
18114- return 0 ;
18136+ return err ;
1811518137}
1811618138
1811718139static int tg3_resume (struct device * device )
You can’t perform that action at this time.
0 commit comments