search for: to_virtio_mmio_device

Displaying 20 results from an estimated 149 matches for "to_virtio_mmio_device".

2015 Mar 05
3
[PATCH] virtio_mmio: generation support
...tio_mmio.c index 0375456..69b2e4d 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -237,6 +237,16 @@ static void vm_set(struct virtio_device *vdev, unsigned offset, } } +static u32 vm_generation(struct virtio_device *vdev) +{ + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + + if (vm_dev->version == 1) + return 0; + else + return readl(vm_dev->base + VIRTIO_MMIO_CONFIG_GENERATION); +} + static u8 vm_get_status(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); @@ -503,6 +513,8 @@ static const char *vm_bus...
2015 Mar 05
3
[PATCH] virtio_mmio: generation support
...tio_mmio.c index 0375456..69b2e4d 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -237,6 +237,16 @@ static void vm_set(struct virtio_device *vdev, unsigned offset, } } +static u32 vm_generation(struct virtio_device *vdev) +{ + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + + if (vm_dev->version == 1) + return 0; + else + return readl(vm_dev->base + VIRTIO_MMIO_CONFIG_GENERATION); +} + static u8 vm_get_status(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); @@ -503,6 +513,8 @@ static const char *vm_bus...
2011 Oct 27
1
[PATCH v3] virtio: Add platform bus driver for memory mapped virtio device
On Mon, 2011-10-24 at 03:33 +0100, Rusty Russell wrote: > No, that's it I think. Please send a diff for the documentation, since > I'm updating the LyX master and I've already applied your previous > version. Here it goes (below). Also do you think you would be able to merge the driver (corresponding v4 patch follows) in the 3.2 merge window that seems to have just opened?
2011 Oct 27
1
[PATCH v3] virtio: Add platform bus driver for memory mapped virtio device
On Mon, 2011-10-24 at 03:33 +0100, Rusty Russell wrote: > No, that's it I think. Please send a diff for the documentation, since > I'm updating the LyX master and I've already applied your previous > version. Here it goes (below). Also do you think you would be able to merge the driver (corresponding v4 patch follows) in the 3.2 merge window that seems to have just opened?
2015 Mar 05
3
[PATCH] virtio_mmio: fix endian-ness for mmio
...tio_mmio.c b/drivers/virtio/virtio_mmio.c index cad5698..0375456 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -156,22 +156,85 @@ static void vm_get(struct virtio_device *vdev, unsigned offset, void *buf, unsigned len) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - u8 *ptr = buf; - int i; + void __iomem *base = vm_dev->base + VIRTIO_MMIO_CONFIG; + u8 b; + __le16 w; + __le32 l; - for (i = 0; i < len; i++) - ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i); + if (vm_dev->version == 1) { + u8 *ptr = buf; + int i; + + for...
2015 Mar 05
3
[PATCH] virtio_mmio: fix endian-ness for mmio
...tio_mmio.c b/drivers/virtio/virtio_mmio.c index cad5698..0375456 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -156,22 +156,85 @@ static void vm_get(struct virtio_device *vdev, unsigned offset, void *buf, unsigned len) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - u8 *ptr = buf; - int i; + void __iomem *base = vm_dev->base + VIRTIO_MMIO_CONFIG; + u8 b; + __le16 w; + __le32 l; - for (i = 0; i < len; i++) - ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i); + if (vm_dev->version == 1) { + u8 *ptr = buf; + int i; + + for...
2014 Nov 06
2
[RFC PATCH] virtio-mmio: support for multiple irqs
...3,98 @@ static void vm_del_vq(struct virtqueue *vq) >> kfree(info); >> } >> >> -static void vm_del_vqs(struct virtio_device *vdev) >> +static void vm_free_irqs(struct virtio_device *vdev) >> { >> + int i; >> struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); >> + >> + if (vm_dev->single_irq_enabled) { >> + free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev); >> + vm_dev->single_irq_enabled = 0; >> + } >> + >> + for (i = 0; i < vm_dev->used_irqs; ++i) >> + free_irq(platform_get_irq...
2014 Nov 06
2
[RFC PATCH] virtio-mmio: support for multiple irqs
...3,98 @@ static void vm_del_vq(struct virtqueue *vq) >> kfree(info); >> } >> >> -static void vm_del_vqs(struct virtio_device *vdev) >> +static void vm_free_irqs(struct virtio_device *vdev) >> { >> + int i; >> struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); >> + >> + if (vm_dev->single_irq_enabled) { >> + free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev); >> + vm_dev->single_irq_enabled = 0; >> + } >> + >> + for (i = 0; i < vm_dev->used_irqs; ++i) >> + free_irq(platform_get_irq...
2019 Jul 02
2
[PATCH] virtio-mmio: add error check for platform_get_irq
...ers/virtio/virtio_mmio.c index f363fbeb5ab0..60dde8ed163b 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -463,9 +463,14 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, struct irq_affinity *desc) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - unsigned int irq = platform_get_irq(vm_dev->pdev, 0); + int irq = platform_get_irq(vm_dev->pdev, 0); int i, err, queue_idx = 0; + if (irq < 0) { + dev_err(&vdev->dev, "no IRQ resource defined\n"); + return -ENODEV; + } + err = request_irq(irq, vm_interrupt...
2019 Jul 02
2
[PATCH] virtio-mmio: add error check for platform_get_irq
...ers/virtio/virtio_mmio.c index f363fbeb5ab0..60dde8ed163b 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -463,9 +463,14 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, struct irq_affinity *desc) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - unsigned int irq = platform_get_irq(vm_dev->pdev, 0); + int irq = platform_get_irq(vm_dev->pdev, 0); int i, err, queue_idx = 0; + if (irq < 0) { + dev_err(&vdev->dev, "no IRQ resource defined\n"); + return -ENODEV; + } + err = request_irq(irq, vm_interrupt...
2019 Jul 02
2
[PATCH v2] virtio-mmio: add error check for platform_get_irq
...ers/virtio/virtio_mmio.c index f363fbeb5ab0..e09edb5c5e06 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -463,9 +463,14 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, struct irq_affinity *desc) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - unsigned int irq = platform_get_irq(vm_dev->pdev, 0); + int irq = platform_get_irq(vm_dev->pdev, 0); int i, err, queue_idx = 0; + if (irq < 0) { + dev_err(&vdev->dev, "Cannot get IRQ resource\n"); + return irq; + } + err = request_irq(irq, vm_interrupt, IR...
2019 Jul 02
2
[PATCH v2] virtio-mmio: add error check for platform_get_irq
...ers/virtio/virtio_mmio.c index f363fbeb5ab0..e09edb5c5e06 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -463,9 +463,14 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, struct irq_affinity *desc) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - unsigned int irq = platform_get_irq(vm_dev->pdev, 0); + int irq = platform_get_irq(vm_dev->pdev, 0); int i, err, queue_idx = 0; + if (irq < 0) { + dev_err(&vdev->dev, "Cannot get IRQ resource\n"); + return irq; + } + err = request_irq(irq, vm_interrupt, IR...
2015 Mar 12
1
[PATCH v2 log fixed] virtio_mmio: fix endian-ness for mmio
...tio_mmio.c b/drivers/virtio/virtio_mmio.c index cad5698..0375456 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -156,22 +156,85 @@ static void vm_get(struct virtio_device *vdev, unsigned offset, void *buf, unsigned len) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - u8 *ptr = buf; - int i; + void __iomem *base = vm_dev->base + VIRTIO_MMIO_CONFIG; + u8 b; + __le16 w; + __le32 l; - for (i = 0; i < len; i++) - ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i); + if (vm_dev->version == 1) { + u8 *ptr = buf; + int i; + + for...
2015 Mar 12
1
[PATCH v2 log fixed] virtio_mmio: fix endian-ness for mmio
...tio_mmio.c b/drivers/virtio/virtio_mmio.c index cad5698..0375456 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -156,22 +156,85 @@ static void vm_get(struct virtio_device *vdev, unsigned offset, void *buf, unsigned len) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); - u8 *ptr = buf; - int i; + void __iomem *base = vm_dev->base + VIRTIO_MMIO_CONFIG; + u8 b; + __le16 w; + __le32 l; - for (i = 0; i < len; i++) - ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i); + if (vm_dev->version == 1) { + u8 *ptr = buf; + int i; + + for...
2014 Nov 06
0
[RFC PATCH] virtio-mmio: support for multiple irqs
...ret; > } > @@ -284,18 +313,98 @@ static void vm_del_vq(struct virtqueue *vq) > kfree(info); > } > > -static void vm_del_vqs(struct virtio_device *vdev) > +static void vm_free_irqs(struct virtio_device *vdev) > { > + int i; > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + > + if (vm_dev->single_irq_enabled) { > + free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev); > + vm_dev->single_irq_enabled = 0; > + } > + > + for (i = 0; i < vm_dev->used_irqs; ++i) > + free_irq(platform_get_irq(vm_dev->pdev, i), vm_dev); &...
2014 Nov 06
0
[RFC PATCH] virtio-mmio: support for multiple irqs
...tqueue *vq) > >> kfree(info); > >> } > >> > >> -static void vm_del_vqs(struct virtio_device *vdev) > >> +static void vm_free_irqs(struct virtio_device *vdev) > >> { > >> + int i; > >> struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > >> + > >> + if (vm_dev->single_irq_enabled) { > >> + free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev); > >> + vm_dev->single_irq_enabled = 0; > >> + } > >> + > >> + for (i = 0; i < vm_dev->used_irqs; ++i) &g...
2014 Nov 04
6
[RFC PATCH] virtio-mmio: support for multiple irqs
...eturn vm_vring_interrupt(irq, opaque); return ret; } @@ -284,18 +313,98 @@ static void vm_del_vq(struct virtqueue *vq) kfree(info); } -static void vm_del_vqs(struct virtio_device *vdev) +static void vm_free_irqs(struct virtio_device *vdev) { + int i; struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + + if (vm_dev->single_irq_enabled) { + free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev); + vm_dev->single_irq_enabled = 0; + } + + for (i = 0; i < vm_dev->used_irqs; ++i) + free_irq(platform_get_irq(vm_dev->pdev, i), vm_dev); + + vm_dev->num_irqs = 0; + vm_dev-&gt...
2014 Nov 04
6
[RFC PATCH] virtio-mmio: support for multiple irqs
...eturn vm_vring_interrupt(irq, opaque); return ret; } @@ -284,18 +313,98 @@ static void vm_del_vq(struct virtqueue *vq) kfree(info); } -static void vm_del_vqs(struct virtio_device *vdev) +static void vm_free_irqs(struct virtio_device *vdev) { + int i; struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + + if (vm_dev->single_irq_enabled) { + free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev); + vm_dev->single_irq_enabled = 0; + } + + for (i = 0; i < vm_dev->used_irqs; ++i) + free_irq(platform_get_irq(vm_dev->pdev, i), vm_dev); + + vm_dev->num_irqs = 0; + vm_dev-&gt...
2015 Mar 12
2
[PATCH] virtio_mmio: fix endian-ness for mmio
...5456 100644 > > --- a/drivers/virtio/virtio_mmio.c > > +++ b/drivers/virtio/virtio_mmio.c > > @@ -156,22 +156,85 @@ static void vm_get(struct virtio_device *vdev, unsigned offset, > > void *buf, unsigned len) > > { > > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > > - u8 *ptr = buf; > > - int i; > > + void __iomem *base = vm_dev->base + VIRTIO_MMIO_CONFIG; > > + u8 b; > > + __le16 w; > > + __le32 l; > > > > - for (i = 0; i < len; i++) > > - ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CO...
2015 Mar 12
2
[PATCH] virtio_mmio: fix endian-ness for mmio
...5456 100644 > > --- a/drivers/virtio/virtio_mmio.c > > +++ b/drivers/virtio/virtio_mmio.c > > @@ -156,22 +156,85 @@ static void vm_get(struct virtio_device *vdev, unsigned offset, > > void *buf, unsigned len) > > { > > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > > - u8 *ptr = buf; > > - int i; > > + void __iomem *base = vm_dev->base + VIRTIO_MMIO_CONFIG; > > + u8 b; > > + __le16 w; > > + __le32 l; > > > > - for (i = 0; i < len; i++) > > - ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CO...