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/
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
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: [lm-sensors] [PATCH v6 1/6] thermal: add generic cpufreq cooling implementation
Date: Fri, 21 Sep 2012 02:23:47 +0000 [thread overview]
Message-ID: <505BCFB3.3040004@samsung.com> (raw)
In-Reply-To: <0MAO00DCVFKI4NS0@ms2.samsung.com>
SGksIEFtaXQsCk9uIDIwMTKz4iAwOL/5IDE2wM8gMjA6NDEsIEFtaXQgRGFuaWVsIEthY2hoYXAg
d3JvdGU6Cgo+ICBkaWZmIC0tZ2l0IGEvZHJpdmVycy90aGVybWFsL2NwdV9jb29saW5nLmMgYi9k
cml2ZXJzL3RoZXJtYWwvY3B1X2Nvb2xpbmcuYwo+ICBuZXcgZmlsZSBtb2RlIDEwMDY0NAo+ICBp
bmRleCAwMDAwMDAwLi42NmNiZDUyCj4gIC0tLSAvZGV2L251bGwKPiAgKysrIGIvZHJpdmVycy90
aGVybWFsL2NwdV9jb29saW5nLmMKPiAgQEAgLTAsMCArMSw1ODYgQEAKCj4gICsvKioKPiAgKyAq
IGNwd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3Jkb21vLWlu
Zm8uaHRtbAo+IFBsZWFzZSByZWFkIHRoZSBGQVEgYXQgIGh0dHA6Ly93d3cudHV4Lm9yZy9sa21s
LwoKCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbG0t
c2Vuc29ycyBtYWlsaW5nIGxpc3QKbG0tc2Vuc29yc0BsbS1zZW5zb3JzLm9yZwpodHRwOi8vbGlz
dHMubG0tc2Vuc29ycy5vcmcvbWFpbG1hbi9saXN0aW5mby9sbS1zZW5zb3Jz
WARNING: multiple messages have this Message-ID (diff)
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/
next parent reply other threads:[~2012-09-21 2:24 UTC|newest]
Thread overview: 16+ 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-09-21 2:23 ` [PATCH v6 1/6] thermal: add generic cpufreq cooling implementation jonghwa3.lee
2012-09-21 2:23 ` [lm-sensors] " jonghwa3.lee
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-16 11:41 ` Amit Daniel Kachhap
2012-08-16 14:52 ` Valentin, Eduardo
2012-08-17 7:24 ` Zhang Rui
2012-08-17 7:24 ` Zhang Rui
2012-08-17 7:58 ` Amit Kachhap
2012-08-17 7:58 ` Amit Kachhap
2012-08-17 8:56 ` Valentin, Eduardo
2012-08-17 8:56 ` Valentin, Eduardo
2012-08-20 2:16 ` Zhang Rui
2012-08-20 2:16 ` Zhang Rui
2012-08-20 9:36 ` Valentin, Eduardo
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.