File tree 1 file changed +6
-7
lines changed 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -1118,11 +1118,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1118
1118
{
1119
1119
struct virtnet_info * vi = container_of (nfb , struct virtnet_info , nb );
1120
1120
1121
- mutex_lock (& vi -> config_lock );
1122
-
1123
- if (!vi -> config_enable )
1124
- goto done ;
1125
-
1126
1121
switch (action & ~CPU_TASKS_FROZEN ) {
1127
1122
case CPU_ONLINE :
1128
1123
case CPU_DOWN_FAILED :
@@ -1136,8 +1131,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1136
1131
break ;
1137
1132
}
1138
1133
1139
- done :
1140
- mutex_unlock (& vi -> config_lock );
1141
1134
return NOTIFY_OK ;
1142
1135
}
1143
1136
@@ -1699,6 +1692,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
1699
1692
struct virtnet_info * vi = vdev -> priv ;
1700
1693
int i ;
1701
1694
1695
+ unregister_hotcpu_notifier (& vi -> nb );
1696
+
1702
1697
/* Prevent config work handler from accessing the device */
1703
1698
mutex_lock (& vi -> config_lock );
1704
1699
vi -> config_enable = false;
@@ -1747,6 +1742,10 @@ static int virtnet_restore(struct virtio_device *vdev)
1747
1742
virtnet_set_queues (vi , vi -> curr_queue_pairs );
1748
1743
rtnl_unlock ();
1749
1744
1745
+ err = register_hotcpu_notifier (& vi -> nb );
1746
+ if (err )
1747
+ return err ;
1748
+
1750
1749
return 0 ;
1751
1750
}
1752
1751
#endif
You can’t perform that action at this time.
0 commit comments