search for: drv_to_virtio

Displaying 20 results from an estimated 124 matches for "drv_to_virtio".

Did you mean: dev_to_virtio
2014 Sep 22
0
[PATCH] virtio: refactor to use drv_to_virtio
Use drv_to_virtio instead of open-coding it. Fix whitespace damage introduced by virtio: unify config_changed handling Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Note: I'll probably smash this into the previous patch. drivers/virtio/virtio.c | 3 +-- 1 file changed, 1 insertion(+), 2 de...
2014 Oct 05
0
[PATCH 03/16] virtio: refactor to use drv_to_virtio
Use drv_to_virtio instead of open-coding it. Fix whitespace damage introduced by virtio: unify config_changed handling Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/virtio/virtio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/virtio/virtio.c b/driv...
2014 Sep 22
0
[PATCH] virtio: refactor to use drv_to_virtio
Use drv_to_virtio instead of open-coding it. Fix whitespace damage introduced by virtio: unify config_changed handling Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Note: I'll probably smash this into the previous patch. drivers/virtio/virtio.c | 3 +-- 1 file changed, 1 insertion(+), 2 de...
2012 Dec 05
12
[PATCH 1/3] virtio: change to_vp_device to an inlined definition
to_vp_device is worth changing to inlined definition. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- drivers/virtio/virtio_pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index e3ecc94..7681fe3 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -98,11 +98,7 @@
2012 Dec 05
12
[PATCH 1/3] virtio: change to_vp_device to an inlined definition
to_vp_device is worth changing to inlined definition. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- drivers/virtio/virtio_pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index e3ecc94..7681fe3 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -98,11 +98,7 @@
2014 Oct 05
0
[PATCH 05/16] virtio: defer config changed notifications
...irtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -117,6 +117,40 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, } EXPORT_SYMBOL_GPL(virtio_check_driver_offered_feature); +static void __virtio_config_changed(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + if (!dev->config_enabled) + dev->config_changed = true; + else if (drv && drv->config_changed) + drv->config_changed(dev); +} + +void virtio_config_changed(struct virtio_device *dev) +{ + spin_lock_irq(&dev->config_lock); + __virtio_config_chang...
2014 Oct 06
0
[PATCH v2 04/15] virtio: defer config changed notifications
...irtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -117,6 +117,42 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, } EXPORT_SYMBOL_GPL(virtio_check_driver_offered_feature); +static void __virtio_config_changed(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + if (!dev->config_enabled) + dev->config_changed = true; + else if (drv && drv->config_changed) + drv->config_changed(dev); +} + +void virtio_config_changed(struct virtio_device *dev) +{ + unsigned long flags; + + spin_lock_irqsave(&dev->config_l...
2014 Oct 13
1
[PATCH v4 04/25] virtio: defer config changed notifications
...irtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -117,6 +117,42 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, } EXPORT_SYMBOL_GPL(virtio_check_driver_offered_feature); +static void __virtio_config_changed(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + if (!dev->config_enabled) + dev->config_changed = true; + else if (drv && drv->config_changed) + drv->config_changed(dev); +} + +void virtio_config_changed(struct virtio_device *dev) +{ + unsigned long flags; + + spin_lock_irqsave(&dev->config_l...
2014 Oct 13
1
[PATCH v4 04/25] virtio: defer config changed notifications
...irtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -117,6 +117,42 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, } EXPORT_SYMBOL_GPL(virtio_check_driver_offered_feature); +static void __virtio_config_changed(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + if (!dev->config_enabled) + dev->config_changed = true; + else if (drv && drv->config_changed) + drv->config_changed(dev); +} + +void virtio_config_changed(struct virtio_device *dev) +{ + unsigned long flags; + + spin_lock_irqsave(&dev->config_l...
2023 Apr 30
1
[RFC PATCH net 1/3] virtio: re-negotiate features if probe fails and features are blocked
...rtio_reset_device(struct virtio_device *dev) } EXPORT_SYMBOL_GPL(virtio_reset_device); -static int virtio_dev_probe(struct device *_d) +static int virtio_negotiate_features(struct virtio_device *dev) { - int err, i; - struct virtio_device *dev = dev_to_virtio(_d); struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); u64 device_features; u64 driver_features; u64 driver_features_legacy; - - /* We have a driver! */ - virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER); + int i, ret; /* Figure out what features the device supports. */ device_features = dev->config->get_features(de...
2014 Oct 05
28
[PATCH 00/16] virtio: fix spec compliance issues
...included. 2 is merely a theoretical race condition, but it seems important to address to make sure that changes to address 3 do not introduce instability. Michael S. Tsirkin (16): virtio_pci: fix virtio spec compliance on restore virtio: unify config_changed handling virtio: refactor to use drv_to_virtio virtio-pci: move freeze/restore to virtio core virtio: defer config changed notifications virtio_blk: drop config_enable virtio-blk: drop config_mutex virtio_net: drop config_enable virtio-net: drop config_mutex virtio: add API to enable VQs early virtio_net: minor cleanup virtio_...
2014 Oct 05
28
[PATCH 00/16] virtio: fix spec compliance issues
...included. 2 is merely a theoretical race condition, but it seems important to address to make sure that changes to address 3 do not introduce instability. Michael S. Tsirkin (16): virtio_pci: fix virtio spec compliance on restore virtio: unify config_changed handling virtio: refactor to use drv_to_virtio virtio-pci: move freeze/restore to virtio core virtio: defer config changed notifications virtio_blk: drop config_enable virtio-blk: drop config_mutex virtio_net: drop config_enable virtio-net: drop config_mutex virtio: add API to enable VQs early virtio_net: minor cleanup virtio_...
2014 Oct 06
1
[PATCH 05/16] virtio: defer config changed notifications
...o/virtio.c > @@ -117,6 +117,40 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, > } > EXPORT_SYMBOL_GPL(virtio_check_driver_offered_feature); > > +static void __virtio_config_changed(struct virtio_device *dev) > +{ > + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); > + > + if (!dev->config_enabled) > + dev->config_changed = true; > + else if (drv && drv->config_changed) > + drv->config_changed(dev); > +} > + > +void virtio_config_changed(struct virtio_device *dev) > +{ > + spin_lock_irq(...
2014 Oct 06
1
[PATCH 05/16] virtio: defer config changed notifications
...o/virtio.c > @@ -117,6 +117,40 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, > } > EXPORT_SYMBOL_GPL(virtio_check_driver_offered_feature); > > +static void __virtio_config_changed(struct virtio_device *dev) > +{ > + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); > + > + if (!dev->config_enabled) > + dev->config_changed = true; > + else if (drv && drv->config_changed) > + drv->config_changed(dev); > +} > + > +void virtio_config_changed(struct virtio_device *dev) > +{ > + spin_lock_irq(...
2014 Oct 05
0
[PATCH 04/16] virtio-pci: move freeze/restore to virtio core
...100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -248,6 +248,59 @@ void virtio_config_changed(struct virtio_device *dev) } EXPORT_SYMBOL_GPL(virtio_config_changed); +#ifdef CONFIG_PM_SLEEP +int virtio_device_freeze(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED; + + if (drv && drv->freeze) + return drv->freeze(dev); + + return 0; +} +EXPORT_SYMBOL_GPL(virtio_device_freeze); + +int virtio_device_restore(struct virtio_device *dev) +{ + st...
2014 Oct 06
0
[PATCH v2 03/15] virtio-pci: move freeze/restore to virtio core
...100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -248,6 +248,59 @@ void virtio_config_changed(struct virtio_device *dev) } EXPORT_SYMBOL_GPL(virtio_config_changed); +#ifdef CONFIG_PM_SLEEP +int virtio_device_freeze(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED; + + if (drv && drv->freeze) + return drv->freeze(dev); + + return 0; +} +EXPORT_SYMBOL_GPL(virtio_device_freeze); + +int virtio_device_restore(struct virtio_device *dev) +{ + st...
2014 Oct 13
0
[PATCH v4 03/25] virtio-pci: move freeze/restore to virtio core
...100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -248,6 +248,60 @@ void virtio_config_changed(struct virtio_device *dev) } EXPORT_SYMBOL_GPL(virtio_config_changed); +#ifdef CONFIG_PM_SLEEP +int virtio_device_freeze(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED; + + if (drv && drv->freeze) + return drv->freeze(dev); + + return 0; +} +EXPORT_SYMBOL_GPL(virtio_device_freeze); + +int virtio_device_restore(struct virtio_device *dev) +{ + st...
2014 Oct 13
0
[PATCH v4 03/25] virtio-pci: move freeze/restore to virtio core
...100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -248,6 +248,60 @@ void virtio_config_changed(struct virtio_device *dev) } EXPORT_SYMBOL_GPL(virtio_config_changed); +#ifdef CONFIG_PM_SLEEP +int virtio_device_freeze(struct virtio_device *dev) +{ + struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); + + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED; + + if (drv && drv->freeze) + return drv->freeze(dev); + + return 0; +} +EXPORT_SYMBOL_GPL(virtio_device_freeze); + +int virtio_device_restore(struct virtio_device *dev) +{ + st...
2018 Apr 05
4
[RFC] virtio: Use DMA MAP API for devices without an IOMMU
...platform()) + return true; + if (!virtio_has_iommu_quirk(vdev)) return true; diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 988c7355bc22..d8bb83d753ea 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -200,6 +200,8 @@ static inline struct virtio_driver *drv_to_virtio(struct device_driver *drv) int register_virtio_driver(struct virtio_driver *drv); void unregister_virtio_driver(struct virtio_driver *drv); +extern bool is_virtio_dma_platform(void); + /* module_virtio_driver() - Helper macro for drivers that don't do * anything special in module init/ex...
2018 Apr 05
4
[RFC] virtio: Use DMA MAP API for devices without an IOMMU
...platform()) + return true; + if (!virtio_has_iommu_quirk(vdev)) return true; diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 988c7355bc22..d8bb83d753ea 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -200,6 +200,8 @@ static inline struct virtio_driver *drv_to_virtio(struct device_driver *drv) int register_virtio_driver(struct virtio_driver *drv); void unregister_virtio_driver(struct virtio_driver *drv); +extern bool is_virtio_dma_platform(void); + /* module_virtio_driver() - Helper macro for drivers that don't do * anything special in module init/ex...