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

Commit 8e246a1d authored by Hemant Kumar's avatar Hemant Kumar Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: f_gsi: Handle IPA remote wakeup notification properly



Upon bus suspend when IPA requests for usb remote wake up, it is not
allowing enough time for the host to wakeup from U3. IPA is continuously
trying to wakeup the host and eventually resets the bus. Fix this issue
by adding a flag to check the status of usb remote wakeup and ignores
the request from IPA if it is in progress.

Change-Id: Id55928b7f5d3ae7f282a3b8db44949d396db0ddd
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent ffb81726
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -213,6 +213,8 @@ static int gsi_wakeup_host(struct f_gsi *gsi)
		return -ENODEV;
	}

	gsi->rwake_inprogress = true;

	/*
	 * In Super-Speed mode, remote wakeup is not allowed for suspended
	 * functions which have been disallowed by the host to issue Function
@@ -235,6 +237,9 @@ static int gsi_wakeup_host(struct f_gsi *gsi)
	else if (ret)
		log_event_err("wakeup failed. ret=%d.", ret);

	if (ret)
		gsi->rwake_inprogress = false;

	return ret;
}

@@ -512,6 +517,7 @@ int ipa_usb_notify_cb(enum ipa_usb_notify_event event,
		break;

	case IPA_USB_REMOTE_WAKEUP:
		if (!gsi->rwake_inprogress)
			gsi_wakeup_host(gsi);
		break;

@@ -2647,6 +2653,8 @@ static void gsi_resume(struct usb_function *f)
			gsi->host_supports_flow_control)
		rndis_flow_control(gsi->params, false);

	gsi->rwake_inprogress = false;

	post_event(&gsi->d_port, EVT_RESUMED);
	queue_work(gsi->d_port.ipa_usb_wq, &gsi->d_port.usb_ipa_w);

+2 −0
Original line number Diff line number Diff line
@@ -280,6 +280,8 @@ struct f_gsi {
	struct gsi_ctrl_port c_port;
	bool rmnet_dtr_status;

	bool rwake_inprogress;

	/* To test remote wakeup using debugfs */
	struct timer_list gsi_rw_timer;
	u8 debugfs_rw_timer_enable;