search for: vm_dev

Displaying 20 results from an estimated 312 matches for "vm_dev".

2014 Nov 06
2
[RFC PATCH] virtio-mmio: support for multiple irqs
...es vm_try_to_find_vqs to check whether it can get multiple IRQs like virtio-pci uses vp_try_to_find_vqs. And within function vm_request_multiple_irqs, guest check whether the number of IRQs host device gives is equal to the number we want. for (i = 0; i < nirqs; i++) { irq = platform_get_irq(vm_dev->pdev, i); if (irq == -ENXIO) goto error; } If we can't get the expected number of IRQs, return error and this try fails. Then guest will try two IRQS and single IRQ like virtio-pci. > Could you please document the new interface? > E.g. send a patch for virtio spec. Ok, I'...
2014 Nov 06
2
[RFC PATCH] virtio-mmio: support for multiple irqs
...es vm_try_to_find_vqs to check whether it can get multiple IRQs like virtio-pci uses vp_try_to_find_vqs. And within function vm_request_multiple_irqs, guest check whether the number of IRQs host device gives is equal to the number we want. for (i = 0; i < nirqs; i++) { irq = platform_get_irq(vm_dev->pdev, i); if (irq == -ENXIO) goto error; } If we can't get the expected number of IRQs, return error and this try fails. Then guest will try two IRQS and single IRQ like virtio-pci. > Could you please document the new interface? > E.g. send a patch for virtio spec. Ok, I'...
2015 Jan 20
4
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...* * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007 * * This work is licensed under the terms of the GNU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_...
2015 Jan 20
4
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...* * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007 * * This work is licensed under the terms of the GNU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_...
2014 Nov 06
0
[RFC PATCH] virtio-mmio: support for multiple irqs
...vq_info { > @@ -229,33 +238,53 @@ static bool vm_notify(struct virtqueue *vq) > return true; > } > > +/* Handle a configuration change: Tell driver if it wants to know. */ > +static irqreturn_t vm_config_changed(int irq, void *opaque) > +{ > + struct virtio_mmio_device *vm_dev = opaque; > + struct virtio_driver *vdrv = container_of(vm_dev->vdev.dev.driver, > + struct virtio_driver, driver); > + > + if (vdrv && vdrv->config_changed) > + vdrv->config_changed(&vm_dev->vdev); > + return IRQ_HANDLED; > +} > + > /* Notify a...
2014 Dec 19
5
[RFC] virtio-mmio: Update the device to OASIS spec version
...* * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007 * * This work is licensed under the terms of the GNU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_...
2014 Dec 19
5
[RFC] virtio-mmio: Update the device to OASIS spec version
...* * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007 * * This work is licensed under the terms of the GNU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_...
2014 Nov 06
0
[RFC PATCH] virtio-mmio: support for multiple irqs
...ltiple_irqs, guest check whether the number of IRQs host > device gives is equal to the number we want. OK but how does host specify the number of IRQs for a device? for pci this is done through the MSI-X capability register. > for (i = 0; i < nirqs; i++) { > irq = platform_get_irq(vm_dev->pdev, i); > if (irq == -ENXIO) > goto error; > } > > If we can't get the expected number of IRQs, return error and this try > fails. Then guest will try two IRQS and single IRQ like virtio-pci. > > > Could you please document the new interface? > > E...
2014 Nov 04
6
[RFC PATCH] virtio-mmio: support for multiple irqs
..._names)[256]; }; struct virtio_mmio_vq_info { @@ -229,33 +238,53 @@ static bool vm_notify(struct virtqueue *vq) return true; } +/* Handle a configuration change: Tell driver if it wants to know. */ +static irqreturn_t vm_config_changed(int irq, void *opaque) +{ + struct virtio_mmio_device *vm_dev = opaque; + struct virtio_driver *vdrv = container_of(vm_dev->vdev.dev.driver, + struct virtio_driver, driver); + + if (vdrv && vdrv->config_changed) + vdrv->config_changed(&vm_dev->vdev); + return IRQ_HANDLED; +} + /* Notify all virtqueues on an interrupt. */ -static irq...
2014 Nov 04
6
[RFC PATCH] virtio-mmio: support for multiple irqs
..._names)[256]; }; struct virtio_mmio_vq_info { @@ -229,33 +238,53 @@ static bool vm_notify(struct virtqueue *vq) return true; } +/* Handle a configuration change: Tell driver if it wants to know. */ +static irqreturn_t vm_config_changed(int irq, void *opaque) +{ + struct virtio_mmio_device *vm_dev = opaque; + struct virtio_driver *vdrv = container_of(vm_dev->vdev.dev.driver, + struct virtio_driver, driver); + + if (vdrv && vdrv->config_changed) + vdrv->config_changed(&vm_dev->vdev); + return IRQ_HANDLED; +} + /* Notify all virtqueues on an interrupt. */ -static irq...
2017 Dec 01
2
[PATCH] virtio_mmio: add cleanup for virtio_mmio_probe
...ions(+), 8 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 74dc717..3fd0e66 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -513,8 +513,10 @@ static int virtio_mmio_probe(struct platform_device *pdev) return -EBUSY; vm_dev = devm_kzalloc(&pdev->dev, sizeof(*vm_dev), GFP_KERNEL); - if (!vm_dev) - return -ENOMEM; + if (!vm_dev) { + rc = -ENOMEM; + goto free_mem; + } vm_dev->vdev.dev.parent = &pdev->dev; vm_dev->vdev.dev.release = virtio_mmio_release_dev_empty; @@ -524,14 +526,17 @@ static...
2017 Dec 01
2
[PATCH] virtio_mmio: add cleanup for virtio_mmio_probe
...ions(+), 8 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 74dc717..3fd0e66 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -513,8 +513,10 @@ static int virtio_mmio_probe(struct platform_device *pdev) return -EBUSY; vm_dev = devm_kzalloc(&pdev->dev, sizeof(*vm_dev), GFP_KERNEL); - if (!vm_dev) - return -ENOMEM; + if (!vm_dev) { + rc = -ENOMEM; + goto free_mem; + } vm_dev->vdev.dev.parent = &pdev->dev; vm_dev->vdev.dev.release = virtio_mmio_release_dev_empty; @@ -524,14 +526,17 @@ static...
2015 Jan 20
0
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...ver by Anthony Liguori, copyright IBM Corp. 2007 > * > * This work is licensed under the terms of the GNU GPL, version 2 or later. > @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_d...
2015 Jan 20
0
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...ver by Anthony Liguori, copyright IBM Corp. 2007 > * > * This work is licensed under the terms of the GNU GPL, version 2 or later. > @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_d...
2017 Dec 06
0
[PATCH v3 1/2] virtio_mmio: add cleanup for virtio_mmio_probe
As mentioned at drivers/base/core.c: /* * NOTE: _Never_ directly free @dev after calling this function, even * if it returned an error! Always use put_device() to give up the * reference initialized in this function instead. */ so we don't free vm_dev until vm_dev.dev.release be called. Signed-off-by: weiping zhang <zhangweiping at didichuxing.com> --- drivers/virtio/virtio_mmio.c | 51 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virti...
2015 Jan 20
1
[PATCH] virtio-mmio: Update the device to OASIS spec version
...* * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007 * * This work is licensed under the terms of the GNU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<=...
2015 Jan 20
1
[PATCH] virtio-mmio: Update the device to OASIS spec version
...* * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007 * * This work is licensed under the terms of the GNU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<=...
2015 Jan 15
0
[RFC] virtio-mmio: Update the device to OASIS spec version
...ver by Anthony Liguori, copyright IBM Corp. 2007 > * > * This work is licensed under the terms of the GNU GPL, version 2 or later. > @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_d...
2015 Jan 15
0
[RFC] virtio-mmio: Update the device to OASIS spec version
...ver by Anthony Liguori, copyright IBM Corp. 2007 > * > * This work is licensed under the terms of the GNU GPL, version 2 or later. > @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_d...
2017 Dec 06
4
[PATCH v3 0/2] Add cleanup for virtio_mmio driver
this patchset try to add cleanup for virtio_mmio driver, include virtio_mmio_probe and virtio_mmio_remove weiping zhang (2): virtio_mmio: add cleanup for virtio_mmio_probe virtio_mmio: add cleanup for virtio_mmio_remove drivers/virtio/virtio_mmio.c | 57 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 10 deletions(-) -- 2.9.4