Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Navid Emamdoost
	<navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Mauro Carvalho Chehab
	<mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: emamd001-OJFnDUYgAso@public.gmane.org,
	wu000273-OJFnDUYgAso@public.gmane.org,
	kjlu-OJFnDUYgAso@public.gmane.org,
	smccaman-OJFnDUYgAso@public.gmane.org
Subject: Re: [PATCH] media: staging: tegra-vde: add missing pm_runtime_put_autosuspend
Date: Fri, 5 Jun 2020 17:05:46 +0300	[thread overview]
Message-ID: <b03670e5-2718-062e-0f53-d596434fe9a4@gmail.com> (raw)
In-Reply-To: <7061eb81-c00c-9978-5e4b-f9896c0ffd5e-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

05.06.2020 09:00, Jon Hunter пишет:
> 
> On 02/06/2020 06:48, Navid Emamdoost wrote:
>> Call to pm_runtime_get_sync increments counter even in case of
>> failure leading to incorrect ref count.
>> Call pm_runtime_put_autosuspend if pm_runtime_get_sync fails.
>>
>> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  drivers/staging/media/tegra-vde/vde.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
>> index d3e63512a765..52cdd4a91e93 100644
>> --- a/drivers/staging/media/tegra-vde/vde.c
>> +++ b/drivers/staging/media/tegra-vde/vde.c
>> @@ -776,8 +776,10 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde,
>>  		goto release_dpb_frames;
>>  
>>  	ret = pm_runtime_get_sync(dev);
>> -	if (ret < 0)
>> +	if (ret < 0) {
>> +		pm_runtime_put_autosuspend(dev);
>>  		goto unlock;
>> +	}
>>  
>>  	/*
>>  	 * We rely on the VDE registers reset value, otherwise VDE
> 
> Please use the put in the error path.

This is a third version of the patch [1][2].

[1]
https://patchwork.ozlabs.org/project/linux-tegra/patch/20200514210847.9269-2-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org/
[2]
https://patchwork.ozlabs.org/project/linux-tegra/patch/20200520095148.10995-1-dinghao.liu-Y5EWUtBUdg4nDS1+zs4M5A@public.gmane.org/

I'd prefer to stick with my variant of the patch [1] because in my
opinion it's most straightforward variant and I actually tested that it
works properly.

Navid, anyways thank you for the patch. Next time please check if
somebody else already sent similar patches before you.

  parent reply	other threads:[~2020-06-05 14:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  5:48 [PATCH] media: staging: tegra-vde: add missing pm_runtime_put_autosuspend Navid Emamdoost
     [not found] ` <20200602054841.15746-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-05  6:00   ` Jon Hunter
     [not found]     ` <7061eb81-c00c-9978-5e4b-f9896c0ffd5e-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-06-05 14:05       ` Dmitry Osipenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-02 10:23 Markus Elfring

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=b03670e5-2718-062e-0f53-d596434fe9a4@gmail.com \
    --to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
    --cc=emamd001-OJFnDUYgAso@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=kjlu-OJFnDUYgAso@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=smccaman-OJFnDUYgAso@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=wu000273-OJFnDUYgAso@public.gmane.org \
    /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