mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: dinghao.liu@zju.edu.cn
Cc: kjlu@umn.edu, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [v2] media: venus: core: Fix runtime PM imbalance in venus_probe
Date: Sat, 27 Jun 2020 00:01:55 +0300	[thread overview]
Message-ID: <f49040ee-a5c5-c106-2b51-cd48646306b0@linaro.org> (raw)
In-Reply-To: <35c749cf.28af7.172ee1e4ac3.Coremail.dinghao.liu@zju.edu.cn>

Hi,

On 6/26/20 3:54 AM, dinghao.liu@zju.edu.cn wrote:
> 
>> Hi Dinghao,
>>
>> On 6/24/20 9:30 AM, Dinghao Liu wrote:
>>> pm_runtime_get_sync() increments the runtime PM usage counter even
>>> when it returns an error code. Thus a pairing decrement is needed on
>>> the error handling path to keep the counter balanced. For other error
>>> paths after this call, things are the same.
>>>
>>> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
>>> ---
>>>
>>> Changelog:
>>>
>>> v2: - Add pm_runtime_get_noresume() on failure of
>>>       pm_runtime_put_sync() to balance PM counter instead of
>>>       releasing everything here.

Could you reword this and add it to the patch description.

>>
>> You are adding pm_runtime_get_noresume in pm_runtime_put_sync error path
>> but the patch description is referring to pm_runtime_get_sync. I'm confused.
>>
> 
> When pm_runtime_put_sync failed, the control flow will jump to 
> err_dev_unregister, where has already been a pm_runtime_put_noidle. 
> If we don't add an extra pm_runtime_get_noresume here, we will 
> decrease PM usage counter twice.
> 
> Anyway, this may seem a little strange. Do you have a better
> strategy to reorder the labels?

No, it looks fine. With above addition to patch description:

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> 
> Regards,
> Dinghao
> 
>>> ---
>>>  drivers/media/platform/qcom/venus/core.c | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
>>> index 203c6538044f..b0b932bf8c02 100644
>>> --- a/drivers/media/platform/qcom/venus/core.c
>>> +++ b/drivers/media/platform/qcom/venus/core.c
>>> @@ -287,8 +287,10 @@ static int venus_probe(struct platform_device *pdev)
>>>  		goto err_core_deinit;
>>>  
>>>  	ret = pm_runtime_put_sync(dev);
>>> -	if (ret)
>>> +	if (ret) {
>>> +		pm_runtime_get_noresume(dev);
>>>  		goto err_dev_unregister;
>>> +	}
>>>  
>>>  	return 0;
>>>  
>>> @@ -299,6 +301,7 @@ static int venus_probe(struct platform_device *pdev)
>>>  err_venus_shutdown:
>>>  	venus_shutdown(core);
>>>  err_runtime_disable:
>>> +	pm_runtime_put_noidle(dev);
>>>  	pm_runtime_set_suspended(dev);
>>>  	pm_runtime_disable(dev);
>>>  	hfi_destroy(core);
>>>
>>
>> -- 
>> regards,
>> Stan

-- 
regards,
Stan

  reply	other threads:[~2020-06-26 21:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24  6:30 Dinghao Liu
2020-06-25 15:52 ` Stanimir Varbanov
2020-06-26  0:54   ` dinghao.liu
2020-06-26 21:01     ` Stanimir Varbanov [this message]
2020-06-28  5:38       ` dinghao.liu
2020-06-24 15:25 [PATCH v2] " 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=f49040ee-a5c5-c106-2b51-cd48646306b0@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=kjlu@umn.edu \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.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

all inboxes | Powered by JetHome®