search for: _vop_dev

Displaying 17 results from an estimated 17 matches for "_vop_dev".

Did you mean: _vop_vdev
2017 Dec 12
1
[PATCH 2/3] virtio: use put_device instead of kfree
...gt; + container_of(_d, struct virtio_device, dev); > + struct _vop_vdev *vop_vdev = > + container_of(vdev, struct _vop_vdev, vdev); > + > + kfree(vop_vdev); > } > > /* > @@ -501,7 +503,9 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, > dev_err(_vop_dev(vdev), > "Failed to register vop device %u type %u\n", > offset, type); > - goto free_irq; > + vpdev->hw_ops->free_irq(vpdev, vdev->virtio_cookie, vdev); > + put_device(&vdev->vdev.dev); > + return ret; > } > writeq((u64)vdev, &v...
2017 Dec 12
1
[PATCH 2/3] virtio: use put_device instead of kfree
...gt; + container_of(_d, struct virtio_device, dev); > + struct _vop_vdev *vop_vdev = > + container_of(vdev, struct _vop_vdev, vdev); > + > + kfree(vop_vdev); > } > > /* > @@ -501,7 +503,9 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, > dev_err(_vop_dev(vdev), > "Failed to register vop device %u type %u\n", > offset, type); > - goto free_irq; > + vpdev->hw_ops->free_irq(vpdev, vdev->virtio_cookie, vdev); > + put_device(&vdev->vdev.dev); > + return ret; > } > writeq((u64)vdev, &v...
2017 Dec 11
6
[PATCH 0/3] fix cleanup for fail to register_virtio_device
This series fix the cleanup for the caller of register_virtio_device, the main work is use put_device instead of kfree. weiping zhang (3): virtio_pci: use put_device instead of kfree virtio: use put_device instead of kfree virtio: put reference count of virtio_device.dev drivers/misc/mic/vop/vop_main.c | 16 +++++++++------- drivers/remoteproc/remoteproc_virtio.c | 2 +-
2017 Dec 11
6
[PATCH 0/3] fix cleanup for fail to register_virtio_device
This series fix the cleanup for the caller of register_virtio_device, the main work is use put_device instead of kfree. weiping zhang (3): virtio_pci: use put_device instead of kfree virtio: use put_device instead of kfree virtio: put reference count of virtio_device.dev drivers/misc/mic/vop/vop_main.c | 16 +++++++++------- drivers/remoteproc/remoteproc_virtio.c | 2 +-
2017 Dec 11
0
[PATCH 2/3] virtio: use put_device instead of kfree
...from core. - */ + struct virtio_device *vdev = + container_of(_d, struct virtio_device, dev); + struct _vop_vdev *vop_vdev = + container_of(vdev, struct _vop_vdev, vdev); + + kfree(vop_vdev); } /* @@ -501,7 +503,9 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, dev_err(_vop_dev(vdev), "Failed to register vop device %u type %u\n", offset, type); - goto free_irq; + vpdev->hw_ops->free_irq(vpdev, vdev->virtio_cookie, vdev); + put_device(&vdev->vdev.dev); + return ret; } writeq((u64)vdev, &vdev->dc->vdev); dev_dbg(_vop_dev...
2017 Dec 12
0
[PATCH v2 2/3] virtio: use put_device instead of kfree
...from core. - */ + struct virtio_device *vdev = + container_of(_d, struct virtio_device, dev); + struct _vop_vdev *vop_vdev = + container_of(vdev, struct _vop_vdev, vdev); + + kfree(vop_vdev); } /* @@ -501,7 +503,9 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, dev_err(_vop_dev(vdev), "Failed to register vop device %u type %u\n", offset, type); - goto free_irq; + vpdev->hw_ops->free_irq(vpdev, vdev->virtio_cookie, vdev); + put_device(&vdev->vdev.dev); + return ret; } writeq((u64)vdev, &vdev->dc->vdev); dev_dbg(_vop_dev...
2017 Dec 12
5
[PATCH v2 0/3] fix cleanup for fail to register_virtio_device
This series fix the cleanup for the caller of register_virtio_device, the main work is use put_device instead of kfree. V1->V2: * virtio_pci: add comments for the reason use put_device * virtio vop: also use put_device in in _vop_remove_device() weiping zhang (3): virtio_pci: use put_device instead of kfree virtio: use put_device instead of kfree virtio: put reference count of
2017 Dec 12
5
[PATCH v2 0/3] fix cleanup for fail to register_virtio_device
This series fix the cleanup for the caller of register_virtio_device, the main work is use put_device instead of kfree. V1->V2: * virtio_pci: add comments for the reason use put_device * virtio vop: also use put_device in in _vop_remove_device() weiping zhang (3): virtio_pci: use put_device instead of kfree virtio: use put_device instead of kfree virtio: put reference count of
2017 Dec 20
0
[PATCH v4 3/4] virtio_vop: don't kfree device on register failure
...L; int ret; u8 type = ioread8(&d->type); @@ -497,6 +499,7 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, vdev->c2h_vdev_db = ioread8(&vdev->dc->c2h_vdev_db); ret = register_virtio_device(&vdev->vdev); + reg_dev = vdev; if (ret) { dev_err(_vop_dev(vdev), "Failed to register vop device %u type %u\n", @@ -512,7 +515,10 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, free_irq: vpdev->hw_ops->free_irq(vpdev, vdev->virtio_cookie, vdev); kfree: - kfree(vdev); + if (reg_dev) + put_device(&vdev->vd...
2017 Dec 21
0
[PATCH v5 3/4] virtio_vop: don't kfree device on register failure
...L; int ret; u8 type = ioread8(&d->type); @@ -497,6 +499,7 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, vdev->c2h_vdev_db = ioread8(&vdev->dc->c2h_vdev_db); ret = register_virtio_device(&vdev->vdev); + reg_dev = vdev; if (ret) { dev_err(_vop_dev(vdev), "Failed to register vop device %u type %u\n", @@ -512,7 +515,10 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, free_irq: vpdev->hw_ops->free_irq(vpdev, vdev->virtio_cookie, vdev); kfree: - kfree(vdev); + if (reg_dev) + put_device(&vdev->vd...
2018 Dec 28
0
[PATCH v1 2/2] virtio: don't allocate vqs when names[i] = NULL
...= vdev->dc; - int i, err, retry; + int i, err, retry, queue_idx = 0; /* We must have this many virtqueues. */ if (nvqs > ioread8(&vdev->desc->num_vq)) return -ENOENT; for (i = 0; i < nvqs; ++i) { + if (!names[i]) { + vqs[i] = NULL; + continue; + } + dev_dbg(_vop_dev(vdev), "%s: %d: %s\n", __func__, i, names[i]); - vqs[i] = vop_find_vq(dev, i, callbacks[i], names[i], + vqs[i] = vop_find_vq(dev, queue_idx++, callbacks[i], names[i], ctx ? ctx[i] : false); if (IS_ERR(vqs[i])) { err = PTR_ERR(vqs[i]); diff --git a/drivers/remoteproc...
2017 Dec 20
8
[PATCH v4 0/4] use put_device to cleanup resource
Hi, The main change is split device_register into 2 sperate calls: device_initalize() and device_add, and then the caller can use put_device safety when fail to register_virtio_device. v3->v4: * split device_register into device_initialize and devicea_add that the caller can always use put_device when fail to register virtio device. v2->v3: * virtio: add new helper do get
2017 Dec 20
8
[PATCH v4 0/4] use put_device to cleanup resource
Hi, The main change is split device_register into 2 sperate calls: device_initalize() and device_add, and then the caller can use put_device safety when fail to register_virtio_device. v3->v4: * split device_register into device_initialize and devicea_add that the caller can always use put_device when fail to register virtio device. v2->v3: * virtio: add new helper do get
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...const char * const names[], const bool *ctx, + struct irq_affinity *desc) { struct _vop_vdev *vdev = to_vopvdev(dev); struct vop_device *vpdev = vdev->vpdev; @@ -388,7 +390,8 @@ static int vop_find_vqs(struct virtio_device *dev, unsigned nvqs, for (i = 0; i < nvqs; ++i) { dev_dbg(_vop_dev(vdev), "%s: %d: %s\n", __func__, i, names[i]); - vqs[i] = vop_find_vq(dev, i, callbacks[i], names[i]); + vqs[i] = vop_find_vq(dev, i, callbacks[i], names[i], + ctx ? ctx[i] : false); if (IS_ERR(vqs[i])) { err = PTR_ERR(vqs[i]); goto error; diff --git a/drivers/s39...
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...const char * const names[], const bool *ctx, + struct irq_affinity *desc) { struct _vop_vdev *vdev = to_vopvdev(dev); struct vop_device *vpdev = vdev->vpdev; @@ -388,7 +390,8 @@ static int vop_find_vqs(struct virtio_device *dev, unsigned nvqs, for (i = 0; i < nvqs; ++i) { dev_dbg(_vop_dev(vdev), "%s: %d: %s\n", __func__, i, names[i]); - vqs[i] = vop_find_vq(dev, i, callbacks[i], names[i]); + vqs[i] = vop_find_vq(dev, i, callbacks[i], names[i], + ctx ? ctx[i] : false); if (IS_ERR(vqs[i])) { err = PTR_ERR(vqs[i]); goto error; diff --git a/drivers/s39...
2018 Dec 28
11
[PATCH v1 0/2] Virtio: fix some vq allocation issues
Some vqs don't need to be allocated when the related feature bits are disabled. Callers notice the vq allocation layer by setting the related names[i] to be NULL. This patch series fixes the find_vqs implementations to handle this case. Wei Wang (2): virtio_pci: use queue idx instead of array idx to set up the vq virtio: don't allocate vqs when names[i] = NULL
2018 Dec 28
11
[PATCH v1 0/2] Virtio: fix some vq allocation issues
Some vqs don't need to be allocated when the related feature bits are disabled. Callers notice the vq allocation layer by setting the related names[i] to be NULL. This patch series fixes the find_vqs implementations to handle this case. Wei Wang (2): virtio_pci: use queue idx instead of array idx to set up the vq virtio: don't allocate vqs when names[i] = NULL