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
     

07 Apr, 2020

1 commit

  • Pull more ACPI updates from Rafael Wysocki:
    "Additional ACPI updates.

    These update the ACPICA code in the kernel to the 20200326 upstream
    revision, fix an ACPI-related CPU hotplug deadlock on x86, update
    Intel Tiger Lake device IDs in some places, add a new ACPI backlight
    blacklist entry, update the "acpi_backlight" kernel command line
    switch documentation and clean up a CPPC library routine.

    Specifics:

    - Update the ACPICA code in the kernel to upstream revision 20200326
    including:
    * Fix for a typo in a comment field (Bob Moore)
    * acpiExec namespace init file fixes (Bob Moore)
    * Addition of NHLT to the known tables list (Cezary Rojewski)
    * Conversion of PlatformCommChannel ASL keyword to PCC (Erik
    Kaneda)
    * acpiexec cleanup (Erik Kaneda)
    * WSMT-related typo fix (Erik Kaneda)
    * sprintf() utility function fix (John Levon)
    * IVRS IVHD type 11h parsing implementation (Michał Żygowski)
    * IVRS IVHD type 10h reserved field name fix (Michał Żygowski)

    - Fix ACPI-related CPU hotplug deadlock on x86 (Qian Cai)

    - Fix Intel Tiger Lake ACPI device IDs in several places (Gayatri
    Kammela)

    - Add ACPI backlight blacklist entry for Acer Aspire 5783z (Hans de
    Goede)

    - Fix documentation of the "acpi_backlight" kernel command line
    switch (Randy Dunlap)

    - Clean up the acpi_get_psd_map() CPPC library routine (Liguang
    Zhang)"

    * tag 'acpi-5.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    x86: ACPI: fix CPU hotplug deadlock
    thermal: int340x_thermal: fix: Update Tiger Lake ACPI device IDs
    platform/x86: intel-hid: fix: Update Tiger Lake ACPI device ID
    ACPI: Update Tiger Lake ACPI device IDs
    ACPI: video: Use native backlight on Acer Aspire 5783z
    ACPI: video: Docs update for "acpi_backlight" kernel parameter options
    ACPICA: Update version 20200326
    ACPICA: Fixes for acpiExec namespace init file
    ACPICA: Add NHLT table signature
    ACPICA: WSMT: Fix typo, no functional change
    ACPICA: utilities: fix sprintf()
    ACPICA: acpiexec: remove redeclaration of acpi_gbl_db_opt_no_region_support
    ACPICA: Change PlatformCommChannel ASL keyword to PCC
    ACPICA: Fix IVRS IVHD type 10h reserved field name
    ACPICA: Implement IVRS IVHD type 11h parsing
    ACPICA: Fix a typo in a comment field
    ACPI: CPPC: clean up acpi_get_psd_map()

    Linus Torvalds
     

01 Apr, 2020

1 commit

  • Tiger Lake's new unique ACPI device IDs for Intel thermal driver are not
    valid because of missing 'C' in the IDs. Fix the IDs by updating them.

    After the update, the new IDs should now look like
    INT1040 --> INTC1040
    INT1043 --> INTC1043

    Fixes: 9b1b5535dfc9 ("thermal: int340x_thermal: Add Tiger Lake ACPI device IDs")
    Cc: 5.6+ # 5.6+
    Suggested-by: Srinivas Pandruvada
    Signed-off-by: Gayatri Kammela
    Acked-by: Zhang Rui
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Gayatri Kammela
     

31 Mar, 2020

2 commits

  • Pull scheduler updates from Ingo Molnar:
    "The main changes in this cycle are:

    - Various NUMA scheduling updates: harmonize the load-balancer and
    NUMA placement logic to not work against each other. The intended
    result is better locality, better utilization and fewer migrations.

    - Introduce Thermal Pressure tracking and optimizations, to improve
    task placement on thermally overloaded systems.

    - Implement frequency invariant scheduler accounting on (some) x86
    CPUs. This is done by observing and sampling the 'recent' CPU
    frequency average at ~tick boundaries. The CPU provides this data
    via the APERF/MPERF MSRs. This hopefully makes our capacity
    estimates more precise and keeps tasks on the same CPU better even
    if it might seem overloaded at a lower momentary frequency. (As
    usual, turbo mode is a complication that we resolve by observing
    the maximum frequency and renormalizing to it.)

    - Add asymmetric CPU capacity wakeup scan to improve capacity
    utilization on asymmetric topologies. (big.LITTLE systems)

    - PSI fixes and optimizations.

    - RT scheduling capacity awareness fixes & improvements.

    - Optimize the CONFIG_RT_GROUP_SCHED constraints code.

    - Misc fixes, cleanups and optimizations - see the changelog for
    details"

    * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (62 commits)
    threads: Update PID limit comment according to futex UAPI change
    sched/fair: Fix condition of avg_load calculation
    sched/rt: cpupri_find: Trigger a full search as fallback
    kthread: Do not preempt current task if it is going to call schedule()
    sched/fair: Improve spreading of utilization
    sched: Avoid scale real weight down to zero
    psi: Move PF_MEMSTALL out of task->flags
    MAINTAINERS: Add maintenance information for psi
    psi: Optimize switching tasks inside shared cgroups
    psi: Fix cpu.pressure for cpu.max and competing cgroups
    sched/core: Distribute tasks within affinity masks
    sched/fair: Fix enqueue_task_fair warning
    thermal/cpu-cooling, sched/core: Move the arch_set_thermal_pressure() API to generic scheduler code
    sched/rt: Remove unnecessary push for unfit tasks
    sched/rt: Allow pulling unfitting task
    sched/rt: Optimize cpupri_find() on non-heterogenous systems
    sched/rt: Re-instate old behavior in select_task_rq_rt()
    sched/rt: cpupri_find: Implement fallback mechanism for !fit case
    sched/fair: Fix reordering of enqueue/dequeue_task_fair()
    sched/fair: Fix runnable_avg for throttled cfs
    ...

    Linus Torvalds
     
  • Pull perf updates from Ingo Molnar:
    "The main changes in this cycle were:

    Kernel side changes:

    - A couple of x86/cpu cleanups and changes were grandfathered in due
    to patch dependencies. These clean up the set of CPU model/family
    matching macros with a consistent namespace and C99 initializer
    style.

    - A bunch of updates to various low level PMU drivers:
    * AMD Family 19h L3 uncore PMU
    * Intel Tiger Lake uncore support
    * misc fixes to LBR TOS sampling

    - optprobe fixes

    - perf/cgroup: optimize cgroup event sched-in processing

    - misc cleanups and fixes

    Tooling side changes are to:

    - perf {annotate,expr,record,report,stat,test}

    - perl scripting

    - libapi, libperf and libtraceevent

    - vendor events on Intel and S390, ARM cs-etm

    - Intel PT updates

    - Documentation changes and updates to core facilities

    - misc cleanups, fixes and other enhancements"

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (89 commits)
    cpufreq/intel_pstate: Fix wrong macro conversion
    x86/cpu: Cleanup the now unused CPU match macros
    hwrng: via_rng: Convert to new X86 CPU match macros
    crypto: Convert to new CPU match macros
    ASoC: Intel: Convert to new X86 CPU match macros
    powercap/intel_rapl: Convert to new X86 CPU match macros
    PCI: intel-mid: Convert to new X86 CPU match macros
    mmc: sdhci-acpi: Convert to new X86 CPU match macros
    intel_idle: Convert to new X86 CPU match macros
    extcon: axp288: Convert to new X86 CPU match macros
    thermal: Convert to new X86 CPU match macros
    hwmon: Convert to new X86 CPU match macros
    platform/x86: Convert to new CPU match macros
    EDAC: Convert to new X86 CPU match macros
    cpufreq: Convert to new X86 CPU match macros
    ACPI: Convert to new X86 CPU match macros
    x86/platform: Convert to new CPU match macros
    x86/kernel: Convert to new CPU match macros
    x86/kvm: Convert to new CPU match macros
    x86/perf/events: Convert to new CPU match macros
    ...

    Linus Torvalds
     

28 Mar, 2020

1 commit

  • The pkg_temp_lock spinlock is acquired in the thermal vector handler which
    is truly atomic context even on PREEMPT_RT kernels.

    The critical sections are tiny, so change it to a raw spinlock.

    Signed-off-by: Clark Williams
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Thomas Gleixner
    Link: https://lore.kernel.org/r/20191008110021.2j44ayunal7fkb7i@linutronix.de

    Clark Williams
     

25 Mar, 2020

1 commit

  • The new macro set has a consistent namespace and uses C99 initializers
    instead of the grufty C89 ones.

    Get rid the of the local QUARK defines and use the proper ones.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Borislav Petkov
    Reviewed-by: Greg Kroah-Hartman
    Link: https://lkml.kernel.org/r/20200320131509.967017771@linutronix.de

    Thomas Gleixner
     

23 Mar, 2020

8 commits

  • Fix below sparse warning:

    drivers/thermal/imx8mm_thermal.c:82:36: sparse: sparse: incorrect type in argument 2 (different address spaces), expected unsigned long const volatile *addr
    drivers/thermal/imx8mm_thermal.c:82:36: sparse: expected unsigned long const volatile *addr

    Signed-off-by: Anson Huang
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1584973156-25734-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • The WARN_ON macros are used at the entry functions state2power() and
    set_cur_state().

    state2power() is called with the max_state retrieved from
    get_max_state which returns cpufreq_cdev->max_level, then it check if
    max_state is > cpufreq_cdev->max_level. The test does not really makes
    sense but let's assume we want to make sure to catch an error if the
    code evolves. However the WARN_ON is overkill.

    set_cur_state() is also called from userspace if we write to the
    sysfs. It is easy to see a stack dumped by just writing to sysfs
    /sys/class/thermal/cooling_device0/cur_state a value greater than
    "max_level". A bit scary. Returing -EINVAL is enough.

    Remove these WARN_ON.

    Signed-off-by: Daniel Lezcano
    Acked-by: Viresh Kumar
    Link: https://lore.kernel.org/r/20200321193107.21590-1-daniel.lezcano@linaro.org

    Daniel Lezcano
     
  • When setting the cooling device current state from userspace via sysfs,
    the operation fails by returning an -EINVAL.

    It appears the recent changes with the per-policy frequency QoS
    introduced a regression as reported by:

    https://lkml.org/lkml/2020/3/20/599

    The function freq_qos_update_request returns 0 or 1 describing update
    effectiveness, and a negative error code on failure. However,
    cpufreq_set_cur_state returns 0 on success or an error code otherwise.

    Consider the QoS update as successful if the function does not return
    an error.

    Fixes: 3000ce3c52f8b ("cpufreq: Use per-policy frequency QoS")
    Signed-off-by: Willy Wolff
    Acked-by: Viresh Kumar
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200321092740.7vvwfxsebcrznydh@macmini.local

    Willy Wolff
     
  • i.MX8MP shares same TMU with i.MX8MM, the only difference is i.MX8MP
    has two thermal sensors while i.MX8MM ONLY has one, add multiple sensors
    support for i.MX8MM TMU driver.

    Signed-off-by: Anson Huang
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1584674791-9717-2-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200319184838.GA25767@embeddedor.com

    Gustavo A. R. Silva
     
  • The temperature value passed from SCU could be negative value,
    the data type should be signed instead of unsigned.

    Fixes: e20db70dba1c ("thermal: imx_sc: add i.MX system controller thermal support")
    Signed-off-by: Anson Huang
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1584606380-9972-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • Since snprintf() returns the would-be-output size instead of the
    actual output size, the succeeding calls may go beyond the given
    buffer limit. Fix it by replacing with scnprintf().

    Signed-off-by: Takashi Iwai
    Reviewed-by: Pandruvada, Srinivas
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200311092718.24052-1-tiwai@suse.de

    Takashi Iwai
     
  • Added new PCI id for Tiger Lake processor thermal device along with
    MMIO RAPL support.

    Signed-off-by: Sumeet Pawnikar
    Signed-off-by: Zhang Rui
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583489952-29612-1-git-send-email-sumeet.r.pawnikar@intel.com

    Sumeet Pawnikar
     

21 Mar, 2020

2 commits

  • In order to avoid future header hell, remove the inclusion of
    proc_fs.h from acpi_bus.h. All it needs is a forward declaration of a
    struct.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Andy Shevchenko
    Link: https://lkml.kernel.org/r/20200321113241.246190285@linutronix.de

    Peter Zijlstra
     
  • The spinlock pkg_temp_lock has the potential of being taken in atomic
    context because it can be acquired from the thermal IRQ vector.
    It's static and limited scope so go ahead and make it a raw spinlock.

    Signed-off-by: Clark Williams
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Zhang Rui
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20191008110021.2j44ayunal7fkb7i@linutronix.de

    Clark Williams
     

20 Mar, 2020

17 commits

  • imx_thermal_unregister_legacy_cooling() should be used for handling
    legacy cpufreq cooling cleanups in .remove callback instead of
    calling cpufreq_cooling_unregister() and cpufreq_cpu_put() directly,
    especially for !CONFIG_CPU_FREQ scenario, no operation needed for
    handling legacy cpufreq cooling cleanups at all.

    Signed-off-by: Anson Huang
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1584088094-24857-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • Sort includes alphabetically for consistency, and take this chance
    to remove unused include of of_address.h.

    Signed-off-by: Anson Huang
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583903252-2058-2-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • Use devm_add_action_or_reset() to handle all cleanups of failure in
    .probe and .remove, then .remove callback can be dropped.

    Signed-off-by: Anson Huang
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583903252-2058-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • With the ctemp value returned instead of cached in the private data
    structure their is no need to take the lock when translating ctemp into
    a temperature.

    Signed-off-by: Niklas Söderlund
    Reviewed-by: Geert Uytterhoeven
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200310170029.1648996-4-niklas.soderlund+renesas@ragnatech.se

    Niklas Söderlund
     
  • There is no need to cache the ctemp value in the private data structure
    as it's always prefetched before it's used. Remove it from the structure
    and have rcar_thermal_update_temp return the value instead of storing
    it.

    Signed-off-by: Niklas Söderlund
    Reviewed-by: Geert Uytterhoeven
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200310170029.1648996-3-niklas.soderlund+renesas@ragnatech.se

    Niklas Söderlund
     
  • Since commit a1ade5653804b8eb ("thermal: rcar: check every
    rcar_thermal_update_temp() return value") the temperature is always read
    in rcar_thermal_get_current_temp() so comparing it before and after
    enabling interrupts have little effect. Remove the check and always
    update the thermal zone when we get an interrupt that the temperature
    have changed.

    Signed-off-by: Niklas Söderlund
    Reviewed-by: Geert Uytterhoeven
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200310170029.1648996-2-niklas.soderlund+renesas@ragnatech.se

    Niklas Söderlund
     
  • IRQF_TRIGGER_HIGH is already specified through devicetree interrupts
    property. Remove it from code.

    Signed-off-by: Amit Kucheria
    Reviewed-by: Bjorn Andersson
    Reviewed-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/8ac92e45b65fe411f4aaf70dcde4e7e7c3169b2d.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • Document ul_lock, threshold and control structure members and make
    the following kernel-doc invocation happy:

    $ scripts/kernel-doc -v -none drivers/thermal/qcom/*

    drivers/thermal/qcom/qcom-spmi-temp-alarm.c:105: info: Scanning doc for qpnp_tm_get_temp_stage
    drivers/thermal/qcom/tsens-common.c:18: info: Scanning doc for struct tsens_irq_data
    drivers/thermal/qcom/tsens-common.c:130: info: Scanning doc for tsens_hw_to_mC
    drivers/thermal/qcom/tsens-common.c:163: info: Scanning doc for tsens_mC_to_hw
    drivers/thermal/qcom/tsens-common.c:245: info: Scanning doc for tsens_set_interrupt
    drivers/thermal/qcom/tsens-common.c:268: info: Scanning doc for tsens_threshold_violated
    drivers/thermal/qcom/tsens-common.c:362: info: Scanning doc for tsens_critical_irq_thread
    drivers/thermal/qcom/tsens-common.c:438: info: Scanning doc for tsens_irq_thread
    drivers/thermal/qcom/tsens.h:41: info: Scanning doc for struct tsens_sensor
    drivers/thermal/qcom/tsens.h:59: info: Scanning doc for struct tsens_ops
    drivers/thermal/qcom/tsens.h:494: info: Scanning doc for struct tsens_features
    drivers/thermal/qcom/tsens.h:513: info: Scanning doc for struct tsens_plat_data
    drivers/thermal/qcom/tsens.h:529: info: Scanning doc for struct tsens_context

    Signed-off-by: Amit Kucheria
    Reviewed-by: Bjorn Andersson
    Reviewed-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/7ea9c9ead90a91205a3f1717c0c86db9a51780ce.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • TSENS IP v2.3 onwards adds support for a watchdog to detect if the TSENS
    HW FSM is stuck. Add support to detect and restart the FSM in the
    driver. The watchdog is configured by the bootloader, we just enable the
    watchdog bark as a debug feature in the kernel.

    Signed-off-by: Amit Kucheria
    Reviewed-by: Bjorn Andersson
    Reviewed-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/a314747664a065db592ad77da7beae68128a5b6e.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • TSENS IP v2.x adds critical threshold interrupt support for each sensor
    in addition to the upper/lower threshold interrupt. Add support in the
    driver.

    While the critical interrupts themselves aren't currently used by Linux,
    the HW line is also used by the TSENS watchdog. So this patch acts as
    infrastructure to enable watchdog functionality for the TSENS IP.

    Signed-off-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/51b22461d4b5f85a817274568459db4579fd4298.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • We don't currently call put_device in case of successfully initialising
    the device. So we hold the reference and keep the device pinned forever.

    Allow control to fall through so we can use same code for success and
    error paths to put_device.

    As a part of this fixup, change devm_ioremap_resource to act on the same
    device pointer as that used to allocate regmap memory. That ensures that
    we are free to release op->dev after examining its resources.

    Signed-off-by: Amit Kucheria
    Reviewed-by: Bjorn Andersson
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/d3996667e9f976bb30e97e301585cb1023be422e.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • We already dereference the sensor and save it into a variable. Use the
    variable directly to make the code easier to read.

    Signed-off-by: Amit Kucheria
    Reviewed-by: Bjorn Andersson
    Reviewed-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/5dc4356edfb8dffa377fb561359bf41a6f1fdf17.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • All the sensor data is initialised at init time. Lock it down by passing
    it to functions as a constant.

    Signed-off-by: Amit Kucheria
    Reviewed-by: Bjorn Andersson
    Reviewed-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/740f9254484c08d65869df578628eb523c0049ff.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • struct tsens_features is currently initialized as part of platform data
    at compile-time and not modifiable. We now have some usecases in feature
    detection across IP versions where it is more flexible to update the
    features after probing registers.

    Remove const qualifier from tsens_features and the encapsulating
    tsens_plat_data.

    Signed-off-by: Amit Kucheria
    Reviewed-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/2919a72220470366ae11e0bb5330a4ea39838f71.1584015867.git.amit.kucheria@linaro.org

    Amit Kucheria
     
  • If the common register memory resource is not available the driver needs
    to fail gracefully to disable PM. Instead of returning the error
    directly store it in ret and use the already existing error path.

    Signed-off-by: Niklas Söderlund
    Reviewed-by: Geert Uytterhoeven
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200310114709.1483860-1-niklas.soderlund+renesas@ragnatech.se

    Niklas Söderlund
     
  • Remove unused includes to simplify the code.

    Signed-off-by: Anson Huang
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583762668-12099-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • Add support for the Thermal Sensor/Chip Internal Voltage Monitor in the
    R-Car M3-W+ (R8A77961) SoC.

    According to the R-Car Gen3 Hardware Manual Errata for Revision 2.00 of
    Jan 31, 2020, the thermal parameters for R-Car M3-W+ are the same as for
    R-Car M3-W.

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Niklas Söderlund
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200306105503.24267-3-geert+renesas@glider.be

    Geert Uytterhoeven
     

12 Mar, 2020

6 commits

  • Add COMPILE_TEST support to i.MX8MM thermal driver for better compile
    testing coverage.

    Signed-off-by: Anson Huang
    Reviewed-by: Amit Kucheria
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583509057-8197-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • Qoriq thermal driver is used by both PowerPC and ARM architecture.
    When built for PowerPC architecture, it reports error:
    undefined reference to `.__devm_regmap_init_mmio_clk'
    To fix it, select config REGMAP_MMIO.

    Fixes: 4316237bd627 (thermal: qoriq: Convert driver to use regmap API)
    Signed-off-by: Yuantian Tang
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200303084641.35687-1-andy.tang@nxp.com

    Yuantian Tang
     
  • i.MX SCU thermal driver depends on IMX_SCU which does NOT have
    COMPILE_TEST enabled, so need to remove COMPILE_TEST for i.MX
    SCU thermal as well.

    Signed-off-by: Anson Huang
    Reported-by: Stephen Rothwell
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583222684-10229-2-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • Use __maybe_unused for power management related functions instead
    of #if CONFIG_PM_SLEEP to simplify the code.

    Signed-off-by: Anson Huang
    Acked-by: Uwe Kleine-König
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583139266-23615-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • The i.MX SCU API strongly assumes that messages are composed out
    of 4-bytes words but some of our message structs have odd sizeofs,
    use __packed __aligned(4) to avoid potential oopses.

    Signed-off-by: Anson Huang
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/1583117485-30922-1-git-send-email-Anson.Huang@nxp.com

    Anson Huang
     
  • This switches the TI SoC thermal driver to use GPIO
    descriptors instead of retrieveing a GPIO number from the
    device tree and requesting the GPIO separately.

    Cc: Keerthy
    Signed-off-by: Linus Walleij
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200229210532.173430-1-linus.walleij@linaro.org

    Linus Walleij