Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Sep 2015 23:13:47 +0000 (16:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Sep 2015 23:13:47 +0000 (16:13 -0700)
Pull thermal updates from Zhang Rui:

 - use int instead of unsigned long to represent temperature to avoid
   bogus overheat detection when negative temperature reported.  From
   Sascha Hauer.

 - export available thermal governors information to user space via
   sysfs.  From Wei Ni.

 - introduce new thermal driver for Wildcat Point platform controller
   hub, which uses PCH thermal sensor and associated critical and hot
   trip points.  From Tushar Dave.

 - add suuport for Intel Skylake and Denlow platforms in powerclamp
   driver.

 - some small cleanups in thermal core.

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  thermal: Add Intel PCH thermal driver
  thermal: Add comment explaining test for critical temperature
  thermal: Use IS_ENABLED instead of #ifdef
  thermal: remove unnecessary call to thermal_zone_device_set_polling
  thermal: trivial: fix typo in comment
  thermal: consistently use int for temperatures
  thermal: add available policies sysfs attribute
  thermal/powerclamp: add cpu id for denlow platform
  thermal/powerclamp: add cpu id for Skylake u/y
  thermal/powerclamp: add cpu id for skylake h/s

1  2 
drivers/acpi/thermal.c
drivers/thermal/intel_powerclamp.c
drivers/thermal/st/st_thermal.c

diff --combined drivers/acpi/thermal.c
index fc28b9f5aa84b0ac80dfe45551558d325011f4e6,e66ad25d112ffcd8eed3cbf33305f08301c04b24..30d8518b25fbcfdb0ed11121c8725fb229ca17ba
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   *  General Public License for more details.
   *
 - *  You should have received a copy of the GNU General Public License along
 - *  with this program; if not, write to the Free Software Foundation, Inc.,
 - *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 - *
   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   *
   *  This driver fully implements the ACPI thermal policy as described in the
@@@ -525,8 -529,7 +525,7 @@@ static void acpi_thermal_check(void *da
  
  /* sys I/F for generic thermal sysfs support */
  
- static int thermal_get_temp(struct thermal_zone_device *thermal,
-                           unsigned long *temp)
+ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
  {
        struct acpi_thermal *tz = thermal->devdata;
        int result;
@@@ -633,7 -636,7 +632,7 @@@ static int thermal_get_trip_type(struc
  }
  
  static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
-                                int trip, unsigned long *temp)
+                                int trip, int *temp)
  {
        struct acpi_thermal *tz = thermal->devdata;
        int i;
  }
  
  static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
-                               unsigned long *temperature) {
+                               int *temperature)
+ {
        struct acpi_thermal *tz = thermal->devdata;
  
        if (tz->trips.critical.flags.valid) {
@@@ -709,8 -713,8 +709,8 @@@ static int thermal_get_trend(struct the
                return -EINVAL;
  
        if (type == THERMAL_TRIP_ACTIVE) {
-               unsigned long trip_temp;
-               unsigned long temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
+               int trip_temp;
+               int temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
                                        tz->temperature, tz->kelvin_offset);
                if (thermal_get_trip_temp(thermal, trip, &trip_temp))
                        return -EINVAL;
index 2ac0c704bcb85b5884365d54485c57383952b81a,a42e8a39f8082240b96f819b4d6d21f33801a3cc..6c79588251d59b53e290908a7fd61705c6db3211
@@@ -340,7 -340,7 +340,7 @@@ static bool powerclamp_adjust_controls(
  
        /* check result for the last window */
        msr_now = pkg_state_counter();
 -      rdtscll(tsc_now);
 +      tsc_now = rdtsc();
  
        /* calculate pkg cstate vs tsc ratio */
        if (!msr_last || !tsc_last)
@@@ -482,7 -482,7 +482,7 @@@ static void poll_pkg_cstate(struct work
        u64 val64;
  
        msr_now = pkg_state_counter();
 -      rdtscll(tsc_now);
 +      tsc_now = rdtsc();
        jiffies_now = jiffies;
  
        /* calculate pkg cstate vs tsc ratio */
@@@ -693,11 -693,14 +693,14 @@@ static const struct x86_cpu_id intel_po
        { X86_VENDOR_INTEL, 6, 0x3f},
        { X86_VENDOR_INTEL, 6, 0x45},
        { X86_VENDOR_INTEL, 6, 0x46},
+       { X86_VENDOR_INTEL, 6, 0x47},
        { X86_VENDOR_INTEL, 6, 0x4c},
        { X86_VENDOR_INTEL, 6, 0x4d},
+       { X86_VENDOR_INTEL, 6, 0x4e},
        { X86_VENDOR_INTEL, 6, 0x4f},
        { X86_VENDOR_INTEL, 6, 0x56},
        { X86_VENDOR_INTEL, 6, 0x57},
+       { X86_VENDOR_INTEL, 6, 0x5e},
        {}
  };
  MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids);
index 88c759d746c3f6837b0c81075443ef5ae0db0985,44cbba99716a83ebdb7381f33b2b5c57614c0694..be637e6b01d217f9ab54929fbb93322fb5ca086a
@@@ -111,8 -111,7 +111,7 @@@ static int st_thermal_calibration(struc
  }
  
  /* Callback to get temperature from HW*/
- static int st_thermal_get_temp(struct thermal_zone_device *th,
-               unsigned long *temperature)
+ static int st_thermal_get_temp(struct thermal_zone_device *th, int *temperature)
  {
        struct st_thermal_sensor *sensor = th->devdata;
        struct device *dev = sensor->dev;
@@@ -159,7 -158,7 +158,7 @@@ static int st_thermal_get_trip_type(str
  }
  
  static int st_thermal_get_trip_temp(struct thermal_zone_device *th,
-                                   int trip, unsigned long *temp)
+                                   int trip, int *temp)
  {
        struct st_thermal_sensor *sensor = th->devdata;
        struct device *dev = sensor->dev;
@@@ -214,7 -213,7 +213,7 @@@ int st_thermal_register(struct platform
  
        sensor->ops = sensor->cdata->ops;
  
 -      ret = sensor->ops->regmap_init(sensor);
 +      ret = (sensor->ops->regmap_init)(sensor);
        if (ret)
                return ret;