linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Rajendra Nayak <rnayak@codeaurora.org>,
	Stephen Boyd <swboyd@chromium.org>,
	andy.gross@linaro.org, david.brown@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] soc: qcom: update config dependencies for QCOM_RPMPD
Date: Thu, 24 Jan 2019 12:15:15 +0530	[thread overview]
Message-ID: <20190124064515.yimgprg5hzsfghc6@vireshk-i7> (raw)
In-Reply-To: <b2ab31ef-6c95-186f-62b3-f1b04d2de945@roeck-us.net>

On 23-01-19, 06:22, Guenter Roeck wrote:
> See Documentation/kobject.txt.
> 
> "One important point cannot be overstated: every kobject must have a
> release() method, and the kobject must persist (in a consistent state)
> until that method is called. If these constraints are not met, the code is
> flawed. Note that the kernel will warn you if you forget to provide a
> release() method.  Do not try to get rid of this warning by providing an
> "empty" release function.
> 
> If all your cleanup function needs to do is call kfree(), then you must
> create a wrapper function which uses container_of() to upcast to the correct
> type (as shown in the example above) and then calls kfree() on the overall
> structure."

Guenter, you are of course correct but I am not sure what else we can
do here. In the most common case device & kobject are allocated along
with the real entity, like struct genpd here, and we free those from
the release routine (i.e. kfree(genpd)). But in our case most of the
times the genpd is created statically by platform drivers and not by
the genpd core, and so we can't free it from release().

Over that the genpd->dev is only used by the OPP core currently and
the device isn't even registered with the device core.

-- 
viresh

  reply	other threads:[~2019-01-24  6:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18  4:48 [PATCH] soc: qcom: update config dependencies for QCOM_RPMPD Rajendra Nayak
2019-01-18 17:39 ` Stephen Boyd
2019-01-22  2:30   ` Rajendra Nayak
2019-01-22  5:08     ` Guenter Roeck
2019-01-22  9:54       ` Rajendra Nayak
2019-01-22 10:08         ` Viresh Kumar
2019-01-22 10:35           ` Rajendra Nayak
2019-01-23 11:16             ` Viresh Kumar
2019-01-23 14:22               ` Guenter Roeck
2019-01-24  6:45                 ` Viresh Kumar [this message]
2019-01-31  1:32   ` Bjorn Andersson

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=20190124064515.yimgprg5hzsfghc6@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rnayak@codeaurora.org \
    --cc=swboyd@chromium.org \
    --cc=ulf.hansson@linaro.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).