07 Jul, 2020
1 commit
-
thermal_zone_device_update() can now handle disabled thermal zones, so
the check here is not needed.Signed-off-by: Andrzej Pietrasiewicz
Signed-off-by: Daniel Lezcano
Link: https://lore.kernel.org/r/20200703104354.19657-2-andrzej.p@collabora.com
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 -
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 droppedNot 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 anywaySigned-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 -
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 -
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 -
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 -
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
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
03 Sep, 2019
1 commit
-
The following acpi_has_method() calls are unnecessary since
acpi_execute_simple_method() and acpi_evaluate_reference() will
return an error if the given method does not exist.Remove acpi_has_method() calls to avoid additional work.
Signed-off-by: Kelsey Skunberg
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki
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 detailsthis 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 detailsthis 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 detailsextracted 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
14 Sep, 2017
1 commit
-
... and __initconst if applicable.
Based on similar work for an older kernel in the Grsecurity patch.
[JD: fix toshiba-wmi build]
[JD: add htcpen]
[JD: move __initconst where checkscript wants it]Signed-off-by: Christoph Hellwig
Signed-off-by: Jean Delvare
25 Dec, 2016
1 commit
-
This was entirely automated, using the script by Al:
PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
sed -i -e "s!$PATT!#include !" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)to do the replacement at the end of the merge window.
Requested-by: Al Viro
Signed-off-by: Linus Torvalds
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 changedSigned-off-by: Srinivas Pandruvada
Signed-off-by: Zhang Rui
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
10 Oct, 2015
1 commit
-
The macros KELVIN_TO_CELSIUS and CELSIUS_TO_KELVIN actually convert
between deciKelvins and Celsius, so rename them to reflect that. While
at it, use a statement expression in DECI_KELVIN_TO_CELSIUS to prevent
expanding the argument multiple times and get rid of a few casts.Signed-off-by: Rasmus Villemoes
Acked-by: Darren Hart
Signed-off-by: Zhang Rui
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
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
08 Jul, 2015
1 commit
-
There is no need to carry potentially outdated Free Software Foundation
mailing address in file headers since the COPYING file includes it.Signed-off-by: Jarkko Nikula
Signed-off-by: Rafael J. Wysocki
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
10 Oct, 2014
1 commit
-
This macro can be used by other component so move it to a common header,
but in a slightly different way: define two macros, one macro with an
offset and the other doesn't.Signed-off-by: Aaron Lu
Signed-off-by: Zhang Rui
29 May, 2014
1 commit
27 May, 2014
1 commit
-
Use acpi_bus_attach_private_data() to attach private data
instead of acpi_attach_data().Reviewed-by: Mika Westerberg
Signed-off-by: Lan Tianyu
Signed-off-by: Rafael J. Wysocki
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
07 Apr, 2014
1 commit
-
A debug statement in acpi_thermal_trips_update() uses a wrong trip
point (tz->trips.critical instead of tz->trips.hot) to get the
temperature value from. Fix that.Signed-off-by: Zhihui Zhang
[rjw: Subject and changelog]
Signed-off-by: Rafael J. Wysocki
05 Mar, 2014
1 commit
-
On resume we do not need to wait for acpi_thermal_check to finish.
Instead, we can run it asynchronously and not block the whole system
resume. Also, we make sure when we are suspending again, previously
queued work for acpi_thermal_check is done.Signed-off-by: Aaron Lu
Signed-off-by: Rafael J. Wysocki
13 Feb, 2014
1 commit
-
The ACPI thermal driver defines acpi_thermal_resume() when
CONFIG_PM_SLEEP is defined. This results in the following compile
error when CONFIG_PM_SLEEP is undefined.CC drivers/acpi/thermal.o
drivers/acpi/thermal.c:107:8: error: ‘acpi_thermal_resume’ undeclared here (not in a function)
make[2]: *** [drivers/acpi/thermal.o] Error 1Signed-off-by: Shuah Khan
Signed-off-by: Rafael J. Wysocki
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
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 -0400thermal: 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
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
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
01 Oct, 2013
1 commit
-
Convert printks to pr_* format. Additionally re-use PREFIX constant instead of
hardcoded strings.Signed-off-by: Andy Shevchenko
Signed-off-by: Rafael J. Wysocki
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
30 Aug, 2013
1 commit
-
* acpi-assorted:
ACPI / EC: Add ASUSTEK L4R to quirk list in order to validate ECDT
ACPI / thermal: Add check of "_TZD" availability and evaluating result
29 Aug, 2013
1 commit
-
Some machines don't provide _TZD, so check the availability of it
before carrying out futher operations.If _TZD is present, also check the result of its evaluation.
[rjw: Changelog]
Signed-off-by: Lan Tianyu
Signed-off-by: Rafael J. Wysocki
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
15 Aug, 2013
3 commits
-
It's unreadable to pass "-1" as trip parameter directly to
thermal_zone_bind_cooling_device(). Use THERMAL_TRIPS_NONE instead.Signed-off-by: Lan Tianyu
Acked-by: Zhang Rui
Acked-by: Durgadoss R
Signed-off-by: Rafael J. Wysocki -
The ACPI_THERMAL_FILE* macros are not used now, so remove them.
Signed-off-by: Lan Tianyu
Acked-by: Zhang Rui
Acked-by: Durgadoss R
Signed-off-by: Rafael J. Wysocki -
The acpi_thermal->lock now just is initialized when a thermal zone
device is added and destroyed when the thermal zone is removed.
It is never used in any other places, so remove it.Signed-off-by: Lan Tianyu
Acked-by: Zhang Rui
Acked-by: Durgadoss R
Signed-off-by: Rafael J. Wysocki
15 Jul, 2013
2 commits
-
It is quite some time that this one has been deprecated.
Get rid of it.Should some really important user be overseen, it may be reverted and
the userspace program worked on first, but it is time to do something
to get rid of this old stuff...Signed-off-by: Thomas Renninger
Acked-by: Matthew Garrett
Acked-by: Henrique de Moraes Holschuh
Signed-off-by: Rafael J. Wysocki -
Introduce helper function acpi_execute_simple_method() and use it in
a number of places to simplify code.[rjw: Changelog]
Signed-off-by: Jiang Liu
Signed-off-by: Rafael J. Wysocki