Commit 080c637373904258ecc20cedc552b2472ab03d10
Committed by
Rusty Russell
1 parent
102a2786c9
virtio-net: drop config_mutex
config_mutex served two purposes: prevent multiple concurrent config change handlers, and synchronize access to config_enable flag. Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1 workqueue: make all workqueues non-reentrant all workqueues are non-reentrant, and config_enable is now gone. Get rid of the unnecessary lock. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Showing 1 changed file with 1 additions and 6 deletions Side-by-side Diff
drivers/net/virtio_net.c
... | ... | @@ -132,9 +132,6 @@ |
132 | 132 | /* Work struct for config space updates */ |
133 | 133 | struct work_struct config_work; |
134 | 134 | |
135 | - /* Lock for config space updates */ | |
136 | - struct mutex config_lock; | |
137 | - | |
138 | 135 | /* Does the affinity hint is set for virtqueues? */ |
139 | 136 | bool affinity_hint_set; |
140 | 137 | |
... | ... | @@ -1404,7 +1401,6 @@ |
1404 | 1401 | container_of(work, struct virtnet_info, config_work); |
1405 | 1402 | u16 v; |
1406 | 1403 | |
1407 | - mutex_lock(&vi->config_lock); | |
1408 | 1404 | if (virtio_cread_feature(vi->vdev, VIRTIO_NET_F_STATUS, |
1409 | 1405 | struct virtio_net_config, status, &v) < 0) |
1410 | 1406 | goto done; |
... | ... | @@ -1430,7 +1426,7 @@ |
1430 | 1426 | netif_tx_stop_all_queues(vi->dev); |
1431 | 1427 | } |
1432 | 1428 | done: |
1433 | - mutex_unlock(&vi->config_lock); | |
1429 | + return; | |
1434 | 1430 | } |
1435 | 1431 | |
1436 | 1432 | static void virtnet_config_changed(struct virtio_device *vdev) |
... | ... | @@ -1751,7 +1747,6 @@ |
1751 | 1747 | u64_stats_init(&virtnet_stats->rx_syncp); |
1752 | 1748 | } |
1753 | 1749 | |
1754 | - mutex_init(&vi->config_lock); | |
1755 | 1750 | INIT_WORK(&vi->config_work, virtnet_config_changed_work); |
1756 | 1751 | |
1757 | 1752 | /* If we can receive ANY GSO packets, we must allocate large ones. */ |