mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Patrice Chotard <patrice.chotard@st.com>
To: Loic Pallardy <loic.pallardy@st.com>,
	<bjorn.andersson@linaro.org>, <ohad@wizery.com>
Cc: <linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel@stlinux.com>
Subject: Re: [STLinux Kernel] [PATCH 1/1] remoteproc: fix vdev reference management
Date: Wed, 4 Jan 2017 09:13:41 +0100	[thread overview]
Message-ID: <d83bd4e9-4282-3926-f3f3-7d197ccc1905@st.com> (raw)
In-Reply-To: <1481728260-21771-1-git-send-email-loic.pallardy@st.com>



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

      reply	other threads:[~2017-01-04  8:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 15:11 Loic Pallardy
2017-01-04  8:13 ` Patrice Chotard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d83bd4e9-4282-3926-f3f3-7d197ccc1905@st.com \
    --to=patrice.chotard@st.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=kernel@stlinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=ohad@wizery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®