From: zhangqilong <zhangqilong3@huawei.com>
To: Hans Verkuil <hverkuil@xs4all.nl>, Maxime Ripard <maxime@cerno.tech>
Cc: "paul.kocialkowski@bootlin.com" <paul.kocialkowski@bootlin.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"wens@csie.org" <wens@csie.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>
Subject: 答复: [PATCH -next] media: cedrus: fix reference leak in cedrus_start_streaming
Date: Thu, 5 Nov 2020 08:06:58 +0000 [thread overview]
Message-ID: <710479d756b14da591bb2342a1767242@huawei.com> (raw)
In-Reply-To: <2eb14a6d-4680-1527-0985-fd371e3ba2e8@xs4all.nl>
> On 02/11/2020 15:18, Maxime Ripard wrote:
> > On Mon, Nov 02, 2020 at 10:26:22PM +0800, Zhang Qilong wrote:
> >> pm_runtime_get_sync will increment pm usage counter even it failed.
> >> Forgetting to pm_runtime_put_noidle will result in reference leak in
> >> cedrus_start_streaming. We should fix it.
> >>
> >> Fixes: d5aecd289babf ("media: cedrus: Implement runtime PM")
> >> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> >
> > Shouldn't we fix pm_runtime_get_sync instead then? It seems that most
> > of the callers get this wrong, and that's definitely non-obvious.
>
> It's been discussed before, but nobody stepped up to address this issue. In the
> end I decided to just accept media patches that fix this in the drivers rather
> than waiting for some mythical future core fix.
>
> Nor do I think that you can just 'fix' pm_runtime_get_sync, since then you will
> get cases where pm_runtime_put is called once too often.
>
Thanks for your nice comment, if any updates occur about pm_runtime_get_sync, I will pay attention to it.
Thanks, best wish,
Zhang Qilong
> Regards,
>
> Hans
>
> >
> > Maxime
> >
next prev parent reply other threads:[~2020-11-05 8:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 14:26 [PATCH -next] media: cedrus: fix reference leak in cedrus_start_streaming Zhang Qilong
2020-11-02 14:18 ` Maxime Ripard
2020-11-02 14:39 ` 答复: " zhangqilong
2020-11-02 15:12 ` Dan Carpenter
2020-11-04 11:39 ` Hans Verkuil
2020-11-05 8:06 ` zhangqilong [this message]
2020-11-05 10:41 ` Dan Carpenter
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=710479d756b14da591bb2342a1767242@huawei.com \
--to=zhangqilong3@huawei.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=maxime@cerno.tech \
--cc=mchehab@kernel.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=wens@csie.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