Displaying 20 results from an estimated 323 matches for "put_device".
Did you mean:
net_device
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 device's status then determine use
put_dev...
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 device's status then determine use
put_dev...
2017 Dec 17
6
[PATCH v3 0/5] proper cleanup if fail to register_virtio_device
Hi,
Patch1 add a helper to get virtio_device's status which will be used
later.
Patch2~4: check virtio_device's status is RTIO_CONFIG_S_ACKNOWLEDGE
or not, if so use put_device otherwise use kfree.
Patch5: add comments for virtio_register_device help caller do a
proper cleanup if got failure.
weiping zhang (5):
virtio: add helper virtio_get_status
virtio_pci: don't kfree device on register failure
virtio_vop: don't kfree device on register failure
virtio_...
2017 Dec 17
6
[PATCH v3 0/5] proper cleanup if fail to register_virtio_device
Hi,
Patch1 add a helper to get virtio_device's status which will be used
later.
Patch2~4: check virtio_device's status is RTIO_CONFIG_S_ACKNOWLEDGE
or not, if so use put_device otherwise use kfree.
Patch5: add comments for virtio_register_device help caller do a
proper cleanup if got failure.
weiping zhang (5):
virtio: add helper virtio_get_status
virtio_pci: don't kfree device on register failure
virtio_vop: don't kfree device on register failure
virtio_...
2017 Dec 21
0
[PATCH v5 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.
v4->v5:
* virtio: correct some comments
* virtio_remoteproc: use put_device directly, not use temp reg_dev
v3->v4:
* split device_register into device_initialize and devicea_add that
the caller can always use put_device when fail to register...
2017 Dec 14
4
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
On Tue, Dec 12, 2017 at 09:24:02PM +0800, weiping zhang wrote:
> 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 vp_dev until vp_dev->vdev.dev.release be called.
seeing as 5739411acbaa63a6c22c91e340fdcdbcc7d82a51 adding these
annotations went to stable, should this go there too?
> Signed-off-by:...
2017 Dec 14
4
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
On Tue, Dec 12, 2017 at 09:24:02PM +0800, weiping zhang wrote:
> 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 vp_dev until vp_dev->vdev.dev.release be called.
seeing as 5739411acbaa63a6c22c91e340fdcdbcc7d82a51 adding these
annotations went to stable, should this go there too?
> Signed-off-by:...
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 virtio_d...
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 virtio_d...
2017 Dec 19
1
[PATCH v3 5/5] virtio: add comments for virtio_register_device
On Sun, 17 Dec 2017 21:48:05 +0800
weiping zhang <zwp10758 at gmail.com> wrote:
> 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.
> */
> virtio_register_device may fail before/after call device_register, the
> caller should do a proper cleanup. Caller cann't use kfree directly,
> if virtio_register_device has already called device_register...
2017 Dec 19
1
[PATCH v3 5/5] virtio: add comments for virtio_register_device
On Sun, 17 Dec 2017 21:48:05 +0800
weiping zhang <zwp10758 at gmail.com> wrote:
> 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.
> */
> virtio_register_device may fail before/after call device_register, the
> caller should do a proper cleanup. Caller cann't use kfree directly,
> if virtio_register_device has already called device_register...
2017 Dec 20
1
[PATCH v4 4/4] virtio_remoteproc: don't kfree device on register failure
...*reg_dev = NULL;
> int ret;
>
> vdev->id.device = id,
> @@ -326,15 +326,24 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
> kref_get(&rvdev->refcount);
>
> ret = register_virtio_device(vdev);
> + reg_dev = vdev;
> if (ret) {
> - put_device(&rproc->dev);
> dev_err(dev, "failed to register vdev: %d\n", ret);
> goto out;
> }
>
> dev_info(dev, "registered %s (type %d)\n", dev_name(&vdev->dev), id);
>
> + return 0;
> +
> out:
> + if (reg_dev)
> + put_device...
2017 Dec 20
2
[PATCH v4 1/4] virtio: split device_register into device_initialize and device_add
...used a different mail address in your From: than in your s-o-b:;
same for the other patches]
> In order to make caller do a simple cleanup, we split device_register
> into device_initialize and device_add. device_initialize always sucess,
s/success/succeeds/
> the caller can always use put_device when fail to register virtio_device
"so the caller can always use put_device when register_virtio_device
failed,"
> no matter fail at ida_simple_get or at device_add.
"no matter whether it failed..."
>
> Signed-off-by: weiping zhang <zhangweiping at didichuxing....
2017 Dec 20
2
[PATCH v4 1/4] virtio: split device_register into device_initialize and device_add
...used a different mail address in your From: than in your s-o-b:;
same for the other patches]
> In order to make caller do a simple cleanup, we split device_register
> into device_initialize and device_add. device_initialize always sucess,
s/success/succeeds/
> the caller can always use put_device when fail to register virtio_device
"so the caller can always use put_device when register_virtio_device
failed,"
> no matter fail at ida_simple_get or at device_add.
"no matter whether it failed..."
>
> Signed-off-by: weiping zhang <zhangweiping at didichuxing....
2017 Dec 15
0
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
...in" <mst at redhat.com> wrote:
> On Tue, Dec 12, 2017 at 09:24:02PM +0800, weiping zhang wrote:
> > 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 vp_dev until vp_dev->vdev.dev.release be called.
>
> seeing as 5739411acbaa63a6c22c91e340fdcdbcc7d82a51 adding these
> annotations went to stable, should this go...
2017 Dec 21
2
[PATCH v5 4/4] virtio_remoteproc: correct put_device virtio_device.dev
...o.c b/drivers/remoteproc/remoteproc_virtio.c
index 2946348..b0633fd 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -327,7 +327,7 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
ret = register_virtio_device(vdev);
if (ret) {
- put_device(&rproc->dev);
+ put_device(&vdev->dev);
dev_err(dev, "failed to register vdev: %d\n", ret);
goto out;
}
--
2.9.4
2017 Dec 15
0
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
...Michael S. Tsirkin <mst at redhat.com>:
> On Tue, Dec 12, 2017 at 09:24:02PM +0800, weiping zhang wrote:
>> 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 vp_dev until vp_dev->vdev.dev.release be called.
>
> seeing as 5739411acbaa63a6c22c91e340fdcdbcc7d82a51 adding these
> annotations went to stable, should this go there...
2017 Dec 12
1
[PATCH 2/3] virtio: use put_device instead of kfree
...+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(vdev), "%s: registered vop device %u type %u vdev %p\n",
> @@ -509,8 +513,6 @@ static int _vop_add_device(struct mic_device_desc __iomem *d,
>
>...
2017 Dec 12
1
[PATCH 2/3] virtio: use put_device instead of kfree
...+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(vdev), "%s: registered vop device %u type %u vdev %p\n",
> @@ -509,8 +513,6 @@ static int _vop_add_device(struct mic_device_desc __iomem *d,
>
>...
2017 Dec 12
0
[PATCH v2 2/3] virtio: use put_device instead of kfree
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 vp_vdev until vp_vdev.dev.release be called.
Signed-off-by: weiping zhang <zhangweiping at didichuxing.com>
---
drivers/misc/mic/vop/vop_main.c | 18 ++++++++++--------
1 file changed, 10 insertions...