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

Commit 0adc39d3 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: List ACK waiters when invalid HFI ACK received"

parents a7d75039 c570dfab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1339,7 +1339,7 @@ static int gmu_probe(struct kgsl_device *device,
	disable_irq(gmu->gmu_interrupt_num);
	disable_irq(hfi->hfi_interrupt_num);

	tasklet_init(&hfi->tasklet, hfi_receiver, (unsigned long)gmu);
	tasklet_init(&hfi->tasklet, hfi_receiver, (unsigned long)device);
	INIT_LIST_HEAD(&hfi->msglist);
	spin_lock_init(&hfi->msglock);
	hfi->kgsldev = device;
+23 −8
Original line number Diff line number Diff line
@@ -231,13 +231,15 @@ void hfi_init(struct kgsl_hfi *hfi, struct gmu_memdesc *mem_addr,
#define HDR_CMP_SEQNUM(out_hdr, in_hdr) \
	(MSG_HDR_GET_SEQNUM(out_hdr) == MSG_HDR_GET_SEQNUM(in_hdr))

static void receive_ack_cmd(struct gmu_device *gmu, void *rcvd)
static void receive_ack_cmd(struct kgsl_device *device,
		struct gmu_device *gmu, void *rcvd)
{
	uint32_t *ack = rcvd;
	uint32_t hdr = ack[0];
	uint32_t req_hdr = ack[1];
	struct kgsl_hfi *hfi = &gmu->hfi;
	struct pending_cmd *cmd = NULL;
	uint32_t waiters[64], i = 0, j;

	trace_kgsl_hfi_receive(MSG_HDR_GET_ID(req_hdr),
		MSG_HDR_GET_SIZE(req_hdr),
@@ -251,11 +253,21 @@ static void receive_ack_cmd(struct gmu_device *gmu, void *rcvd)
			spin_unlock_bh(&hfi->msglock);
			return;
		}
		if (i < 64)
			waiters[i++] = cmd->sent_hdr;
	}
	spin_unlock_bh(&hfi->msglock);

	dev_err(&gmu->pdev->dev,
			"HFI ACK(0x%x) Cannot find sender\n", req_hdr);
	dev_err_ratelimited(&gmu->pdev->dev,
			"HFI ACK: Cannot find sender for 0x%8.8X\n", req_hdr);
	/* Didn't find the sender, list all the waiters */
	for (j = 0; j < i && j < 64; j++) {
		dev_err_ratelimited(&gmu->pdev->dev,
				"HFI ACK: Waiters: 0x%8.8X\n", waiters[j]);
	}

	adreno_set_gpu_fault(ADRENO_DEVICE(device), ADRENO_GMU_FAULT);
	adreno_dispatcher_schedule(device);
}

#define MSG_HDR_SET_SEQNUM(hdr, num) \
@@ -519,11 +531,12 @@ static void receive_debug_req(struct gmu_device *gmu, void *rcvd)
			cmd->type, cmd->timestamp, cmd->data);
}

static void hfi_v1_receiver(struct gmu_device *gmu, uint32_t *rcvd)
static void hfi_v1_receiver(struct kgsl_device *device,
		struct gmu_device *gmu, uint32_t *rcvd)
{
	/* V1 ACK Handler */
	if (MSG_HDR_GET_TYPE(rcvd[0]) == HFI_V1_MSG_ACK) {
		receive_ack_cmd(gmu, rcvd);
		receive_ack_cmd(device, gmu, rcvd);
		return;
	}

@@ -545,6 +558,7 @@ static void hfi_v1_receiver(struct gmu_device *gmu, uint32_t *rcvd)

void hfi_receiver(unsigned long data)
{
	struct kgsl_device *device;
	struct gmu_device *gmu;
	uint32_t rcvd[MAX_RCVD_SIZE];
	int read_queue[] = {
@@ -556,7 +570,8 @@ void hfi_receiver(unsigned long data)
	if (!data)
		return;

	gmu = (struct gmu_device *)data;
	device = (struct kgsl_device *)data;
	gmu = KGSL_GMU_DEVICE(device);

	/* While we are here, check all of the queues for messages */
	for (q = 0; q < ARRAY_SIZE(read_queue); q++) {
@@ -564,13 +579,13 @@ void hfi_receiver(unsigned long data)
				rcvd, sizeof(rcvd)) > 0) {
			/* Special case if we're v1 */
			if (HFI_VER_MAJOR(&gmu->hfi) < 2) {
				hfi_v1_receiver(gmu, rcvd);
				hfi_v1_receiver(device, gmu, rcvd);
				continue;
			}

			/* V2 ACK Handler */
			if (MSG_HDR_GET_TYPE(rcvd[0]) == HFI_MSG_ACK) {
				receive_ack_cmd(gmu, rcvd);
				receive_ack_cmd(device, gmu, rcvd);
				continue;
			}