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

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

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

parents 659e85f5 aadf97de
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -218,6 +218,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
@@ -240,6 +242,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;
}

@@ -517,6 +522,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;

@@ -2642,6 +2648,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
@@ -278,6 +278,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;