Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 514ca308 authored by Deepak Kumar's avatar Deepak Kumar
Browse files

msm: kgsl: Don't deassert GBIF halt before GPU gdsc goes off



During adreno_stop, GBIF halt is asserted to halt any new
transaction from GPU before GPU power collapse but in current
code it was cleared immediately which can allow few GPU
transactions to go through before gdsc is turned-off and can
result in issues.

To avoid this situation don't deassert this halt before GPU
gdsc goes off. It will deassert automatically when gdsc goes
off but in case gdsc doesn't toggle as its a shared resource
deassert this during adreno_start to ensure wake-up doesn't
fail.

Change-Id: If0a892470d04a0f3a79a1ea882ee5bfd16ad24ed
Signed-off-by: default avatarDeepak Kumar <dkumar@codeaurora.org>
parent bf120491
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -1879,6 +1879,17 @@ static int _adreno_start(struct adreno_device *adreno_dev)
	if (regulator_left_on)
		_soft_reset(adreno_dev);

	/*
	 * During adreno_stop, GBIF halt is asserted to ensure
	 * no further transaction can go through GPU before GPU
	 * headswitch is turned off.
	 *
	 * This halt is deasserted once headswitch goes off but
	 * incase headswitch doesn't goes off clear GBIF halt
	 * here to ensure GPU wake-up doesn't fail because of
	 * halted GPU transactions.
	 */
	adreno_deassert_gbif_halt(adreno_dev);

	adreno_ringbuffer_set_global(adreno_dev, 0);

@@ -2201,7 +2212,14 @@ static int adreno_stop(struct kgsl_device *device)

	adreno_clear_pending_transactions(device);

	/* The halt is not cleared in the above function if we have GBIF */
	/*
	 * The halt is not cleared in the above function if we have GBIF.
	 * Clear it here if GMU is enabled as GMU stop needs access to
	 * system memory to stop. For non-GMU targets, we don't need to
	 * clear it as it will get cleared automatically once headswitch
	 * goes OFF immediately after adreno_stop.
	 */
	if (gmu_core_gpmu_isenabled(device))
		adreno_deassert_gbif_halt(adreno_dev);

	kgsl_mmu_stop(&device->mmu);