search for: virtio_bus

Displaying 20 results from an estimated 84 matches for "virtio_bus".

2015 Mar 11
2
[PATCH] virtio: Remove virtio device during shutdown
...) +{ + struct virtio_device *dev = dev_to_virtio(_d); + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + virtio_config_disable(dev); + + drv->remove(dev); + + /* Driver should have reset device. */ + WARN_ON_ONCE(dev->config->get_status(dev)); +} + static struct bus_type virtio_bus = { .name = "virtio", .match = virtio_dev_match, @@ -276,6 +289,7 @@ static struct bus_type virtio_bus = { .uevent = virtio_uevent, .probe = virtio_dev_probe, .remove = virtio_dev_remove, + .shutdown = virtio_dev_shutdown, }; bool virtio_device_is_legacy_only(struct virtio_...
2015 Mar 11
2
[PATCH] virtio: Remove virtio device during shutdown
...) +{ + struct virtio_device *dev = dev_to_virtio(_d); + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + virtio_config_disable(dev); + + drv->remove(dev); + + /* Driver should have reset device. */ + WARN_ON_ONCE(dev->config->get_status(dev)); +} + static struct bus_type virtio_bus = { .name = "virtio", .match = virtio_dev_match, @@ -276,6 +289,7 @@ static struct bus_type virtio_bus = { .uevent = virtio_uevent, .probe = virtio_dev_probe, .remove = virtio_dev_remove, + .shutdown = virtio_dev_shutdown, }; bool virtio_device_is_legacy_only(struct virtio_...
2007 Sep 24
3
[PATCH 0/3] virtio implementation (draft VI)
I'm not reposting the drivers this time since they haven't changed significantly. See http://lguest.ozlabs.org/patches for the whole thing, from new-io.patch onwards). Changes since last version: - Switch to our own bus implementation, rather than relying on an implementation-specific bus to back this up. - Make virtio_config_ops much higher-level, don't assume layout of
2007 Sep 24
3
[PATCH 0/3] virtio implementation (draft VI)
I'm not reposting the drivers this time since they haven't changed significantly. See http://lguest.ozlabs.org/patches for the whole thing, from new-io.patch onwards). Changes since last version: - Switch to our own bus implementation, rather than relying on an implementation-specific bus to back this up. - Make virtio_config_ops much higher-level, don't assume layout of
2015 Mar 11
3
[PATCH] virtio: Remove virtio device during shutdown
...; +{ > + struct virtio_device *dev = dev_to_virtio(_d); > + /* > + * Reset the device to make it stop sending interrupts, DMA, etc. > + * We are shutting down, no need for full cleanup. > + */ > + dev->config->reset(dev); > + > +} > + > static struct bus_type virtio_bus = { > .name = "virtio", > .match = virtio_dev_match, > @@ -276,6 +288,7 @@ static struct bus_type virtio_bus = { > .uevent = virtio_uevent, > .probe = virtio_dev_probe, > .remove = virtio_dev_remove, > + .shutdown = virtio_dev_shutdown, > }; > >...
2015 Mar 11
3
[PATCH] virtio: Remove virtio device during shutdown
...; +{ > + struct virtio_device *dev = dev_to_virtio(_d); > + /* > + * Reset the device to make it stop sending interrupts, DMA, etc. > + * We are shutting down, no need for full cleanup. > + */ > + dev->config->reset(dev); > + > +} > + > static struct bus_type virtio_bus = { > .name = "virtio", > .match = virtio_dev_match, > @@ -276,6 +288,7 @@ static struct bus_type virtio_bus = { > .uevent = virtio_uevent, > .probe = virtio_dev_probe, > .remove = virtio_dev_remove, > + .shutdown = virtio_dev_shutdown, > }; > >...
2015 Mar 11
0
[PATCH] virtio: Remove virtio device during shutdown
...+static void virtio_dev_shutdown(struct device *_d) +{ + struct virtio_device *dev = dev_to_virtio(_d); + /* + * Reset the device to make it stop sending interrupts, DMA, etc. + * We are shutting down, no need for full cleanup. + */ + dev->config->reset(dev); + +} + static struct bus_type virtio_bus = { .name = "virtio", .match = virtio_dev_match, @@ -276,6 +288,7 @@ static struct bus_type virtio_bus = { .uevent = virtio_uevent, .probe = virtio_dev_probe, .remove = virtio_dev_remove, + .shutdown = virtio_dev_shutdown, }; bool virtio_device_is_legacy_only(struct virtio_...
2015 Mar 11
0
[PATCH] virtio: Remove virtio device during shutdown
...+static void virtio_dev_shutdown(struct device *_d) +{ + struct virtio_device *dev = dev_to_virtio(_d); + /* + * Reset the device to make it stop sending interrupts, DMA, etc. + * We are shutting down, no need for full cleanup. + */ + dev->config->reset(dev); + +} + static struct bus_type virtio_bus = { .name = "virtio", .match = virtio_dev_match, @@ -276,6 +288,7 @@ static struct bus_type virtio_bus = { .uevent = virtio_uevent, .probe = virtio_dev_probe, .remove = virtio_dev_remove, + .shutdown = virtio_dev_shutdown, }; bool virtio_device_is_legacy_only(struct virtio_...
2015 Mar 12
0
[PATCH] virtio: Remove virtio device during shutdown
...o_virtio(_d); > > + /* > > + * Reset the device to make it stop sending interrupts, DMA, etc. > > + * We are shutting down, no need for full cleanup. > > + */ > > + dev->config->reset(dev); > > + > > +} > > + > > static struct bus_type virtio_bus = { > > .name = "virtio", > > .match = virtio_dev_match, > > @@ -276,6 +288,7 @@ static struct bus_type virtio_bus = { > > .uevent = virtio_uevent, > > .probe = virtio_dev_probe, > > .remove = virtio_dev_remove, > > + .shutdown = virtio...
2015 Mar 12
0
[PATCH] virtio: Remove virtio device during shutdown
...o_virtio(_d); > > + /* > > + * Reset the device to make it stop sending interrupts, DMA, etc. > > + * We are shutting down, no need for full cleanup. > > + */ > > + dev->config->reset(dev); > > + > > +} > > + > > static struct bus_type virtio_bus = { > > .name = "virtio", > > .match = virtio_dev_match, > > @@ -276,6 +288,7 @@ static struct bus_type virtio_bus = { > > .uevent = virtio_uevent, > > .probe = virtio_dev_probe, > > .remove = virtio_dev_remove, > > + .shutdown = virtio...
2012 May 03
1
[PATCH 2/2] virtio: Use ida to allocate virtio index
...umbering for virtio devices. */ -static unsigned int dev_index; +static DEFINE_IDA(virtio_index_ida); static ssize_t device_show(struct device *_d, struct device_attribute *attr, char *buf) @@ -193,7 +194,11 @@ int register_virtio_device(struct virtio_device *dev) dev->dev.bus = &virtio_bus; /* Assign a unique device index and hence name. */ - dev->index = dev_index++; + err = ida_simple_get(&virtio_index_ida, 0, 0, GFP_KERNEL); + if (err < 0) + goto out; + + dev->index = err; dev_set_name(&dev->dev, "virtio%u", dev->index); /* We always sta...
2012 May 03
1
[PATCH 2/2] virtio: Use ida to allocate virtio index
...umbering for virtio devices. */ -static unsigned int dev_index; +static DEFINE_IDA(virtio_index_ida); static ssize_t device_show(struct device *_d, struct device_attribute *attr, char *buf) @@ -193,7 +194,11 @@ int register_virtio_device(struct virtio_device *dev) dev->dev.bus = &virtio_bus; /* Assign a unique device index and hence name. */ - dev->index = dev_index++; + err = ida_simple_get(&virtio_index_ida, 0, 0, GFP_KERNEL); + if (err < 0) + goto out; + + dev->index = err; dev_set_name(&dev->dev, "virtio%u", dev->index); /* We always sta...
2015 Sep 17
7
[PATCH 0/2] Fix memory leaks in virtio & remoteproc cores
Hi, The following patches fix couple of memory leaks in the virtio and remoteproc cores when using these as modules, and going through a cycle of insmod and rmmod with at least a device registered with the corresponding cores in between. I ran into this on our downstream product kernels on both 3.14 and 4.1 based kernels, and should apply to the latest kernel as well. Patches can be picked up
2015 Sep 17
7
[PATCH 0/2] Fix memory leaks in virtio & remoteproc cores
Hi, The following patches fix couple of memory leaks in the virtio and remoteproc cores when using these as modules, and going through a cycle of insmod and rmmod with at least a device registered with the corresponding cores in between. I ran into this on our downstream product kernels on both 3.14 and 4.1 based kernels, and should apply to the latest kernel as well. Patches can be picked up
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
...rtio_device, but instead there are devices that have an arbitrary number of virtqueue structures. I'd still like to discuss my approach to see if there is reason to continue down that road, so I'm posting what I have right now. I think among the options we have to go on are: 1. screw the virtio_bus, and let every host do its own stuff -- no autoloading, standalone drivers, chardev host etc. 2. get virtio_device back from the dead, and allow it to have multiple virtqueues, either two or an unlimited number. 3. screw the multiple-virtqueue idea, go back to the draft III stuff with my changes....
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
...rtio_device, but instead there are devices that have an arbitrary number of virtqueue structures. I'd still like to discuss my approach to see if there is reason to continue down that road, so I'm posting what I have right now. I think among the options we have to go on are: 1. screw the virtio_bus, and let every host do its own stuff -- no autoloading, standalone drivers, chardev host etc. 2. get virtio_device back from the dead, and allow it to have multiple virtqueues, either two or an unlimited number. 3. screw the multiple-virtqueue idea, go back to the draft III stuff with my changes....
2014 Sep 22
1
[PATCH] virtio: unify config_changed handling
...ev) +{ + struct virtio_driver *drv = container_of(dev->dev.driver, + struct virtio_driver, driver); + + if (drv && drv->config_changed) + drv->config_changed(dev); +} +EXPORT_SYMBOL_GPL(virtio_config_changed); + static int virtio_init(void) { if (bus_register(&virtio_bus) != 0) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index c600ccf..ef9a165 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -234,8 +234,6 @@ static irqreturn_t vm_interrupt(int irq, void *opaque) { struct virtio_mmio_device *vm_dev = opa...
2014 Sep 22
1
[PATCH] virtio: unify config_changed handling
...ev) +{ + struct virtio_driver *drv = container_of(dev->dev.driver, + struct virtio_driver, driver); + + if (drv && drv->config_changed) + drv->config_changed(dev); +} +EXPORT_SYMBOL_GPL(virtio_config_changed); + static int virtio_init(void) { if (bus_register(&virtio_bus) != 0) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index c600ccf..ef9a165 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -234,8 +234,6 @@ static irqreturn_t vm_interrupt(int irq, void *opaque) { struct virtio_mmio_device *vm_dev = opa...
2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...--- a/drivers/virtio/virtio.c > +++ b/drivers/virtio/virtio.c > @@ -357,6 +357,12 @@ int register_virtio_device(struct virtio_device *dev) > } > EXPORT_SYMBOL_GPL(register_virtio_device); > > +bool is_virtio_device(struct device *dev) > +{ > + return dev->bus == &virtio_bus; > +} > +EXPORT_SYMBOL_GPL(is_virtio_device); > + > void unregister_virtio_device(struct virtio_device *dev) > { > int index = dev->index; /* save for after device release */ > diff --git a/drivers/virtio/virtio_dma_buf.c b/drivers/virtio/virtio_dma_buf.c > new file m...
2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...--- a/drivers/virtio/virtio.c > +++ b/drivers/virtio/virtio.c > @@ -357,6 +357,12 @@ int register_virtio_device(struct virtio_device *dev) > } > EXPORT_SYMBOL_GPL(register_virtio_device); > > +bool is_virtio_device(struct device *dev) > +{ > + return dev->bus == &virtio_bus; > +} > +EXPORT_SYMBOL_GPL(is_virtio_device); > + > void unregister_virtio_device(struct virtio_device *dev) > { > int index = dev->index; /* save for after device release */ > diff --git a/drivers/virtio/virtio_dma_buf.c b/drivers/virtio/virtio_dma_buf.c > new file m...