public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jonghwa3.lee@samsung.com
To: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Cc: linux-pm@lists.linux-foundation.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Zhang Rui <rui.zhang@intel.com>, Len Brown <lenb@kernel.org>,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org, lm-sensors@lm-sensors.org
Subject: Re: [PATCH v6 1/6] thermal: add generic cpufreq cooling implementation
Date: Fri, 21 Sep 2012 11:23:47 +0900	[thread overview]
Message-ID: <505BCFB3.3040004@samsung.com> (raw)
In-Reply-To: <0MAO00DCVFKI4NS0@ms2.samsung.com>

Hi, Amit,
On 2012년 08월 16일 20:41, Amit Daniel Kachhap wrote:

>  diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
>  new file mode 100644
>  index 0000000..66cbd52
>  --- /dev/null
>  +++ b/drivers/thermal/cpu_cooling.c
>  @@ -0,0 +1,586 @@

>  +/**
>  + * cpufreq_cooling_register - function to create cpufreq cooling device.
>  + * @clip_cpus: cpumask of cpus where the frequency constraints will happen.
>  + */
>  +struct thermal_cooling_device *cpufreq_cooling_register(
>  +       struct cpumask *clip_cpus)
>  +{
>  +       struct thermal_cooling_device *cool_dev;
>  +       struct cpufreq_cooling_device *cpufreq_dev = NULL;
>  +       unsigned int cpufreq_dev_count = 0, min = 0, max = 0;
>  +       char dev_name[THERMAL_NAME_LENGTH];
>  +       int ret = 0, id = 0, i;
>  +       struct cpufreq_policy policy;
>  +       ret = get_idr(&cpufreq_idr,&cpufreq_dev->id);
>  +       if (ret) {
>  +               kfree(cpufreq_dev);
>  +               return ERR_PTR(-EINVAL);
>  +       }
>  +
>  +       sprintf(dev_name, "thermal-cpufreq-%d", cpufreq_dev->id);
>  +
>  +       cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev,
>  +&cpufreq_cooling_ops);
>  +       if (!cool_dev) {
>  +               release_idr(&cpufreq_idr, cpufreq_dev->id);
>  +               kfree(cpufreq_dev);
>  +               return ERR_PTR(-EINVAL);
>  +       }
>  +       cpufreq_dev->id = id;


Why is this needed? Should every cpufreq_dev instance's id be same for
zero? It looks odd. And it also has problem which can be occurred when
it release id during unregistering cpufreq_dev. I think it should keep
the idr value taken before.


>  1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



       reply	other threads:[~2012-09-21  2:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0MAO00DCVFKI4NS0@ms2.samsung.com>
2012-09-21  2:23 ` jonghwa3.lee [this message]
2012-08-16 11:41 [PATCH v6 0/6] thermal: Add kernel thermal support for exynos platform Amit Daniel Kachhap
2012-08-16 11:41 ` [PATCH v6 1/6] thermal: add generic cpufreq cooling implementation Amit Daniel Kachhap
2012-08-17  7:24   ` Zhang Rui
2012-08-17  7:58     ` Amit Kachhap
2012-08-17  8:56       ` Valentin, Eduardo
2012-08-20  2:16         ` Zhang Rui
2012-08-20  9:36           ` Valentin, Eduardo

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=505BCFB3.3040004@samsung.com \
    --to=jonghwa3.lee@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=amit.kachhap@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=rui.zhang@intel.com \
    /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