File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -1096,11 +1096,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1096
1096
{
1097
1097
struct virtnet_info * vi = container_of (nfb , struct virtnet_info , nb );
1098
1098
1099
- mutex_lock (& vi -> config_lock );
1100
-
1101
- if (!vi -> config_enable )
1102
- goto done ;
1103
-
1104
1099
switch (action & ~CPU_TASKS_FROZEN ) {
1105
1100
case CPU_ONLINE :
1106
1101
case CPU_DOWN_FAILED :
@@ -1114,8 +1109,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1114
1109
break ;
1115
1110
}
1116
1111
1117
- done :
1118
- mutex_unlock (& vi -> config_lock );
1119
1112
return NOTIFY_OK ;
1120
1113
}
1121
1114
@@ -1672,6 +1665,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
1672
1665
struct virtnet_info * vi = vdev -> priv ;
1673
1666
int i ;
1674
1667
1668
+ unregister_hotcpu_notifier (& vi -> nb );
1669
+
1675
1670
/* Prevent config work handler from accessing the device */
1676
1671
mutex_lock (& vi -> config_lock );
1677
1672
vi -> config_enable = false;
@@ -1720,6 +1715,10 @@ static int virtnet_restore(struct virtio_device *vdev)
1720
1715
virtnet_set_queues (vi , vi -> curr_queue_pairs );
1721
1716
rtnl_unlock ();
1722
1717
1718
+ err = register_hotcpu_notifier (& vi -> nb );
1719
+ if (err )
1720
+ return err ;
1721
+
1723
1722
return 0 ;
1724
1723
}
1725
1724
#endif
You can’t perform that action at this time.
0 commit comments