07 Jul, 2020

1 commit


30 Jun, 2020

6 commits

  • Setting polling_delay is now done at thermal_core level (by not polling
    DISABLED devices), so no need to repeat this code.

    int340x: Checking for an impossible enum value is unnecessary.
    acpi/thermal: It only prints debug messages.

    Signed-off-by: Andrzej Pietrasiewicz
    [for acerhdf]
    Acked-by: Peter Kaestle
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200629122925.21729-11-andrzej.p@collabora.com

    Andrzej Pietrasiewicz
     
  • Use thermal_zone_device_{en|dis}able() and thermal_zone_device_is_enabled().

    Consequently, all set_mode() implementations in drivers:

    - can stop modifying tzd's "mode" member,
    - shall stop taking tzd's lock, as it is taken in the helpers
    - shall stop calling thermal_zone_device_update() as it is called in the
    helpers
    - can assume they are called when the mode truly changes, so checks to
    verify that can be dropped

    Not providing set_mode() by a driver no longer prevents the core from
    being able to set tzd's mode, so the relevant check in mode_store() is
    removed.

    Other comments:

    - acpi/thermal.c: tz->thermal_zone->mode will be updated only after we
    return from set_mode(), so use function parameter in thermal_set_mode()
    instead, no need to call acpi_thermal_check() in set_mode()
    - thermal/imx_thermal.c: regmap writes and mode assignment are done in
    thermal_zone_device_{en|dis}able() and set_mode() callback
    - thermal/intel/intel_quark_dts_thermal.c: soc_dts_{en|dis}able() are a
    part of set_mode() callback, so they don't need to modify tzd->mode, and
    don't need to fall back to the opposite mode if unsuccessful, as the return
    value will be propagated to thermal_zone_device_{en|dis}able() and
    ultimately tzd's member will not be changed in thermal_zone_device_set_mode().
    - thermal/of-thermal.c: no need to set zone->mode to DISABLED in
    of_parse_thermal_zones() as a tzd is kzalloc'ed so mode is DISABLED anyway

    Signed-off-by: Andrzej Pietrasiewicz
    [for acerhdf]
    Acked-by: Peter Kaestle
    Reviewed-by: Amit Kucheria
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200629122925.21729-8-andrzej.p@collabora.com

    Andrzej Pietrasiewicz
     
  • get_mode() is now redundant, as the state is stored in struct
    thermal_zone_device.

    Consequently the "mode" attribute in sysfs can always be visible, because
    it is always possible to get the mode from struct tzd.

    Signed-off-by: Andrzej Pietrasiewicz
    [for acerhdf]
    Acked-by: Peter Kaestle
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200629122925.21729-6-andrzej.p@collabora.com

    Andrzej Pietrasiewicz
     
  • Prepare for eliminating get_mode().

    Signed-off-by: Andrzej Pietrasiewicz
    [for acerhdf]
    Acked-by: Peter Kaestle
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200629122925.21729-5-andrzej.p@collabora.com

    Andrzej Pietrasiewicz
     
  • Prepare for storing mode in struct thermal_zone_device.

    Signed-off-by: Andrzej Pietrasiewicz
    Reviewed-by: Guenter Roeck
    [for acerhdf]
    Acked-by: Peter Kaestle
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200629122925.21729-3-andrzej.p@collabora.com

    Andrzej Pietrasiewicz
     
  • The acpi_thermal_register_thermal_zone() is missing any error handling.
    This needs to be fixed.

    Signed-off-by: Andrzej Pietrasiewicz
    Reviewed-by: Guenter Roeck
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200629122925.21729-2-andrzej.p@collabora.com

    Andrzej Pietrasiewicz
     

01 Feb, 2020

1 commit

  • This switches the ACPI thermal zone driver to use
    celsius_to_deci_kelvin(), deci_kelvin_to_celsius(), and
    deci_kelvin_to_millicelsius_with_offset() in instead of
    helpers in .

    This is preparation for centralizing the kelvin to/from Celsius
    conversion helpers in .

    Link: http://lkml.kernel.org/r/1576386975-7941-3-git-send-email-akinobu.mita@gmail.com
    Signed-off-by: Akinobu Mita
    Cc: Sujith Thomas
    Cc: Darren Hart
    Cc: Andy Shevchenko
    Cc: Zhang Rui
    Cc: Daniel Lezcano
    Cc: Amit Kucheria
    Cc: Jean Delvare
    Cc: Guenter Roeck
    Cc: Keith Busch
    Cc: Jens Axboe
    Cc: Christoph Hellwig
    Cc: Sagi Grimberg
    Cc: Andy Shevchenko
    Cc: Emmanuel Grumbach
    Cc: Hartmut Knaack
    Cc: Johannes Berg
    Cc: Jonathan Cameron
    Cc: Jonathan Cameron
    Cc: Kalle Valo
    Cc: Lars-Peter Clausen
    Cc: Luca Coelho
    Cc: Peter Meerwald-Stadler
    Cc: Stanislaw Gruszka
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

03 Sep, 2019

1 commit


31 May, 2019

1 commit

  • Based on 3 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 as published by
    the free software foundation either version 2 of the license or at
    your option any later version 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

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [kishon] [vijay] [abraham]
    [i] [kishon]@[ti] [com] 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

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [graeme] [gregory]
    [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
    [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
    [hk] [hemahk]@[ti] [com] 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 1105 file(s).

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

    Thomas Gleixner
     

14 Sep, 2017

1 commit


25 Dec, 2016

1 commit


27 Sep, 2016

1 commit

  • Added one additional parameter to thermal_zone_device_update() to provide
    caller with an optional capability to specify reason.
    Currently this event is used by user space governor to trigger different
    processing based on event code. Also it saves an additional call to read
    temperature when the event is received.
    The following events are cuurently defined:
    - Unspecified event
    - New temperature sample
    - Trip point violated
    - Trip point changed
    - thermal device up and down
    - thermal device power capability changed

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Zhang Rui

    Srinivas Pandruvada
     

22 Jun, 2016

1 commit

  • alloc_workqueue replaces deprecated create_workqueue().

    A dedicated workqueue has been used since the workqueue
    acpi_thermal_pm_queue with workitem &tz->thermal_check_work
    (maps to acpi_thermal_check_fn), is involved in thermal zone polling.
    Wallclock time is actually important and getting delayed in handling
    critical temperature event can actually lead to unnecessary hardware
    damage. So while this is not used during memory reclaim, we still want
    forward progress guarantee and be generally snappy in servicing it.
    Hence, WQ_MEM_RECLAIM and WQ_HIGHPRI have been used here.

    Since there are only a fixed number of work items, explicit concurrency
    limit is unnecessary here.

    Signed-off-by: Bhaktipriya Shridhar
    Acked-by: Tejun Heo
    Signed-off-by: Rafael J. Wysocki

    Bhaktipriya Shridhar
     

10 Oct, 2015

1 commit


12 Sep, 2015

1 commit

  • 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

    Linus Torvalds
     

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
     

08 Jul, 2015

1 commit


05 May, 2015

1 commit

  • 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
     

10 Oct, 2014

1 commit


29 May, 2014

1 commit


27 May, 2014

1 commit


26 May, 2014

1 commit

  • When the thermal module is to be removed, we should destroy the wq
    acpi_thermal_pm_queue after the ACPI driver's remove callback is
    executed as we will need to flush the workqueue there, or a NULL pointer
    access will be hit.

    Reported-and-tested-by: Kui Zhang
    References: http://www.spinics.net/lists/kernel/msg1747251.html
    Cc: All applicable
    Signed-off-by: Aaron Lu
    Signed-off-by: Rafael J. Wysocki

    Aaron Lu
     

07 Apr, 2014

1 commit


05 Mar, 2014

1 commit


13 Feb, 2014

1 commit


13 Jan, 2014

1 commit

  • * acpi-gpe:
    ACPI / EC: disable GPE before removing GPE handler
    ACPI / Button: Fix enabling button GPEs twice

    * acpi-video:
    ACPI: Blacklist Win8 OSI for some HP laptop 2013 models
    ACPI / video: Fix typo in video_detect.c

    * acpi-thermal:
    ACPI / thermal: remove const from thermal_zone_device_ops declaration

    * acpi-processor:
    ACPI / scan: bail out early if failed to parse APIC ID for CPU

    * acpi-sleep:
    ACPI / sleep: remove panic in case hardware has changed after S4

    Rafael J. Wysocki
     

08 Jan, 2014

1 commit

  • The following commit introduced the requirement to not declare
    thermal_zone_device_ops structs as const in order to allow
    changing the .get_temp callback.

    commit 4e5e4705bf69ea450f58fc709ac5888f321a9299
    Author: Eduardo Valentin
    Date: Wed Jul 3 15:35:39 2013 -0400

    thermal: introduce device tree parser

    Modify acpi_thermal_zone_ops to follow the new requirement.

    Signed-off-by: Emil Goode
    Acked-by: Eduardo Valentin
    [rjw: Changelog]
    Signed-off-by: Rafael J. Wysocki

    Emil Goode
     

07 Dec, 2013

1 commit

  • Replace direct inclusions of , and
    , which are incorrect, with
    inclusions and remove some inclusions of those files that aren't
    necessary.

    First of all, , and
    should not be included directly from any files that are built for
    CONFIG_ACPI unset, because that generally leads to build warnings about
    undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
    includes those files and for CONFIG_ACPI unset it
    provides stub ACPI symbols to be used in that case.

    Second, there are ordering dependencies between those files that always
    have to be met. Namely, it is required that be included
    prior to so that the acpi_pci_root declarations the
    latter depends on are always there. And which provides
    basic ACPICA type declarations should always be included prior to any other
    ACPI headers in CONFIG_ACPI builds. That also is taken care of including
    as appropriate.

    Signed-off-by: Lv Zheng
    Cc: Greg Kroah-Hartman
    Cc: Matthew Garrett
    Cc: Tony Luck
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas (drivers/pci stuff)
    Acked-by: Konrad Rzeszutek Wilk (Xen stuff)
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

14 Nov, 2013

1 commit

  • Pull thermal management updates from Zhang Rui:
    "This time we only have a few changes as there are no soc thermal
    changes from Eduardo. The only big change is the introduction of
    TMON, a tool to help visualize, tune, and test the thermal subsystem.
    The rest is mostly cleanups and fixes all over.

    Specifics:

    - introduce TMON, a tool base on thermal sysfs I/F. It can be used
    to visualize, tune and test the thermal subsystem.

    - fix a zone/cooling device binding problem, when both thermal zone
    bind parameters and .bind() callback are available"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
    tools/thermal: Introduce tmon, a tool for thermal subsystem
    thermal: Fix binding problem when there is thermal zone params
    thermal: cpu_cooling: fix return value check in cpufreq_cooling_register()
    Thermal: Check for validity before doing kfree
    thermal/intel_powerclamp: Add newer CPU models
    Thermal: Tidy up error handling in powerclamp_init
    thermal: Kconfig: cosmetic fixes
    ACPI/thermal : Remove zone disabled warning
    typo in drivers/thermal/Kconfig: lpatform instead of platform

    Linus Torvalds
     

01 Oct, 2013

1 commit


30 Sep, 2013

1 commit

  • Once thermal zone is disabled to move thermal control to user space,
    too many warnings printed in logs. Remove pr_warn from this path,
    instead warn when user mode issues request to disable thermal zone.

    Signed-off-by: Srinivas Pandruvada
    Acked-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Srinivas Pandruvada
     

30 Aug, 2013

1 commit


29 Aug, 2013

1 commit


27 Aug, 2013

1 commit

  • * acpi-assorted:
    ACPI / osl: Kill macro INVALID_TABLE().
    earlycpio.c: Fix the confusing comment of find_cpio_data().
    ACPI / x86: Print Hot-Pluggable Field in SRAT.
    ACPI / thermal: Use THERMAL_TRIPS_NONE macro to replace number
    ACPI / thermal: Remove unused macros in the driver/acpi/thermal.c
    ACPI / thermal: Remove the unused lock of struct acpi_thermal
    ACPI / osl: Fix osi_setup_entries[] __initdata attribute location
    ACPI / numa: Fix __init attribute location in slit_valid()
    ACPI / dock: Fix __init attribute location in find_dock_and_bay()
    ACPI / Sleep: Fix incorrect placement of __initdata
    ACPI / processor: Fix incorrect placement of __initdata
    ACPI / EC: Fix incorrect placement of __initdata
    ACPI / scan: Drop unnecessary label from acpi_create_platform_device()
    ACPI: Move acpi_bus_get_device() from bus.c to scan.c
    ACPI / scan: Allow platform device creation without any IO resources
    ACPI: Cleanup sparse warning on acpi_os_initialize1()
    platform / thinkpad: Remove deprecated hotkey_report_mode parameter
    ACPI: Remove the old /proc/acpi/event interface

    Rafael J. Wysocki
     

15 Aug, 2013

3 commits


15 Jul, 2013

2 commits