msm: kgsl: Enable BCL only after first boot is done

BCL requires that respective Central Broadcast register
be programed from TZ. This programing happens only
when zap shader firmware load is successful. Zap firmware
load can fail in boot up path, but we are setting
bcl_enabled to true before firmware load is successful.
This is not correct. BCL should be enabled only after
respective register programing is done from TZ side.
Otherwise gmu goes to error state when ACK from BCL is
expected during boot. Enable BCL only after we
successfully complete first boot to ensure that Central
Broadcast register is programed before enabling BCL.

Change-Id: I6267c943262cc0448fa77d29d5ae6e8f5cae7e9f
Signed-off-by: Pranav Patel <quic_pranavp@quicinc.com>
This commit is contained in:
Pranav Patel 2022-06-21 15:05:38 +05:30
commit cb0163949d

View file

@ -2231,9 +2231,6 @@ static int a6xx_gmu_first_boot(struct adreno_device *adreno_dev)
device->gmu_fault = false;
if (ADRENO_FEATURE(adreno_dev, ADRENO_BCL))
adreno_dev->bcl_enabled = true;
trace_kgsl_pwr_set_state(device, KGSL_STATE_AWARE);
return 0;
@ -3022,6 +3019,17 @@ static int a6xx_first_boot(struct adreno_device *adreno_dev)
set_bit(GMU_PRIV_FIRST_BOOT_DONE, &gmu->flags);
set_bit(GMU_PRIV_GPU_STARTED, &gmu->flags);
/*
* BCL needs respective Central Broadcast register to
* be programed from TZ. This programing happens only
* when zap shader firmware load is successful. Zap firmware
* load can fail in boot up path hence enable BCL only after we
* successfully complete first boot to ensure that Central
* Broadcast register was programed before enabling BCL.
*/
if (ADRENO_FEATURE(adreno_dev, ADRENO_BCL))
adreno_dev->bcl_enabled = true;
device->pwrctrl.last_stat_updated = ktime_get();
device->state = KGSL_STATE_ACTIVE;