]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
thermal: armada: add overheat interrupt support
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 12 Dec 2018 09:36:40 +0000 (10:36 +0100)
committerEduardo Valentin <edubezval@gmail.com>
Wed, 2 Jan 2019 12:47:17 +0000 (04:47 -0800)
commit879d7362d1d01efd476a143c09048f5945936c32
tree04264584b1ad14ed127ed2cc7823ef4b63b29fdd
parent5a78ad6d9c1b2c3c3226528346e9794ed3504381
thermal: armada: add overheat interrupt support

The IP can manage to trigger interrupts on overheat situation from all
the sensors.

However, the interrupt source changes along with the last selected
source (ie. the last read sensor), which is an inconsistent behavior.
Avoid possible glitches by always selecting back only one channel which
will then be referenced as the "overheat_sensor" (arbitrarily: the first
in the DT which has a critical trip point filled in).

It is possible that the scan of all thermal zone nodes did not bring a
critical trip point from which the overheat interrupt could be
configured. In this case just complain but do not fail the probe.

Also disable sensor switch during overheat situations because changing
the channel while the system is too hot could clear the overheat state
by changing the source while the temperature is still very high.

Even if the overheat state is not declared, overheat interrupt must be
cleared by reading the DFX interrupt cause _after_ the temperature has
fallen down to the low threshold, otherwise future possible interrupts
would not be served. A work polls the corresponding register until the
overheat flag gets cleared in this case.

Suggested-by: David Sniatkiwicz <davidsn@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/armada_thermal.c