Skip to content

Commit f4a75b5

Browse files
Akhil P Oommenrobclark
authored andcommitted
drm/msm/a6xx: Avoid gx gbit halt during rpm suspend
As per the downstream driver, gx gbif halt is required only during recovery sequence. So lets avoid it during regular rpm suspend. Signed-off-by: Akhil P Oommen <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/515279/ Link: https://lore.kernel.org/r/20221216223253.1.Ice9c47bfeb1fddb8dc377a3491a043a3ee7fca7d@changeid Signed-off-by: Rob Clark <[email protected]>
1 parent 13ef096 commit f4a75b5

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gmu.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,8 @@ static void a6xx_gmu_rpmh_off(struct a6xx_gmu *gmu)
876876
#define GBIF_CLIENT_HALT_MASK BIT(0)
877877
#define GBIF_ARB_HALT_MASK BIT(1)
878878

879-
static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu)
879+
static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu,
880+
bool gx_off)
880881
{
881882
struct msm_gpu *gpu = &adreno_gpu->base;
882883

@@ -889,9 +890,11 @@ static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu)
889890
return;
890891
}
891892

892-
/* Halt the gx side of GBIF */
893-
gpu_write(gpu, REG_A6XX_RBBM_GBIF_HALT, 1);
894-
spin_until(gpu_read(gpu, REG_A6XX_RBBM_GBIF_HALT_ACK) & 1);
893+
if (gx_off) {
894+
/* Halt the gx side of GBIF */
895+
gpu_write(gpu, REG_A6XX_RBBM_GBIF_HALT, 1);
896+
spin_until(gpu_read(gpu, REG_A6XX_RBBM_GBIF_HALT_ACK) & 1);
897+
}
895898

896899
/* Halt new client requests on GBIF */
897900
gpu_write(gpu, REG_A6XX_GBIF_HALT, GBIF_CLIENT_HALT_MASK);
@@ -929,7 +932,7 @@ static void a6xx_gmu_force_off(struct a6xx_gmu *gmu)
929932
/* Halt the gmu cm3 core */
930933
gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1);
931934

932-
a6xx_bus_clear_pending_transactions(adreno_gpu);
935+
a6xx_bus_clear_pending_transactions(adreno_gpu, true);
933936

934937
/* Reset GPU core blocks */
935938
gpu_write(gpu, REG_A6XX_RBBM_SW_RESET_CMD, 1);
@@ -1083,7 +1086,7 @@ static void a6xx_gmu_shutdown(struct a6xx_gmu *gmu)
10831086
return;
10841087
}
10851088

1086-
a6xx_bus_clear_pending_transactions(adreno_gpu);
1089+
a6xx_bus_clear_pending_transactions(adreno_gpu, a6xx_gpu->hung);
10871090

10881091
/* tell the GMU we want to slumber */
10891092
ret = a6xx_gmu_notify_slumber(gmu);

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,12 @@ static void a6xx_recover(struct msm_gpu *gpu)
12771277
if (hang_debug)
12781278
a6xx_dump(gpu);
12791279

1280+
/*
1281+
* To handle recovery specific sequences during the rpm suspend we are
1282+
* about to trigger
1283+
*/
1284+
a6xx_gpu->hung = true;
1285+
12801286
/* Halt SQE first */
12811287
gpu_write(gpu, REG_A6XX_CP_SQE_CNTL, 3);
12821288

@@ -1319,6 +1325,7 @@ static void a6xx_recover(struct msm_gpu *gpu)
13191325
mutex_unlock(&gpu->active_lock);
13201326

13211327
msm_gpu_hw_init(gpu);
1328+
a6xx_gpu->hung = false;
13221329
}
13231330

13241331
static const char *a6xx_uche_fault_block(struct msm_gpu *gpu, u32 mid)

drivers/gpu/drm/msm/adreno/a6xx_gpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct a6xx_gpu {
3232
void *llc_slice;
3333
void *htw_llc_slice;
3434
bool have_mmu500;
35+
bool hung;
3536
};
3637

3738
#define to_a6xx_gpu(x) container_of(x, struct a6xx_gpu, base)

0 commit comments

Comments
 (0)