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

Commit 205f53fb authored by Elliot Berman's avatar Elliot Berman
Browse files

haven: rm: Update IRQ notify to expect standard reply



IRQ notify sends only a standard response without any client data to
parse. Update irq_notify to expect to not receive any client data.

Change-Id: Ie5db403a84a0b237ca34a2b06c8a1b76ec92cf79
Signed-off-by: default avatarElliot Berman <eberman@codeaurora.org>
parent 0db6d0ea
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -196,10 +196,6 @@ struct hh_vm_irq_notify_req_payload {
	} optional[0];
} __packed;

struct hh_vm_irq_notify_resp_payload {
	hh_virq_handle_t virq;
} __packed;

/* Call: MEM_QCOM_LOOKUP_SGL */
/*
 * Split up the whole payload into a header and several trailing structs
+16 −12
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ static int hh_rm_vm_irq_lend(hh_vmid_t vmid, int virq, int label,
static int hh_rm_vm_irq_notify(const hh_vmid_t *vmids, unsigned int num_vmids,
			       u16 flags, hh_virq_handle_t virq_handle)
{
	struct hh_vm_irq_notify_resp_payload *resp_payload;
	void *resp;
	struct hh_vm_irq_notify_req_payload *req_payload;
	size_t resp_payload_size, req_payload_size;
	int ret = 0, reply_err_code;
@@ -284,24 +284,28 @@ static int hh_rm_vm_irq_notify(const hh_vmid_t *vmids, unsigned int num_vmids,
	}


	resp_payload = hh_rm_call(HH_RM_RPC_MSG_ID_CALL_VM_IRQ_NOTIFY,
	resp = hh_rm_call(HH_RM_RPC_MSG_ID_CALL_VM_IRQ_NOTIFY,
			  req_payload, req_payload_size,
			  &resp_payload_size, &reply_err_code);
	kfree(req_payload);
	if (reply_err_code || IS_ERR_OR_NULL(resp_payload)) {
		ret = PTR_ERR(resp_payload);
		pr_err("%s: VM_IRQ_NOTIFY failed with err: %d\n",
			__func__, ret);
		return ret;
	if (IS_ERR(resp)) {
		pr_err("%s: Unable to send IRQ_NOTIFY to RM: %d\n", __func__,
			PTR_ERR(resp));
		return PTR_ERR(resp);
	}

	if (resp_payload_size != sizeof(*resp_payload)) {
		pr_err("%s: Invalid size received for VM_IRQ_NOTIFY: %u\n",
	if (reply_err_code) {
		pr_err("%s: IRQ_NOTIFY returned error: %d\n", __func__,
			reply_err_code);
		return reply_err_code;
	}

	if (resp_payload_size) {
		pr_err("%s: Invalid size received for IRQ_NOTIFY: %u\n",
			__func__, resp_payload_size);
		ret = -EINVAL;
	}

	kfree(resp_payload);
	return ret;
}