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

Commit a7af8b88 authored by Carter Cooper's avatar Carter Cooper
Browse files

msm: kgsl: Don't reset HFI indexes on reset



There is no need to reset HFI queue read_index and write_index
on device start/stop. They should be equal. If they are not then
log the mismatch and force them to be equal.

Change-Id: Id6dbf3f028f5a27608cc49f5ede2c76291f71669
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent 85c1f013
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -643,11 +643,28 @@ int hfi_start(struct kgsl_device *device,
		struct gmu_device *gmu, uint32_t boot_state)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	int result;
	struct gmu_memdesc *mem_addr = gmu->hfi_mem;
	struct hfi_queue_table *tbl = mem_addr->hostptr;
	struct hfi_queue_header *hdr;
	int result, i;

	if (test_bit(GMU_HFI_ON, &gmu->flags))
		return 0;

	/* Force read_index to the write_index no matter what */
	for (i = 0; i < HFI_QUEUE_MAX; i++) {
		hdr = &tbl->qhdr[i];
		if (hdr->status == HFI_QUEUE_STATUS_DISABLED)
			continue;

		if (hdr->read_index != hdr->write_index) {
			dev_err(&gmu->pdev->dev,
				"HFI Q[%d] Index Error: read:0x%X write:0x%X\n",
				i, hdr->read_index, hdr->write_index);
			hdr->read_index = hdr->write_index;
		}
	}

	if (!adreno_is_a640(adreno_dev) && !adreno_is_a680(adreno_dev)) {
		result = hfi_send_gmu_init(gmu, boot_state);
		if (result)
@@ -714,9 +731,6 @@ void hfi_stop(struct gmu_device *gmu)
			dev_err(&gmu->pdev->dev,
			"HFI queue[%d] is not empty before close: rd=%d,wt=%d",
				i, hdr->read_index, hdr->write_index);

		hdr->read_index = 0x0;
		hdr->write_index = 0x0;
	}

	clear_bit(GMU_HFI_ON, &gmu->flags);