diff mbox

x86_pkg_temp_thermal: Do not expose as a hwmon device

Message ID 20140302153335.0f1326b6@endymion.delvare (mailing list archive)
State Accepted, archived
Delegated to: Zhang Rui
Headers show

Commit Message

Jean Delvare March 2, 2014, 2:33 p.m. UTC
The temperature value reported by x86_pkg_temp_thermal is already
reported by the coretemp driver. So, do not expose this thermal zone
as a hwmon device, because it would be redundant.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/x86_pkg_temp_thermal.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Guenter Roeck March 2, 2014, 4:03 p.m. UTC | #1
On 03/02/2014 06:33 AM, Jean Delvare wrote:
> The temperature value reported by x86_pkg_temp_thermal is already
> reported by the coretemp driver. So, do not expose this thermal zone
> as a hwmon device, because it would be redundant.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Eduardo Valentin <eduardo.valentin@ti.com>

Acked-by: Guenter Roeck <linux@roeck-us.net>

Does that make the "Fix thermal zone type" patch unnecessary ?
If so, this patch would be a candidate for stable.

Guenter

> ---
>   drivers/thermal/x86_pkg_temp_thermal.c |    6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> --- linux-3.14-rc4.orig/drivers/thermal/x86_pkg_temp_thermal.c	2014-03-02 15:29:21.646475545 +0100
> +++ linux-3.14-rc4/drivers/thermal/x86_pkg_temp_thermal.c	2014-03-02 15:29:37.568831104 +0100
> @@ -68,6 +68,10 @@ struct phy_dev_entry {
>   	struct thermal_zone_device *tzone;
>   };
>
> +static const struct thermal_zone_params pkg_temp_tz_params = {
> +	.no_hwmon	= true,
> +};
> +
>   /* List maintaining number of package instances */
>   static LIST_HEAD(phy_dev_list);
>   static DEFINE_MUTEX(phy_dev_list_mutex);
> @@ -443,7 +447,7 @@ static int pkg_temp_thermal_device_add(u
>   			thres_count,
>   			(thres_count == MAX_NUMBER_OF_TRIPS) ?
>   				0x03 : 0x01,
> -			phy_dev_entry, &tzone_ops, NULL, 0, 0);
> +			phy_dev_entry, &tzone_ops, &pkg_temp_tz_params, 0, 0);
>   	if (IS_ERR(phy_dev_entry->tzone)) {
>   		err = PTR_ERR(phy_dev_entry->tzone);
>   		goto err_ret_free;
>

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jean Delvare March 2, 2014, 5:04 p.m. UTC | #2
On Sun, 02 Mar 2014 08:03:28 -0800, Guenter Roeck wrote:
> On 03/02/2014 06:33 AM, Jean Delvare wrote:
> > The temperature value reported by x86_pkg_temp_thermal is already
> > reported by the coretemp driver. So, do not expose this thermal zone
> > as a hwmon device, because it would be redundant.
> >
> > Signed-off-by: Jean Delvare <jdelvare@suse.de>
> > Cc: Zhang Rui <rui.zhang@intel.com>
> > Cc: Eduardo Valentin <eduardo.valentin@ti.com>
> 
> Acked-by: Guenter Roeck <linux@roeck-us.net>
> 
> Does that make the "Fix thermal zone type" patch unnecessary ?

I think both patches are needed, as type "pkg-temp-0" is wrong anyway,
regardless of the hwmon side of things. But it is less important with
this patch applied, indeed.

> If so, this patch would be a candidate for stable.

I'm still not 100% certain we want either patch in stable. After all,
they aren't fixing any critical bug, and they change user interfaces so
they could impact some users in unpredictable ways.
Guenter Roeck March 2, 2014, 5:44 p.m. UTC | #3
On 03/02/2014 09:04 AM, Jean Delvare wrote:
> On Sun, 02 Mar 2014 08:03:28 -0800, Guenter Roeck wrote:
>> On 03/02/2014 06:33 AM, Jean Delvare wrote:
>>> The temperature value reported by x86_pkg_temp_thermal is already
>>> reported by the coretemp driver. So, do not expose this thermal zone
>>> as a hwmon device, because it would be redundant.
>>>
>>> Signed-off-by: Jean Delvare <jdelvare@suse.de>
>>> Cc: Zhang Rui <rui.zhang@intel.com>
>>> Cc: Eduardo Valentin <eduardo.valentin@ti.com>
>>
>> Acked-by: Guenter Roeck <linux@roeck-us.net>
>>
>> Does that make the "Fix thermal zone type" patch unnecessary ?
>
> I think both patches are needed, as type "pkg-temp-0" is wrong anyway,
> regardless of the hwmon side of things. But it is less important with
> this patch applied, indeed.
>
>> If so, this patch would be a candidate for stable.
>
> I'm still not 100% certain we want either patch in stable. After all,
> they aren't fixing any critical bug, and they change user interfaces so
> they could impact some users in unpredictable ways.
>

Ok.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jean Delvare March 7, 2014, 8:07 a.m. UTC | #4
On Sun, 2 Mar 2014 18:04:52 +0100, Jean Delvare wrote:
> On Sun, 02 Mar 2014 08:03:28 -0800, Guenter Roeck wrote:
> > On 03/02/2014 06:33 AM, Jean Delvare wrote:
> > > The temperature value reported by x86_pkg_temp_thermal is already
> > > reported by the coretemp driver. So, do not expose this thermal zone
> > > as a hwmon device, because it would be redundant.
> > >
> > > Signed-off-by: Jean Delvare <jdelvare@suse.de>
> > > Cc: Zhang Rui <rui.zhang@intel.com>
> > > Cc: Eduardo Valentin <eduardo.valentin@ti.com>
> > 
> > Acked-by: Guenter Roeck <linux@roeck-us.net>
> > 
> > Does that make the "Fix thermal zone type" patch unnecessary ?
> 
> I think both patches are needed, as type "pkg-temp-0" is wrong anyway,
> regardless of the hwmon side of things. But it is less important with
> this patch applied, indeed.
> 
> > If so, this patch would be a candidate for stable.
> 
> I'm still not 100% certain we want either patch in stable. After all,
> they aren't fixing any critical bug, and they change user interfaces so
> they could impact some users in unpredictable ways.

I made up my mind, and now believe this patch should go to stable
trees. The invalid name attribute is causing real trouble to lm-sensors
users.

The other patch OTOH doesn't need to go to stable trees if that one
goes in.

Rui, Eduardo, can either of you please review this patch, tag it for
stable and apply it for 3.14? Thanks.
diff mbox

Patch

--- linux-3.14-rc4.orig/drivers/thermal/x86_pkg_temp_thermal.c	2014-03-02 15:29:21.646475545 +0100
+++ linux-3.14-rc4/drivers/thermal/x86_pkg_temp_thermal.c	2014-03-02 15:29:37.568831104 +0100
@@ -68,6 +68,10 @@  struct phy_dev_entry {
 	struct thermal_zone_device *tzone;
 };
 
+static const struct thermal_zone_params pkg_temp_tz_params = {
+	.no_hwmon	= true,
+};
+
 /* List maintaining number of package instances */
 static LIST_HEAD(phy_dev_list);
 static DEFINE_MUTEX(phy_dev_list_mutex);
@@ -443,7 +447,7 @@  static int pkg_temp_thermal_device_add(u
 			thres_count,
 			(thres_count == MAX_NUMBER_OF_TRIPS) ?
 				0x03 : 0x01,
-			phy_dev_entry, &tzone_ops, NULL, 0, 0);
+			phy_dev_entry, &tzone_ops, &pkg_temp_tz_params, 0, 0);
 	if (IS_ERR(phy_dev_entry->tzone)) {
 		err = PTR_ERR(phy_dev_entry->tzone);
 		goto err_ret_free;