dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Frank Lee <tiny.windzz@gmail.com>
Cc: Nishanth Menon <nm@ti.com>,
	freedreno@lists.freedesktop.org,
	Frank Lee <frank@allwinnertech.com>,
	airlied@linux.ie, Viresh Kumar <vireshk@kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	dri-devel@lists.freedesktop.org, gustavoars@kernel.org,
	Stephen Boyd <sboyd@kernel.org>,
	linux-arm-msm@vger.kernel.org, kholk11@gmail.com,
	Sean Paul <sean@poorly.run>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	emil.velikov@collabora.com
Subject: Re: [PATCH 2/3] opp: Add devres wrapper for dev_pm_opp_set_prop_name
Date: Fri, 30 Oct 2020 16:58:02 +0530	[thread overview]
Message-ID: <20201030112802.bptlthpxl2qvbvr6@vireshk-i7> (raw)
In-Reply-To: <CAEExFWtYrT3psuLC0fd7cX2GrmPaYxqZK65OLUv+2s97ehz97g@mail.gmail.com>

On 30-10-20, 19:19, Frank Lee wrote:
> GPU is also a relatively large number of opp consumers.

I was talking about the number of files or locations from which this
routine (the devm_* variant) is going to get called. And it is one
right now. And I don't see if any of the other callers are going to
use it for now.

> Most of the time, the dev_pm_opp_set_* functions will only be set once.

Right.

> If don't need the driver to dynamically manage and release the opp, it
> may be OK?

Every call to dev_pm_opp_set_supported_hw() increases the ref count of
the OPP table and if it isn't balanced with a call to
dev_pm_opp_put_supported_hw(), then the OPP table will never get
freed. So if the driver is a module and ends up creating an OPP table
every time, then this will lead to leakage.

The best way to fix this is by calling dev_pm_opp_put_supported_hw()
from the right place and then we are good.

-- 
viresh
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-11-01 17:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 13:55 [PATCH 0/3] Introduce devm_pm_opp_set_* API Frank Lee
2020-10-12 13:55 ` [PATCH 1/3] opp: Add devres wrapper for dev_pm_opp_set_supported_hw Frank Lee
2020-10-12 13:55 ` [PATCH 2/3] opp: Add devres wrapper for dev_pm_opp_set_prop_name Frank Lee
2020-10-28 10:29   ` Viresh Kumar
2020-10-28 11:02     ` Frank Lee
2020-10-28 14:46       ` Viresh Kumar
2020-10-30 11:19         ` Frank Lee
2020-10-30 11:28           ` Viresh Kumar [this message]
2020-10-12 13:55 ` [PATCH 3/3] drm/msm: Convert to devm_pm_opp_set_supported_hw Frank Lee
2020-10-28  6:01   ` Viresh Kumar
2020-10-28  6:06 ` [PATCH 0/3] Introduce devm_pm_opp_set_* API Viresh Kumar
2020-10-30 11:29   ` Viresh Kumar

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=20201030112802.bptlthpxl2qvbvr6@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=frank@allwinnertech.com \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gustavoars@kernel.org \
    --cc=kholk11@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@kernel.org \
    --cc=sean@poorly.run \
    --cc=tiny.windzz@gmail.com \
    --cc=vireshk@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;
as well as URLs for NNTP newsgroup(s).