[v3,0/2] thermal: rcar_gen3_thermal: fix IRQ issues
mbox series

Message ID 20190423141414.24264-1-jiada_wang@mentor.com
Headers show
Series
  • thermal: rcar_gen3_thermal: fix IRQ issues
Related show

Message

Jiada Wang April 23, 2019, 2:14 p.m. UTC
There are issues with interrupt handling in rcar_gen3_thermal driver.

Currently IRQ is remain enabled after .remove, later if device is probed,
IRQ is requested before .thermal_init, this may cause IRQ function be
triggered but not able to clear IRQ status, thus cause system to hang.

Since the irq line isn't shared between different devices,
so the proper interrupt type flag should be IRQF_ONESHOT.

This patch-set fix these interrupt handling retated issues.

---
v3: fix to use correct code base
    remove unused "flag" variable in rcar_gen3_thermal_irq

v2: use irq type IRQF_ONESHOT instead of IRQF_SHARED
    disable interrupt in .remove

v1: initial version

Jiada Wang (2):
  thermal: rcar_gen3_thermal: fix interrupt type
  thermal: rcar_gen3_thermal: disable interrupt in .remove

Jiada Wang (2):
  thermal: rcar_gen3_thermal: fix interrupt type
  thermal: rcar_gen3_thermal: disable interrupt in .remove

 drivers/thermal/rcar_gen3_thermal.c | 37 +++++++----------------------
 1 file changed, 9 insertions(+), 28 deletions(-)

Comments

Eugeniu Rosca April 23, 2019, 10:27 p.m. UTC | #1
Hi Jiada,

On Tue, Apr 23, 2019 at 11:14:12PM +0900, Jiada Wang wrote:
> There are issues with interrupt handling in rcar_gen3_thermal driver.
> 
> Currently IRQ is remain enabled after .remove, later if device is probed,
> IRQ is requested before .thermal_init, this may cause IRQ function be
> triggered but not able to clear IRQ status, thus cause system to hang.
> 
> Since the irq line isn't shared between different devices,
> so the proper interrupt type flag should be IRQF_ONESHOT.
> 
> This patch-set fix these interrupt handling retated issues.
> 
> ---
> v3: fix to use correct code base
>     remove unused "flag" variable in rcar_gen3_thermal_irq
[..]

Based on below:
 - basic functional testing [1]
 - 40 min of loading and unloading the driver in a loop doesn't
   trigger the original problem (soft lockup)

Tested-by: Eugeniu Rosca <erosca@de.adit-jv.com>

[1] Basic functional testing on H3-ES2.0-ULCB-KF-M06:
rcar-gen3:~# T0=/sys/devices/virtual/thermal/thermal_zone0/temp
rcar-gen3:~# T1=/sys/devices/virtual/thermal/thermal_zone1/temp
rcar-gen3:~# T2=/sys/devices/virtual/thermal/thermal_zone2/temp
rcar-gen3:~# stress-ng --cpu 16 --timeout 60s &
[1] 2300
rcar-gen3:~# stress-ng: info: [2300] dispatching hogs: 16 cpu
rcar-gen3:~# for i in $(seq 1 24); do \
                 cat $T0 $T1 $T2 | tr '\n' ' '; echo; sleep 5; \
             done
31500 37500 34500 
32000 37500 34500 
32500 38000 35000 
33500 39500 36500 
34000 39500 36500 
35000 40500 37500 
35500 41000 38000 
36000 42000 38500 
36500 42000 39000 
37500 43000 40000 
stress-ng: info: [2300] successful run completed in 60.55s
[1]+  Done                    stress-ng --cpu 16 --timeout 60s
37500 42500 39000 
37500 41500 39000 
37000 41000 38000 
36500 40500 38000 
36000 40000 37000 
35500 39500 36500 
35500 40000 36000 
35000 39500 35500 
35000 39500 36000 
34500 38000 35500 
34500 39000 35500 
34000 38500 35000 
34000 37500 35500 
33500 38000 35500