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

Commit 723c9140 authored by Sriharsha Allenki's avatar Sriharsha Allenki
Browse files

usb: gadget: Fix remote wakeup failure in Superspeed Plus



The speed checks in the code path to initiate remote wakeup
fails any remote wakeup requests by the function drivers
in Superspeed Plus mode and allows it only in Superspeed mode.
Hence fix this checks to support the remote wakeup capability
in Superspeed Plus mode as well.

Change-Id: Ieaa61325b2fc0006943506292a3819748fcc7600
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent 432c6504
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1933,7 +1933,7 @@ static int dwc3_gadget_wakeup_int(struct dwc3 *dwc)
	case DWC3_LINK_STATE_U3:	/* in HS, means SUSPEND */
		break;
	case DWC3_LINK_STATE_U1:
		if (dwc->gadget.speed != USB_SPEED_SUPER) {
		if (dwc->gadget.speed < USB_SPEED_SUPER) {
			link_recover_only = true;
			break;
		}
@@ -2042,7 +2042,7 @@ static int dwc_gadget_func_wakeup(struct usb_gadget *g, int interface_id)
	int ret = 0;
	struct dwc3 *dwc = gadget_to_dwc(g);

	if (!g || (g->speed != USB_SPEED_SUPER))
	if (!g || (g->speed < USB_SPEED_SUPER))
		return -ENOTSUPP;

	if (dwc3_gadget_is_suspended(dwc)) {
+1 −1
Original line number Diff line number Diff line
@@ -458,7 +458,7 @@ static int usb_func_wakeup_int(struct usb_function *func)
		return -EINVAL;

	gadget = func->config->cdev->gadget;
	if ((gadget->speed != USB_SPEED_SUPER) || !func->func_wakeup_allowed) {
	if ((gadget->speed < USB_SPEED_SUPER) || !func->func_wakeup_allowed) {
		DBG(func->config->cdev,
			"Function Wakeup is not possible. speed=%u, func_wakeup_allowed=%u\n",
			gadget->speed,
+1 −1
Original line number Diff line number Diff line
@@ -1649,7 +1649,7 @@ static ssize_t cser_rw_write(struct file *file, const char __user *ubuf,
	port->debugfs_rw_enable = !!input;
	if (port->debugfs_rw_enable) {
		gadget = cser->func.config->cdev->gadget;
		if (gadget->speed == USB_SPEED_SUPER &&
		if (gadget->speed >= USB_SPEED_SUPER &&
			func->func_is_suspended) {
			pr_debug("Calling usb_func_wakeup\n");
			ret = usb_func_wakeup(func);
+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ EXPORT_SYMBOL(usb_gsi_ep_op);
int usb_gadget_func_wakeup(struct usb_gadget *gadget,
	int interface_id)
{
	if (gadget->speed != USB_SPEED_SUPER)
	if (gadget->speed < USB_SPEED_SUPER)
		return -EOPNOTSUPP;

	if (!gadget->ops->func_wakeup)