* [PATCH 1/1] remoteproc: fix vdev reference management
@ 2016-12-14 15:11 ` Loic Pallardy
0 siblings, 0 replies; 4+ messages in thread
From: Loic Pallardy @ 2016-12-14 15:11 UTC (permalink / raw)
To: bjorn.andersson, ohad
Cc: lee.jones, loic.pallardy, linux-remoteproc, linux-kernel, kernel
Commit 2b45cef5868a ("remoteproc: Further extend the vdev life cycle")
extends kref support for vdev management.
It introduces a regression when following sequence is executed:
rproc_boot --> rproc_shutdown --> rproc_boot
Second rproc_boot call crashes on register_virtio_device as device
is already existing.
Issue is previous vdev is never released when rproc is stop because
associated refcount is too high.
kref_get introduces is not needed as kref_init already initializes
krefcount to 1 because it considers associated variable as used.
This introduces a misalignment between kref_get and kref_put calls.
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
---
drivers/remoteproc/remoteproc_core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 9a507e7..feb24c4 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -396,9 +396,6 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
goto unwind_vring_allocations;
}
- /* track the rvdevs list reference */
- kref_get(&rvdev->refcount);
-
list_add_tail(&rvdev->node, &rproc->rvdevs);
rproc_add_subdev(rproc, &rvdev->subdev,
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 1/1] remoteproc: fix vdev reference management
@ 2016-12-14 15:11 ` Loic Pallardy
0 siblings, 0 replies; 4+ messages in thread
From: Loic Pallardy @ 2016-12-14 15:11 UTC (permalink / raw)
To: bjorn.andersson, ohad
Cc: lee.jones, loic.pallardy, linux-remoteproc, linux-kernel, kernel
Commit 2b45cef5868a ("remoteproc: Further extend the vdev life cycle")
extends kref support for vdev management.
It introduces a regression when following sequence is executed:
rproc_boot --> rproc_shutdown --> rproc_boot
Second rproc_boot call crashes on register_virtio_device as device
is already existing.
Issue is previous vdev is never released when rproc is stop because
associated refcount is too high.
kref_get introduces is not needed as kref_init already initializes
krefcount to 1 because it considers associated variable as used.
This introduces a misalignment between kref_get and kref_put calls.
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
---
drivers/remoteproc/remoteproc_core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 9a507e7..feb24c4 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -396,9 +396,6 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
goto unwind_vring_allocations;
}
- /* track the rvdevs list reference */
- kref_get(&rvdev->refcount);
-
list_add_tail(&rvdev->node, &rproc->rvdevs);
rproc_add_subdev(rproc, &rvdev->subdev,
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [STLinux Kernel] [PATCH 1/1] remoteproc: fix vdev reference management
2016-12-14 15:11 ` Loic Pallardy
@ 2017-01-04 8:13 ` Patrice Chotard
-1 siblings, 0 replies; 4+ messages in thread
From: Patrice Chotard @ 2017-01-04 8:13 UTC (permalink / raw)
To: Loic Pallardy, bjorn.andersson, ohad
Cc: linux-remoteproc, linux-kernel, kernel
On 12/14/2016 04:11 PM, Loic Pallardy wrote:
> Commit 2b45cef5868a ("remoteproc: Further extend the vdev life cycle")
> extends kref support for vdev management.
> It introduces a regression when following sequence is executed:
> rproc_boot --> rproc_shutdown --> rproc_boot
> Second rproc_boot call crashes on register_virtio_device as device
> is already existing.
> Issue is previous vdev is never released when rproc is stop because
> associated refcount is too high.
>
> kref_get introduces is not needed as kref_init already initializes
> krefcount to 1 because it considers associated variable as used.
> This introduces a misalignment between kref_get and kref_put calls.
>
> Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
> ---
> drivers/remoteproc/remoteproc_core.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 9a507e7..feb24c4 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -396,9 +396,6 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
> goto unwind_vring_allocations;
> }
>
> - /* track the rvdevs list reference */
> - kref_get(&rvdev->refcount);
> -
> list_add_tail(&rvdev->node, &rproc->rvdevs);
>
> rproc_add_subdev(rproc, &rvdev->subdev,
>
Hi Loic
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Patrice
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [STLinux Kernel] [PATCH 1/1] remoteproc: fix vdev reference management
@ 2017-01-04 8:13 ` Patrice Chotard
0 siblings, 0 replies; 4+ messages in thread
From: Patrice Chotard @ 2017-01-04 8:13 UTC (permalink / raw)
To: Loic Pallardy, bjorn.andersson, ohad
Cc: linux-remoteproc, linux-kernel, kernel
On 12/14/2016 04:11 PM, Loic Pallardy wrote:
> Commit 2b45cef5868a ("remoteproc: Further extend the vdev life cycle")
> extends kref support for vdev management.
> It introduces a regression when following sequence is executed:
> rproc_boot --> rproc_shutdown --> rproc_boot
> Second rproc_boot call crashes on register_virtio_device as device
> is already existing.
> Issue is previous vdev is never released when rproc is stop because
> associated refcount is too high.
>
> kref_get introduces is not needed as kref_init already initializes
> krefcount to 1 because it considers associated variable as used.
> This introduces a misalignment between kref_get and kref_put calls.
>
> Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
> ---
> drivers/remoteproc/remoteproc_core.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 9a507e7..feb24c4 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -396,9 +396,6 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
> goto unwind_vring_allocations;
> }
>
> - /* track the rvdevs list reference */
> - kref_get(&rvdev->refcount);
> -
> list_add_tail(&rvdev->node, &rproc->rvdevs);
>
> rproc_add_subdev(rproc, &rvdev->subdev,
>
Hi Loic
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Patrice
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-04 8:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-14 15:11 [PATCH 1/1] remoteproc: fix vdev reference management Loic Pallardy
2016-12-14 15:11 ` Loic Pallardy
2017-01-04 8:13 ` [STLinux Kernel] " Patrice Chotard
2017-01-04 8:13 ` Patrice Chotard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.