08 Apr, 2020

1 commit

  • Pull thermal updates from Daniel Lezcano:

    - Convert tsens configuration DT binding to yaml (Rajeshwari)

    - Add interrupt support on the rcar sensor (Niklas Söderlund)

    - Add a new Spreadtrum thermal driver (Baolin Wang)

    - Add thermal binding for the fsl scu board, a new API to retrieve the
    sensor id bound to the thermal zone and i.MX system controller sensor
    (Anson Huang))

    - Remove warning log when a deferred probe is requested on Exynos
    (Marek Szyprowski)

    - Add the thermal monitoring unit support for imx8mm with its DT
    bindings (Anson Huang)

    - Rephrase the Kconfig text for clarity (Linus Walleij)

    - Use the gpio descriptor for the ti-soc-thermal (Linus Walleij)

    - Align msg structure to 4 bytes for i.MX SC, fix the Kconfig
    dependency, add the __may_be unused annotation for PM functions and
    the COMPILE_TEST option for imx8mm (Anson Huang)

    - Fix a dependency on regmap in Kconfig for qoriq (Yuantian Tang)

    - Add DT binding and support for the rcar gen3 r8a77961 and improve the
    error path on the rcar init function (Niklas Söderlund)

    - Cleanup and improvements for the tsens Qcom sensor (Amit Kucheria)

    - Improve code by removing lock and caching values in the rcar thermal
    sensor (Niklas Söderlund)

    - Cleanup in the qoriq drivers and add a call to
    imx_thermal_unregister_legacy_cooling in the removal function (Anson
    Huang)

    - Remove redundant 'maxItems' in tsens and sprd DT bindings (Rob
    Herring)

    - Change the thermal DT bindings by making the cooling-maps optional
    (Yuantian Tang)

    - Add Tiger Lake support (Sumeet Pawnikar)

    - Use scnprintf() for avoiding potential buffer overflow (Takashi Iwai)

    - Make pkg_temp_lock a raw_spinlock_t(Clark Williams)

    - Fix incorrect data types by changing them to signed on i.MX SC (Anson
    Huang)

    - Replace zero-length array with flexible-array member (Gustavo A. R.
    Silva)

    - Add support for i.MX8MP in the driver and in the DT bindings (Anson
    Huang)

    - Fix return value of the cpufreq_set_cur_state() function (Willy
    Wolff)

    - Remove abusing and scary WARN_ON in the cpufreq cooling device
    (Daniel Lezcano)

    - Fix build warning of incorrect argument type reported by sparse on
    imx8mm (Anson Huang)

    - Fix stub for the devfreq cooling device (Martin Blumenstingl)

    - Fix cpu idle cooling documentation (Sergey Vidishev)

    * tag 'thermal-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (52 commits)
    Documentation: cpu-idle-cooling: Fix diagram for 33% duty cycle
    thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n
    thermal: imx8mm: Fix build warning of incorrect argument type
    thermal/drivers/cpufreq_cooling: Remove abusing WARN_ON
    thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state
    thermal: imx8mm: Add i.MX8MP support
    dt-bindings: thermal: imx8mm-thermal: Add support for i.MX8MP
    thermal: qcom: tsens.h: Replace zero-length array with flexible-array member
    thermal: imx_sc_thermal: Fix incorrect data type
    thermal: int340x_thermal: Use scnprintf() for avoiding potential buffer overflow
    thermal: int340x: processor_thermal: Add Tiger Lake support
    thermal/x86_pkg_temp: Make pkg_temp_lock a raw_spinlock_t
    dt-bindings: thermal: make cooling-maps property optional
    dt-bindings: thermal: qcom-tsens: Remove redundant 'maxItems'
    dt-bindings: thermal: sprd: Remove redundant 'maxItems'
    thermal: imx: Calling imx_thermal_unregister_legacy_cooling() in .remove
    thermal: qoriq: Sort includes alphabetically
    thermal: qoriq: Use devm_add_action_or_reset() to handle all cleanups
    thermal: rcar_thermal: Remove lock in rcar_thermal_get_current_temp()
    thermal: rcar_thermal: Do not store ctemp in rcar_thermal_priv
    ...

    Linus Torvalds
     

25 Mar, 2020

1 commit


23 Mar, 2020

1 commit


24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 or
    later as published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 6 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520075211.856638608@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

04 Jan, 2019

1 commit

  • Using -O3 instead of -O1 if it's supported by compiler.

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Brian Norris
    Cc: Markus Mayer
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Zhang Rui
    Link: http://lkml.kernel.org/r/20190103161350.11446-2-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

29 Dec, 2018

1 commit


27 Mar, 2018

1 commit

  • Fixes a segfault occurring when e.g. is pressed multiple times in the
    ncurses tmon application. The segfault is caused by incrementing
    cur_thermal_record in the main function without checking if it's value reached
    NR_THERMAL_RECORD immediately. Since the boundary check only occurred in
    update_thermal_data a race condition existed, which lead to an attempted read
    beyond the last element of the trec array.

    The fix was implemented by moving the cur_thermal_record incrementation to the
    update_thermal_data function using a temporary variable on which the boundary
    condition is checked before updating cur_thread_record, so that the variable is
    never incremented beyond the trec array's boundary.

    It seems the segfault does not occur on every machine: On a HP EliteBook G4 the
    segfault happens, while it does not happen on a Thinkpad T540p.

    Signed-off-by: Frank Asseg
    Signed-off-by: Jiri Kosina

    Frank Asseg
     

18 Nov, 2017

1 commit

  • Pull thermal management updates from Zhang Rui:

    - introduce brcmstb AVS TMON thermal driver (Brian Norris)

    - add Rockchip RV1108 support in rockchip thermal driver (Rocky Hao)

    - major rework on HISI driver plus additional support of hisi3660
    (Daniel Lezcano)

    - add nvmem-cells binding on imx6sx (Leonard Crestez)

    - fix a NULL pointer dereference on ti thermal driver unloading (Tony
    Lindgren)

    - improve tmon tool to make it easier to cross-compile tmon (Markus
    Mayer)

    - add Coffee Lake and Cannon Lake support for intel processor and pch
    thermal drivers (Srinivas Pandruvada)

    - other small fixes and cleanups (Arvind Yadav, Colin Ian King, Allen
    Wild, Nicolin Chen, Baruch SiachNiklas Söderlund, Arnd Bergmann)

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (44 commits)
    thermal: pch: Add Cannon Lake support
    thermal: int340x: processor_thermal: Add Coffee Lake support
    thermal: int340x: processor_thermal: Add Cannon Lake support
    thermal: bxt: remove redundant variable trip
    thermal: cpu_cooling: pr_err() strings should end with newlines
    thermal: add brcmstb AVS TMON driver
    Documentation: devicetree: add binding for Broadcom STB AVS TMON
    thermal/drivers/hisi: Add support for hi3660 SoC
    thermal/drivers/hisi: Prepare to add support for other hisi platforms
    thermal/drivers/hisi: Add platform prefix to function name
    thermal/drivers/hisi: Put platform code together
    thermal/drivers/qcom-spmi: Use devm_iio_channel_get
    thermal/drivers/generic-iio-adc: Switch tz request to devm version
    thermal/drivers/step_wise: Fix temperature regulation misbehavior
    thermal/drivers/hisi: Use round up step value
    thermal/drivers/hisi: Move the clk setup in the corresponding functions
    thermal/drivers/hisi: Remove mutex_lock in the code
    thermal/drivers/hisi: Remove thermal data back pointer
    thermal/drivers/hisi: Convert long to int
    thermal/drivers/hisi: Rename and remove unused field
    ...

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Oct, 2017

3 commits


10 Oct, 2015

1 commit


09 May, 2015

1 commit

  • To install tmon we issue "make install" which produces bellow error.

    root@odroidxu3:/usr/src/odroidxu3-4.y-testing/tools/thermal/tmon# make install
    mkdir -p /usr/bin
    install -m 755 -p "tmon" "/usr/bin/tmon"
    mkdir -p /
    install -m 644 -p "" "/"
    install: cannot stat ‘’: No such file or directory
    make: [install] Error 1 (ignored)

    Signed-off-by: Anand Moon
    Acked-by: Jacob Pan
    Signed-off-by: Zhang Rui

    Anand Moon
     

28 Feb, 2015

8 commits

  • gcc complains about the 'cols' variable being unused. This is
    unavoidable, given the ncurses getmaxyx() macro-based API, which wants
    to assign to a variable directly, even when we're not going to use it.

    Warning:

    gcc -O1 -Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int -fstack-protector -D VERSION=\"1.0\" -c -o tui.o tui.c
    tui.c: In function ‘show_dialogue’:
    tui.c:288:12: warning: variable ‘cols’ set but not used [-Wunused-but-set-variable]
    int rows, cols;
    ^

    So, add a hack to get rid of that warning.

    Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     
  • Some distros (e.g., Arch Linux) don't package the tinfo library
    separately from ncurses, so don't unconditionally include it. Instead,
    use pkg-config.

    The $(STATIC) ugliness is to handle the reported build case from commit
    6b533269fb25 ("tools/thermal: tmon: fix compilation errors when building
    statically"), where a developer wants to be able to build with:

    make LDFLAGS=-static

    which requires an additional pkg-config flag.

    Finally, support a lowest common denominator fallback (-lpanel
    -lncurses) for build systems that don't have pkg-config entries for
    ncurses.

    Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     
  • We might want to prepare CFLAGS outside of this Makefile, so don't
    overwrite its initial value.

    Then, support $(CROSS_COMPILE), so we can use a cross-compile toolchain.

    Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     
  • Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     
  • The number of rows in the dialog vary according to the number of cooling
    devices. However, some of the windowing computations were assuming a
    fixed number of rows. This computation is OK when we have between 4 and
    9 cooling devices (and they wrap to the next column), but with fewer
    devices, we end up printing off the end of the window.

    This unifies the row computation into a single function and uses that
    throughout the TUI code. This also accounts for increasing the number of
    rows when there are more than 9 total cooling devices.

    Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     
  • We can use the ncurses API to get the number of rows.

    Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     
  • Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     
  • If we launch in daemon mode (--daemon), we don't have the ncurses UI,
    but we might want to set the target temperature still. For example,
    someone might stick the following in their boot script:

    tmon --control intel_powerclamp --target-temp 90 --log --daemon

    This would turn on CPU idle injection when we're around 90 degrees
    celsius, and would log temperature and throttling info to
    /var/tmp/tmon.log.

    Signed-off-by: Brian Norris
    Acked-by: Jacob Pan
    Reviewed-by: Florian Fainelli
    Signed-off-by: Zhang Rui

    Brian Norris
     

09 Dec, 2014

1 commit

  • The calloc() and xcalloc() functions takes @nmemb first and then @size. Fix all w/
    pattern "calloc\s*(\s*sizeof".

    Signed-off-by: Arjun Sreedharan
    Cc: "Yann E. MORIN"
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1417866043-1877-1-git-send-email-arjun024@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Arjun Sreedharan
     

01 Jul, 2014

3 commits

  • Currently, the tmon umask value is set to 0, which means whatever the permission
    mask in the shell are when starting tmon in daemon mode are what the permissions
    of any created files will be. We should likely set something more explicit, so
    lets go with the usual 022

    Signed-off-by: Neil Horman
    Acked-by: Jacob Pan
    Signed-off-by: Zhang Rui

    Neil Horman
     
  • The tmon logging system blindly opens its log file on a static path, making it
    very easy for someone to redirect that log information to inappropriate places
    or overwrite other users data. Do some easy checking to make sure we're not
    logging to a symlink or a file owned by another user.

    Signed-off-by: Neil Horman
    Acked-by: Jacob Pan
    Signed-off-by: Zhang Rui

    Neil Horman
     
  • tmon fails to build statically with the following error:

    $ make LDFLAGS=-static
    gcc -O1 -Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int -fstack-protector -D VERSION=\"1.0\" -static tmon.o tui.o sysfs.o pid.o -o tmon -lm -lpanel -lncursesw -lpthread
    tmon.o: In function `tmon_sig_handler':
    tmon.c:(.text+0x21): undefined reference to `stdscr'
    tmon.o: In function `tmon_cleanup':
    tmon.c:(.text+0xb9): undefined reference to `stdscr'
    tmon.c:(.text+0x11e): undefined reference to `stdscr'
    tmon.c:(.text+0x123): undefined reference to `keypad'
    tmon.c:(.text+0x12d): undefined reference to `nocbreak'
    tmon.o: In function `main':
    tmon.c:(.text+0x785): undefined reference to `stdscr'
    tmon.c:(.text+0x78a): undefined reference to `nodelay'
    tui.o: In function `setup_windows':
    tui.c:(.text+0x131): undefined reference to `stdscr'
    tui.c:(.text+0x176): undefined reference to `stdscr'
    tui.c:(.text+0x19f): undefined reference to `stdscr'
    tui.c:(.text+0x1cc): undefined reference to `stdscr'
    tui.c:(.text+0x1ff): undefined reference to `stdscr'
    tui.o:tui.c:(.text+0x229): more undefined references to `stdscr' follow
    tui.o: In function `show_cooling_device':
    [...]

    stdscr() and friends are in libtinfo (part of ncurses) so add it to
    the libraries that are linked in when compiling tmon to fix it.

    Cc: Jacob Pan
    Cc: Zhang Rui
    Signed-off-by: Javi Merino
    Acked-by: Jacob Pan

    Javi Merino
     

07 Nov, 2013

1 commit

  • Increasingly, Linux is running on thermally constrained devices. The simple
    thermal relationship between processor and fan has become past for modern
    computers.

    As hardware vendors cope with the thermal constraints on their products,
    more sensors are added, new cooling capabilities are introduced. The
    complexity of the thermal relationship can grow exponentially among cooling
    devices, zones, sensors, and trip points. They can also change dynamically.

    To expose such relationship to the userspace, Linux generic thermal layer
    introduced sysfs entry at /sys/class/thermal with a matrix of symbolic
    links, trip point bindings, and device instances. To traverse such
    matrix by hand is not a trivial task. Testing is also difficult in that
    thermal conditions are often exception cases that hard to reach in
    normal operations.

    TMON is conceived as a tool to help visualize, tune, and test the
    complex thermal subsystem.

    Signed-off-by: Jacob Pan
    Signed-off-by: Zhang Rui

    Jacob Pan