13 Mar, 2019

1 commit


12 Feb, 2019

25 commits


08 Dec, 2018

5 commits

  • commit 10d7e9a9181f4637640f388d334c6740c1b5d0e8 upstream.

    The sensor is all setup, bind, resetted, acked, etc... every single second.

    That was the way to workaround a problem with the interrupt bouncing again and
    again.

    With the following changes, we fix all in one:

    - Do the setup, one time, at probe time

    - Add the IRQF_ONESHOT, ack the interrupt in the threaded handler

    - Remove the interrupt handler

    - Set the correct value for the LAG register

    - Remove all the irq_enabled stuff in the code as the interruption
    handling is fixed

    - Remove the 3ms delay

    - Reorder the initialization routine to be in the right order

    It ends up to a nicer code and more efficient, the 3-5ms delay is removed from
    the get_temp() path.

    Signed-off-by: Daniel Lezcano
    Reviewed-by: Leo Yan
    Tested-by: Leo Yan
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Rafael David Tinoco
    Signed-off-by: Greg Kroah-Hartman

    Daniel Lezcano
     
  • commit b424315a287c70eeb5f920f84c92492bd2f5658e upstream.

    The TEMP0_CFG configuration register contains different field to set up the
    temperature controller. However in the code, nothing prevents a setup to
    overwrite the previous one: eg. writing the hdak value overwrites the sensor
    selection, the sensor selection overwrites the hdak value.

    In order to prevent such thing, use a regmap-like mechanism by reading the
    value before, set the corresponding bits and write the result.

    Signed-off-by: Daniel Lezcano
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Rafael David Tinoco
    Signed-off-by: Greg Kroah-Hartman

    Daniel Lezcano
     
  • commit 1e11b014271ceccb5ea04ae58f4829ac8209a86d upstream.

    Hopefully, the function name can help to clarify the semantic of the operations
    when writing in the register.

    Signed-off-by: Daniel Lezcano
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Rafael David Tinoco
    Signed-off-by: Greg Kroah-Hartman

    Daniel Lezcano
     
  • commit 2d4fa7b4c6f8080ced2e8237c9f46fb1fc110d64 upstream.

    The threaded interrupt inspect the sensors structure to look in the temp
    threshold field, but this field is read-only in all the code, except in the
    probe function before the threaded interrupt is set. In other words there
    is not race window in the threaded interrupt when reading the field value.

    Signed-off-by: Daniel Lezcano
    Reviewed-by: Leo Yan
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Rafael David Tinoco
    Signed-off-by: Greg Kroah-Hartman

    Daniel Lezcano
     
  • commit ff4ec2997df8fe7cc40513dbe5f86d9f88fb6be7 upstream.

    By essence, the tsensor does not really support multiple sensor at the same
    time. It allows to set a sensor and use it to get the temperature, another
    sensor could be switched but with a delay of 3-5ms. It is difficult to read
    simultaneously several sensors without a big delay.

    Today, just one sensor is used, it is not necessary to deal with multiple
    sensors in the code. Remove them and if it is needed in the future add them
    on top of a code which will be clean up in the meantime.

    Signed-off-by: Daniel Lezcano
    Reviewed-by: Leo Yan
    Acked-by: Wangtao (Kevin, Kirin)
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Rafael David Tinoco
    Signed-off-by: Greg Kroah-Hartman

    Daniel Lezcano
     

21 Nov, 2018

1 commit

  • commit fec3624f0bcdb6b20ef9ccf9d9d55d0d75d776f8 upstream.

    Moving the bcm2835 thermal driver to the broadcom directory prevented it
    from getting enabled for arm64 builds, since the broadcom directory is only
    available when 32-bit specific ARCH_BCM is set.

    Fix this by enabling the Broadcom menu for ARCH_BCM or ARCH_BCM2835.

    Fixes: 6892cf07e733 ("thermal: bcm2835: move to the broadcom subdirectory")
    Reviewed-by: Eric Anholt
    Signed-off-by: Allen Wild
    Signed-off-by: Stefan Wahren
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Allen Wild
     

14 Nov, 2018

1 commit

  • [ Upstream commit 760eea43f8c6d48684f1f34b8a02fddc1456e849 ]

    The workqueue used for monitoring the hardware may run while the device
    is already suspended. Fix this by using the freezable system workqueue
    instead, cfr. commit 51e20d0e3a60cf46 ("thermal: Prevent polling from
    happening during system suspend").

    Fixes: 608567aac3206ae8 ("thermal: da9062/61: Thermal junction temperature monitoring driver")
    Signed-off-by: Geert Uytterhoeven
    Acked-by: Steve Twiss
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     

04 Oct, 2018

1 commit

  • [ Upstream commit 152395fd03d4ce1e535a75cdbf58105e50587611 ]

    When thermal zone is in passive mode, disabling its mode from
    sysfs is NOT taking effect at all, it is still polling the
    temperature of the disabled thermal zone and handling all thermal
    trips, it makes user confused. The disabling operation should
    disable the thermal zone behavior completely, for both active and
    passive mode, this patch clears the passive_delay when thermal
    zone is disabled and restores it when it is enabled.

    Signed-off-by: Anson Huang
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Anson Huang
     

03 Aug, 2018

1 commit


03 Jul, 2018

1 commit

  • commit bd2a07f71a1e2e198f8a30cb551d9defe422d83d upstream.

    Printk format "%pCr" will be removed soon, as clk_get_rate() must not be
    called in atomic context.

    Replace it by printing the variable that already holds the clock rate.
    Note that calling clk_get_rate() is safe here, as the code runs in task
    context.

    Link: http://lkml.kernel.org/r/1527845302-12159-3-git-send-email-geert+renesas@glider.be
    To: Jia-Ju Bai
    To: Jonathan Corbet
    To: Michael Turquette
    To: Stephen Boyd
    To: Zhang Rui
    To: Eduardo Valentin
    To: Eric Anholt
    To: Stefan Wahren
    To: Greg Kroah-Hartman
    Cc: Sergey Senozhatsky
    Cc: Petr Mladek
    Cc: Linus Torvalds
    Cc: Steven Rostedt
    Cc: linux-doc@vger.kernel.org
    Cc: linux-clk@vger.kernel.org
    Cc: linux-pm@vger.kernel.org
    Cc: linux-serial@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-renesas-soc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: stable@vger.kernel.org # 4.12+
    Signed-off-by: Geert Uytterhoeven
    Acked-by: Stefan Wahren
    Signed-off-by: Petr Mladek
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     

21 Jun, 2018

1 commit

  • [ Upstream commit 13b86f50eaaddaea4bdd2fe476fd12e6a0951add ]

    Starting with kernel 4.17 thermal_cooling_device_register() will call the
    get_max_state() op during register.

    Since we deref priv->priv in int3403_get_max_state() this means we must
    set priv->priv before calling thermal_cooling_device_register().

    Signed-off-by: Hans de Goede
    Signed-off-by: Zhang Rui
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

16 May, 2018

2 commits

  • commit c8da6cdef57b459ac0fd5d9d348f8460a575ae90 upstream.

    tmu_read() in case of Exynos4210 might return error for out of bound
    values. Current code ignores such value, what leads to reporting critical
    temperature value. Add proper error code propagation to exynos_get_temp()
    function.

    Signed-off-by: Marek Szyprowski
    CC: stable@vger.kernel.org # v4.6+
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Greg Kroah-Hartman

    Marek Szyprowski
     
  • commit 88fc6f73fddf64eb507b04f7b2bd01d7291db514 upstream.

    When thermal sensor is not yet enabled, reading temperature might return
    random value. This might even result in stopping system booting when such
    temperature is higher than the critical value. Fix this by checking if TMU
    has been actually enabled before reading the temperature.

    This change fixes booting of Exynos4210-based board with TMU enabled (for
    example Samsung Trats board), which was broken since v4.4 kernel release.

    Signed-off-by: Marek Szyprowski
    Fixes: 9e4249b40340 ("thermal: exynos: Fix first temperature read after registering sensor")
    CC: stable@vger.kernel.org # v4.6+
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Greg Kroah-Hartman

    Marek Szyprowski
     

24 Apr, 2018

1 commit

  • commit cf1ba1d73a33944d8c1a75370a35434bf146b8a7 upstream.

    When device boots with T > T_trip_1 and requests interrupt,
    the race condition takes place. The interrupt comes before
    THERMAL_DEVICE_ENABLED is set. This leads to an attempt to
    reading sensor value from irq and disabling the sensor, based on
    the data->mode field, which expected to be THERMAL_DEVICE_ENABLED,
    but still stays as THERMAL_DEVICE_DISABLED. Afher this issue
    sensor is never re-enabled, as the driver state is wrong.

    Fix this problem by setting the 'data' members prior to
    requesting the interrupts.

    Fixes: 37713a1e8e4c ("thermal: imx: implement thermal alarm interrupt handling")
    Cc:
    Signed-off-by: Mikhail Lappo
    Signed-off-by: Fabio Estevam
    Reviewed-by: Philipp Zabel
    Acked-by: Dong Aisheng
    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Mikhail Lappo