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

Commit 8f76663c authored by Mayank Rana's avatar Mayank Rana
Browse files

USB: QTI: Check for IPA pipe index updation with EP_LOOKUP ioctl



Commit 3161846d (USB: QTI: Make changes to use QTI as transport
with other USB functions) has removed check for IPA Prod and IPA Cons
pipe index check against -1. Without this check, QTI application is
getting success on EP_LOOKUP although those IPA pipe index are not
updated. QTI has retry mechnism (5 retries with delay of 1 sec) if
EP_LOOKUP returns -EAGAIN. QTI sees line state as set 1 and it queries
EP_LOOKUP. Hence cases where this is not updated, it is required to
return -EAGAIN to get QTI retry mechnism kick in. Due to wrong pipe
update to modem through QTI USB communication, modem is asserting with
this pipe index check. Fix this issue by checking pipe index and
returning -EAGAIN until it is not being updated.

Also reset IPA EP index to -1 on USB QTI disconnect as in composition
switch back from RMNET composition from non-RMNET based composition
we still provides previously assigned IPA EP index without querying
with IPA driver. Although this is not creating issue as those pipe
index is statically allocated and it doesn't change everytime.

Change-Id: I80bd0682fb31b36c0ee2a8285748d488891e99ca
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 256995a0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -277,6 +277,10 @@ void gqti_ctrl_disconnect(void *gr, u8 port_num)
	atomic_set(&port->connected, 0);
	atomic_set(&port->line_state, 0);
	spin_lock_irqsave(&port->lock, flags);

	/* reset ipa eps to -1 */
	port->ipa_prod_idx = -1;
	port->ipa_cons_idx = -1;
	port->port_usb = NULL;

	if (g_rmnet) {
@@ -574,6 +578,12 @@ static long qti_ctrl_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
			break;
		}

		if (port->ipa_prod_idx == -1 && port->ipa_cons_idx == -1) {
			pr_err("EP_LOOKUP failed - ipa pipes were not updated\n");
			ret = -EAGAIN;
			break;
		}

		info.ph_ep_info.ep_type = port->ep_type;
		info.ph_ep_info.peripheral_iface_id = port->intf;
		info.ipa_ep_pair.cons_pipe_num = port->ipa_cons_idx;