RE: [PATCHv2 06/14] Thermal: Add a policy sysfs attribute
From: "Zhang, Rui" <rui.zhang@intel.com>
Date: 2012-08-27 10:44:46
-----Original Message----- From: R, Durgadoss Sent: Monday, August 27, 2012 1:24 PM To: Zhang, Rui; lenb@kernel.org Cc: linux-acpi@vger.kernel.org; eduardo.valentin@ti.com Subject: RE: [PATCHv2 06/14] Thermal: Add a policy sysfs attribute Importance: Highquoted
quoted
quoted
quoted
#define to_cooling_device(_dev) \@@ -1349,10 +1371,16 @@ static int retrieve_zone_params(structthermal_zone_device *tz) /* It is not an error to not have any platform data */ ret = get_platform_thermal_params(tz); - if (ret) + if (ret) { tz->tzp = NULL; + return 0; + } - return 0; + ret = device_create_file(&tz->device,&dev_attr_throttle_policy);quoted
quoted
quoted
quoted
+ if (ret) + dev_err(&tz->device, "creating policy attrfailed:%d\n",quoted
quoted
quoted
quoted
ret); + + return ret; }What does this mean? We will not create "policy" attributes if there is nothermal_zone_params? Yes, that's what I thought initially. Because if there is no 'throttle_policy' we assume that it is (by default) step_wise. But, if we make tz_params be provided through tzd_register function call, it makes sense for this to be a mandatory attribute, showing 'step_wise" if there is no thermal_zone_params.IMO, every thermal zone should have a policy. And they can be changed anytime if user wants to.Agree with you on the first part. Not sure if we want this to be writable.
Say, what if a user space application is loaded and want to take control of the thermal management from kernel? It should set the policy to "userspace" to stop the kernel actions first. BTW, just like the cpufreq governors, they can be changed any time.
Thanks, Durga