17 May, 2016

1 commit


09 Mar, 2016

1 commit


30 Sep, 2015

2 commits


14 Sep, 2015

2 commits


03 Aug, 2015

1 commit

  • The thermal code uses int, long and unsigned long for temperatures
    in different places.

    Using an unsigned type limits the thermal framework to positive
    temperatures without need. Also several drivers currently will report
    temperatures near UINT_MAX for temperatures below 0°C. This will probably
    immediately shut the machine down due to overtemperature if started below
    0°C.

    'long' is 64bit on several architectures. This is not needed since INT_MAX °mC
    is above the melting point of all known materials.

    Consistently use a plain 'int' for temperatures throughout the thermal code and
    the drivers. This only changes the places in the drivers where the temperature
    is passed around as pointer, when drivers internally use another type this is
    not changed.

    Signed-off-by: Sascha Hauer
    Acked-by: Geert Uytterhoeven
    Reviewed-by: Jean Delvare
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Darren Hart
    Reviewed-by: Heiko Stuebner
    Reviewed-by: Peter Feuerer
    Cc: Punit Agrawal
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: Jean Delvare
    Cc: Peter Feuerer
    Cc: Heiko Stuebner
    Cc: Lukasz Majewski
    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: linux-acpi@vger.kernel.org
    Cc: platform-driver-x86@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-omap@vger.kernel.org
    Cc: linux-samsung-soc@vger.kernel.org
    Cc: Guenter Roeck
    Cc: Rafael J. Wysocki
    Cc: Maxime Ripard
    Cc: Darren Hart
    Cc: lm-sensors@lm-sensors.org
    Signed-off-by: Zhang Rui

    Sascha Hauer
     

26 Jun, 2015

1 commit

  • Pull thermal management updates from Zhang Rui:
    "Specifics:

    - enhance Thermal Framework with several new capabilities:

    * use power estimates
    * compute weights with relative integers instead of percentages
    * allow governors to have private data in thermal zones
    * export thermal zone parameters through sysfs

    Thanks to the ARM thermal team (Javi, Punit, KP).

    - introduce a new thermal governor: power allocator. First in kernel
    closed loop PI(D) controller for thermal control. Thanks to ARM
    thermal team.

    - enhance OF thermal to allow thermal zones to have sustainable power
    HW specification. Thanks to Punit.

    - introduce thermal driver for Intel Quark SoC x1000platform. Thanks
    to Ong, Boon Leong.

    - introduce QPNP PMIC temperature alarm driver. Thanks to Ivan T. I.

    - introduce thermal driver for Hisilicon hi6220. Thanks to
    kongxinwei.

    - enhance Exynos thermal driver to handle Exynos5433 TMU. Thanks to
    Chanwoo C.

    - TI thermal driver now has a better implementation for EOCZ bit.
    From Pavel M.

    - add id for Skylake processors in int340x processor thermal driver.

    - a couple of small fixes and cleanups."

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (36 commits)
    thermal: hisilicon: add new hisilicon thermal sensor driver
    dt-bindings: Document the hi6220 thermal sensor bindings
    thermal: of-thermal: add support for reading coefficients property
    thermal: support slope and offset coefficients
    thermal: power_allocator: round the division when divvying up power
    thermal: exynos: Add the support for Exynos5433 TMU
    thermal: cpu_cooling: Fix power calculation when CPUs are offline
    thermal: cpu_cooling: Remove cpu_dev update on policy CPU update
    thermal: export thermal_zone_parameters to sysfs
    thermal: cpu_cooling: Check memory allocation of power_table
    ti-soc-thermal: request temperature periodically if hw can't do that itself
    ti-soc-thermal: implement eocz bit to make driver useful on omap3
    cleanup ti-soc-thermal
    thermal: remove stale THERMAL_POWER_ACTOR select
    thermal: Default OF created trip points to writable
    thermal: core: Add Kconfig option to enable writable trips
    thermal: x86_pkg_temp: drop const for thermal_zone_parameters
    of: thermal: Introduce sustainable power for a thermal zone
    thermal: add trace events to the power allocator governor
    thermal: introduce the Power Allocator governor
    ...

    Linus Torvalds
     

09 May, 2015

2 commits

  • DESCRIPTION

    Spurious Thermal Alert: Talert can happen randomly while the device remains
    under the temperature limit defined for this event to trig. This spurious
    event is caused by a incorrect re-synchronization between clock domains.
    The comparison between configured threshold and current temperature value
    can happen while the value is transitioning (metastable), thus causing
    inappropriate event generation. No spurious event occurs as long as the
    threshold value stays unchanged. Spurious event can be generated while a
    thermal alert threshold is modified in
    CONTROL_BANDGAP_THRESHOLD_MPU/GPU/CORE/DSPEVE/IVA_n.

    WORKAROUND

    Spurious event generation can be avoided by performing following sequence
    when the threshold is modified:
    1. Mask the hot/cold events at the thermal IP level.
    2. Modify Threshold.
    3. Unmask the hot/cold events at the thermal IP level.

    Signed-off-by: Keerthy
    Signed-off-by: Eduardo Valentin

    Keerthy
     
  • Bandgap Temperature read Dtemp can be corrupted

    DESCRIPTION
    Read accesses to registers listed below can be corrupted due to
    incorrect resynchronization between clock domains.

    Read access to registers below can be corrupted :
    • CTRL_CORE_DTEMP_MPU/GPU/CORE/DSPEVE/IVA_n (n = 0 to 4)
    • CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA_n

    WORKAROUND
    Multiple reads to CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA[9:0]:
    BGAP_DTEMPMPU/GPU/CORE/DSPEVE/IVA is needed to discard false value and
    read right value:
    1. Perform two successive reads to BGAP_DTEMP bit field.
    (a) If read1 returns Val1 and read2 returns Val1, then
    right value is Val1.
    (b) If read1 returns Val1, read 2 returns Val2, a third
    read is needed.
    2. Perform third read
    (a) If read3 returns Val2 then right value is Val2.
    (b) If read3 returns Val3, then right value is Val3.

    The above in gist means if val1 and val2 are the same then we can go
    ahead with that value else we need a third read which will be right
    since synchronization will be complete by then.

    Signed-off-by: Keerthy
    Signed-off-by: Eduardo Valentin

    Keerthy
     

05 May, 2015

4 commits

  • When periodic mode is not enabled, it is neccessary to force reads.

    Signed-off-by: Pavel Machek
    Signed-off-by: Eduardo Valentin

    Pavel Machek
     
  • For omap3, proper implementation of eocz bit is needed. It was
    actually a TODO in the driver.

    Signed-off-by: Pavel Machek
    Signed-off-by: Eduardo Valentin

    Pavel Machek
     
  • Simplify code by removing goto's where they point to simple return.

    Avoid confusing |= on error values.

    Correct whitespace.

    Signed-off-by: Pavel Machek
    Signed-off-by: Eduardo Valentin

    Pavel Machek
     
  • Currently you can specify the weight of the cooling device in the device
    tree but that information is not populated to the
    thermal_bind_params where the fair share governor expects it to
    be. The of thermal zone device doesn't have a thermal_bind_params
    structure and arguably it's better to pass the weight inside the
    thermal_instance as it is specific to the bind of a cooling device to a
    thermal zone parameter.

    Core thermal code is fixed to populate the weight in the instance from
    the thermal_bind_params, so platform code that was passing the weight
    inside the thermal_bind_params continue to work seamlessly.

    While we are at it, create a default value for the weight parameter for
    those thermal zones that currently don't define it and remove the
    hardcoded default in of-thermal.

    Cc: Zhang Rui
    Cc: "Rafael J. Wysocki"
    Cc: Len Brown
    Cc: Peter Feuerer
    Cc: Darren Hart
    Cc: Eduardo Valentin
    Cc: Kukjin Kim
    Cc: Durgadoss R
    Signed-off-by: Kapileshwar Singh
    Signed-off-by: Eduardo Valentin

    Kapileshwar Singh
     

25 Feb, 2015

2 commits


21 Dec, 2014

1 commit


12 Dec, 2014

1 commit


09 Dec, 2014

1 commit

  • In this patch, the cpu_cooling code checks for the usability of cpufreq
    layer before proceeding with the CPU cooling device registration. The
    main reason is: CPU cooling device is not usable if cpufreq cannot
    switch frequencies.

    Similar checks are spread in thermal drivers. Thus, the advantage now
    is to have the check in a single place: cpu cooling device registration.
    For this reason, this patch also updates the existing drivers that
    depend on CPU cooling to simply propagate the error code of the cpu
    cooling registration call. Therefore, in case cpufreq is not ready, the
    thermal drivers will still return -EPROBE_DEFER, in an attempt to try
    again when cpufreq layer gets ready.

    Cc: devicetree@vger.kernel.org
    Cc: Grant Likely
    Cc: Kukjin Kim
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-pm@vger.kernel.org
    Cc: linux-samsung-soc@vger.kernel.org
    Cc: Naveen Krishna Chatradhi
    Cc: Rob Herring
    Cc: Zhang Rui
    Acked-by: Viresh Kumar
    Signed-off-by: Viresh Kumar
    Signed-off-by: Eduardo Valentin

    Eduardo Valentin
     

20 Nov, 2014

1 commit

  • Different drivers request API extensions in of-thermal. For this reason,
    additional callbacks are required to fit the new drivers needs.

    The current API implementation expects the registering sensor driver
    to provide a get_temp and get_trend callbacks as function parameters.
    As the amount of callbacks is growing, this patch changes the existing
    implementation to use a .ops field to hold all the of thermal callbacks
    to sensor drivers.

    This patch also changes the existing of-thermal users to fit the new
    API design. No functional change is introduced in this patch.

    Cc: Alexandre Courbot
    Cc: devicetree@vger.kernel.org
    Cc: Grant Likely
    Cc: Guenter Roeck
    Cc: Jean Delvare
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-pm@vger.kernel.org
    Cc: linux-tegra@vger.kernel.org
    Cc: lm-sensors@lm-sensors.org
    Cc: Rob Herring
    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: Zhang Rui
    Acked-by: Guenter Roeck
    Tested-by: Mikko Perttunen
    Reviewed-by: Mikko Perttunen
    Reviewed-by: Alexandre Courbot
    Reviewed-by: Lukasz Majewski
    Signed-off-by: Eduardo Valentin

    Eduardo Valentin
     

01 Jul, 2014

1 commit


07 May, 2014

1 commit

  • Treat both negative and zero return values from clk_round_rate() as
    errors. This is needed since subsequent patches will convert
    clk_round_rate()'s return value to be an unsigned type, rather than a
    signed type, since some clock sources can generate rates higher than
    (2^31)-1 Hz.

    Eventually, when calling clk_round_rate(), only a return value of zero
    will be considered a error. All other values will be considered valid
    rates. The comparison against values less than 0 is kept to preserve
    the correct behavior in the meantime.

    This patch also gets rid of a comparison between unsigned and signed
    values; a side-benefit.

    Signed-off-by: Paul Walmsley
    Cc: Eduardo Valentin
    Cc: Zhang Rui
    Signed-off-by: Eduardo Valentin

    Paul Walmsley
     

08 Apr, 2014

1 commit


04 Dec, 2013

1 commit

  • This patch improves the ti-soc-thermal driver by adding the
    support to build the thermal zones based on DT nodes.

    The driver will have two options now to build the thermal
    zones. The first option is the zones originally coded
    in this driver. So, the driver behavior will be same
    if there is no DT node describing the zones. The second
    option, when it is found a DT node with thermal data,
    will used the common infrastructure to build the thermal
    zone and bind its cooling devices.

    In case the driver loads thermal data using the legacy
    mode, this driver still adds to the system
    a cpufreq cooling device. Loading the thermal data from
    DT, the driver assumes someone else will add the cpufreq
    cooling device, like the cpufreq driver.

    Cc: Zhang Rui
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin

    Eduardo Valentin
     

15 Oct, 2013

1 commit

  • This patch changes the behavior of TI SoC thermal driver
    when there is a PCB thermal zone.

    Instead of reporting an error code when reading from
    PCB temperature sensor fails, this patch will make
    the driver attempt to compose the hotspot extrapolation
    based on bandgap readings only.

    Cc: Zhang Rui
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin

    Eduardo Valentin
     

29 Aug, 2013

3 commits


08 Jul, 2013

1 commit

  • This change updates the ti-soc-thermal driver to use
    standard GPIO DT bindings to read the GPIO number associated
    to thermal shutdown IRQ, in case the device features it.

    Previously, the code was using a specific DT bindings.
    As now OMAP supports the standard way to model GPIOs,
    there is no point in having a ti specific binding.

    Cc: Zhang Rui
    Cc: Grant Likely
    Cc: Rob Herring
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree-discuss@lists.ozlabs.org
    Signed-off-by: Eduardo Valentin

    Eduardo Valentin
     

13 Jun, 2013

5 commits

  • Add support to TI dra752 chips by adapting the driver
    device table.

    Cc: Zhang Rui
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Eduardo Valentin
     
  • This patch adds the thermal data for TI DRA752 chips.
    In this change it includes (autogen):
    . Register offset definitions
    . Bitfields and masks for all registers
    . Conversion table

    Also, the thermal limits, thresholds and extrapolation
    rules are included. The extrapolation rule is simply
    add +2C as margin.

    All 5 sensors, MPU, GPU, CORE, DSPEVE and IVA, are defined
    and exposed. Only MPU has cooling device.

    Cc: Zhang Rui
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Eduardo Valentin
     
  • This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
    macro. This macro can lead to dangerous results, like returning
    success (0) during a failure scenario (NULL pointer handling).

    For this reason this patch is changing the driver after
    revisiting the code. These are the cases:
    i. For cases in which IS_ERR_OR_NULL() is used for checking
    return values of functions that returns either PTR_ERR()
    or a valid pointer, it has been translated to IS_ERR() check only.
    ii. For cases that a NULL check is still needed, it has been
    translated to if (!ptr || IS_ERR(ptr)).

    Cc: Zhang Rui
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Eduardo Valentin
     
  • In order to read the history buffer, it is required to
    freeze BG FSM. This patch adds the missing piece of code
    to freeze the FSM and also a contention area to avoid
    other parts of the code to access the DTEMPs.

    Cc: Zhang Rui
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Eduardo Valentin
     
  • For boards that provide a PCB sensor close to SoC junction
    temperature, it is possible to remove the cumulative heat
    reported by the SoC temperature sensor.

    This patch changes the extrapolation computation to consider
    an external sensor in the extrapolation equations.

    Cc: Zhang Rui
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Eduardo Valentin
     

28 May, 2013

1 commit

  • This patch moves the ti-soc-thermal driver out of
    the staging tree to the thermal tree.

    Cc: Grant Likely
    Cc: Rob Herring
    Cc: Rob Landley
    Cc: Greg Kroah-Hartman
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Cc: J Keerthy
    Cc: Radhesh Fadnis
    Cc: Cyril Roelandt
    Cc: devicetree-discuss@lists.ozlabs.org
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devel@driverdev.osuosl.org
    Cc: linux-pm@vger.kernel.org
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Eduardo Valentin