linux/drivers/gpu/drm/msm/adreno
Jordan Crouse eadf79286a drm/msm: Check for powered down HW in the devfreq callbacks
Writing to the devfreq sysfs nodes while the GPU is powered down can
result in a system crash (on a5xx) or a nasty GMU error (on a6xx):

 $ /sys/class/devfreq/5000000.gpu# echo 500000000 > min_freq
  [  104.841625] platform 506a000.gmu: [drm:a6xx_gmu_set_oob]
	*ERROR* Timeout waiting for GMU OOB set GPU_DCVS: 0x0

Despite the fact that we carefully try to suspend the devfreq device when
the hardware is powered down there are lots of holes in the governors that
don't check for the suspend state and blindly call into the devfreq
callbacks that end up triggering hardware reads in the GPU driver.

Call pm_runtime_get_if_in_use() in the gpu_busy() and gpu_set_freq()
callbacks to skip the hardware access if it isn't active.

v3: Only check pm_runtime_get_if_in_use() for == 0 per Eric Anholt
v2: Use pm_runtime_get_if_in_use() per Eric Anholt

Cc: stable@vger.kernel.org
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
2020-05-18 09:26:32 -07:00
..
a2xx_gpu.c drm/msm: implement a2xx mmu 2018-12-11 13:07:10 -05:00
a2xx_gpu.h drm/msm/adreno: add a2xx 2018-12-11 13:07:06 -05:00
a2xx.xml.h drm/msm: update generated headers 2018-12-11 13:05:27 -05:00
a3xx_gpu.c drm/msm/a3xx: set interconnect bandwidth vote 2020-01-02 14:23:48 -08:00
a3xx_gpu.h drm/msm/gpu: add ocmem init/cleanup functions 2019-10-07 08:17:39 -07:00
a3xx.xml.h drm/msm: update generated headers 2018-12-11 13:05:27 -05:00
a4xx_gpu.c drm/msm/a4xx: set interconnect bandwidth vote 2020-01-02 14:23:48 -08:00
a4xx_gpu.h drm/msm/gpu: add ocmem init/cleanup functions 2019-10-07 08:17:39 -07:00
a4xx.xml.h drm/msm: update generated headers 2018-12-11 13:05:27 -05:00
a5xx_debugfs.c drm/msm: drop use of drmP.h 2019-09-03 16:16:57 -07:00
a5xx_gpu.c drm/msm: Check for powered down HW in the devfreq callbacks 2020-05-18 09:26:32 -07:00
a5xx_gpu.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
a5xx_power.c drm/msm/adreno: Add support for Adreno 510 GPU 2019-11-04 13:18:31 -08:00
a5xx_preempt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
a5xx.xml.h drm/msm/adreno: Add A540 support 2019-06-18 14:04:23 -07:00
a6xx_gmu.c drm/msm: Check for powered down HW in the devfreq callbacks 2020-05-18 09:26:32 -07:00
a6xx_gmu.h drm/msm/a6xx: Use the DMA API for GMU memory objects 2020-03-20 07:13:05 -07:00
a6xx_gmu.xml.h drm/msm: update generated headers 2018-12-11 13:05:27 -05:00
a6xx_gpu_state.c drm: msm: a6xx: Dump GBIF registers, debugbus in gpu state 2020-01-02 16:05:37 -08:00
a6xx_gpu_state.h drm/msm/a6xx: Fix CP_MEMPOOL state name 2020-03-19 12:19:10 -07:00
a6xx_gpu.c drm/msm: Check for powered down HW in the devfreq callbacks 2020-05-18 09:26:32 -07:00
a6xx_gpu.h drm: msm: a6xx: Add support for A618 2020-01-02 16:05:36 -08:00
a6xx_hfi.c drm/msm/a6xx: Update the GMU bus tables for sc7180 2020-02-11 07:41:00 -08:00
a6xx_hfi.h drm/msm: Add A6XX device support 2018-08-10 18:49:18 -04:00
a6xx.xml.h drm: msm: a6xx: Add support for A618 2020-01-02 16:05:36 -08:00
adreno_common.xml.h drm/msm: update generated headers 2018-12-11 13:05:27 -05:00
adreno_device.c drm: msm: Add 618 gpu to the adreno gpu list 2020-01-02 16:05:36 -08:00
adreno_gpu.c drm/msm: Use scnprintf() for avoiding potential buffer overflow 2020-03-19 12:09:04 -07:00
adreno_gpu.h drm/msm: use BUG_ON macro for debugging. 2020-01-02 16:17:20 -08:00
adreno_pm4.xml.h drm/msm: update generated headers 2018-12-11 13:05:27 -05:00