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 Original line Diff line number Diff line
@@ -218,6 +218,8 @@ static int gsi_wakeup_host(struct f_gsi *gsi)
		return -ENODEV;
		return -ENODEV;
	}
	}


	gsi->rwake_inprogress = true;

	/*
	/*
	 * In Super-Speed mode, remote wakeup is not allowed for suspended
	 * In Super-Speed mode, remote wakeup is not allowed for suspended
	 * functions which have been disallowed by the host to issue Function
	 * 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)
	else if (ret)
		log_event_err("wakeup failed. ret=%d.", ret);
		log_event_err("wakeup failed. ret=%d.", ret);


	if (ret)
		gsi->rwake_inprogress = false;

	return ret;
	return ret;
}
}


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


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


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


	gsi->rwake_inprogress = false;

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


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


	bool rwake_inprogress;

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