Skip to content

Commit 0be0cca

Browse files
jasowangBrian Maly
authored andcommitted
virtio: rename virtio_config_enabled to virtio_config_core_enabled
Following patch will allow the config interrupt to be disabled by a specific driver via another boolean. So this patch renames virtio_config_enabled and relevant helpers to virtio_config_core_enabled. Cc: Venkat Venkatsubra <[email protected]> Cc: Gia-Khanh Nguyen <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Jason Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 0cb70ee) Orabug: 36637822 Reviewed-by: Dongli Zhang <[email protected]> Signed-off-by: Venkat Venkatsubra <[email protected]> Signed-off-by: Brian Maly <[email protected]>
1 parent 6031681 commit 0be0cca

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

drivers/virtio/virtio.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void __virtio_config_changed(struct virtio_device *dev)
126126
{
127127
struct virtio_driver *drv = drv_to_virtio(dev->dev.driver);
128128

129-
if (!dev->config_enabled)
129+
if (!dev->config_core_enabled)
130130
dev->config_change_pending = true;
131131
else if (drv && drv->config_changed)
132132
drv->config_changed(dev);
@@ -142,17 +142,17 @@ void virtio_config_changed(struct virtio_device *dev)
142142
}
143143
EXPORT_SYMBOL_GPL(virtio_config_changed);
144144

145-
static void virtio_config_disable(struct virtio_device *dev)
145+
static void virtio_config_core_disable(struct virtio_device *dev)
146146
{
147147
spin_lock_irq(&dev->config_lock);
148-
dev->config_enabled = false;
148+
dev->config_core_enabled = false;
149149
spin_unlock_irq(&dev->config_lock);
150150
}
151151

152-
static void virtio_config_enable(struct virtio_device *dev)
152+
static void virtio_config_core_enable(struct virtio_device *dev)
153153
{
154154
spin_lock_irq(&dev->config_lock);
155-
dev->config_enabled = true;
155+
dev->config_core_enabled = true;
156156
if (dev->config_change_pending)
157157
__virtio_config_changed(dev);
158158
dev->config_change_pending = false;
@@ -281,7 +281,7 @@ static int virtio_dev_probe(struct device *_d)
281281
if (drv->scan)
282282
drv->scan(dev);
283283

284-
virtio_config_enable(dev);
284+
virtio_config_core_enable(dev);
285285

286286
return 0;
287287
err:
@@ -295,7 +295,7 @@ static void virtio_dev_remove(struct device *_d)
295295
struct virtio_device *dev = dev_to_virtio(_d);
296296
struct virtio_driver *drv = drv_to_virtio(dev->dev.driver);
297297

298-
virtio_config_disable(dev);
298+
virtio_config_core_disable(dev);
299299

300300
drv->remove(dev);
301301

@@ -403,7 +403,7 @@ int register_virtio_device(struct virtio_device *dev)
403403
goto out_ida_remove;
404404

405405
spin_lock_init(&dev->config_lock);
406-
dev->config_enabled = false;
406+
dev->config_core_enabled = false;
407407
dev->config_change_pending = false;
408408

409409
/* We always start by resetting the device, in case a previous
@@ -457,14 +457,14 @@ int virtio_device_freeze(struct virtio_device *dev)
457457
struct virtio_driver *drv = drv_to_virtio(dev->dev.driver);
458458
int ret;
459459

460-
virtio_config_disable(dev);
460+
virtio_config_core_disable(dev);
461461

462462
dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED;
463463

464464
if (drv && drv->freeze) {
465465
ret = drv->freeze(dev);
466466
if (ret) {
467-
virtio_config_enable(dev);
467+
virtio_config_core_enable(dev);
468468
return ret;
469469
}
470470
}
@@ -513,7 +513,7 @@ int virtio_device_restore(struct virtio_device *dev)
513513
/* Finally, tell the device we're all set */
514514
virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
515515

516-
virtio_config_enable(dev);
516+
virtio_config_core_enable(dev);
517517

518518
return 0;
519519

include/linux/virtio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq);
9595
* virtio_device - representation of a device using virtio
9696
* @index: unique position on the virtio bus
9797
* @failed: saved value for VIRTIO_CONFIG_S_FAILED bit (for restore)
98-
* @config_enabled: configuration change reporting enabled
98+
* @config_core_enabled: configuration change reporting enabled by core
9999
* @config_change_pending: configuration change reported while disabled
100100
* @config_lock: protects configuration change reporting
101101
* @dev: underlying device.
@@ -109,7 +109,7 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq);
109109
struct virtio_device {
110110
int index;
111111
bool failed;
112-
bool config_enabled;
112+
bool config_core_enabled;
113113
bool config_change_pending;
114114
spinlock_t config_lock;
115115
spinlock_t vqs_list_lock; /* Protects VQs list access */

0 commit comments

Comments
 (0)