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

Commit 72ec8bbf authored by George Shen's avatar George Shen
Browse files

msm: kgsl: Fix racing in HFI message deletion



Move more HFI message processing into spinlock protected
area in tasklet function that receives HFI message
and notifies GMU driver thread. The racing happens
when GPU driver times out waiting for HFI message. Receiver
function just received the message and processing it.

CRs-Fixed: 2052606
Change-Id: I495ba923961f8c91f9806eee0766a96f2b4371d6
Signed-off-by: default avatarGeorge Shen <sqiao@codeaurora.org>
parent c29e5a41
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -188,9 +188,9 @@ static void receive_ack_msg(struct gmu_device *gmu, struct hfi_msg_rsp *rsp)
				msg->seqnum == rsp->ret_hdr.seqnum)
			break;
	}
	spin_unlock(&hfi->msglock);

	if (msg == NULL) {
		spin_unlock(&hfi->msglock);
		dev_err(&gmu->pdev->dev,
				"Cannot find receiver of ack msg with id=%d\n",
				rsp->ret_hdr.id);
@@ -199,6 +199,7 @@ static void receive_ack_msg(struct gmu_device *gmu, struct hfi_msg_rsp *rsp)

	memcpy(&msg->results, (void *) rsp, rsp->hdr.size << 2);
	complete(&msg->msg_complete);
	spin_unlock(&hfi->msglock);
}

static void receive_err_msg(struct gmu_device *gmu, struct hfi_msg_rsp *rsp)
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ enum hfi_f2h_qpri {
	HFI_F2H_QPRI_DEBUG = 40,
};

#define HFI_RSP_TIMEOUT 50 /* msec */
#define HFI_RSP_TIMEOUT 100 /* msec */
#define HFI_H2F_CMD_IRQ_MASK BIT(0)

enum hfi_msg_type {