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

Commit 1e1f1160 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: android: Schedule work only if suspended variable is changed"

parents 7cb11d4b 0bfba7f3
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2808,13 +2808,10 @@ static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc,
		}
	}

	/*
	 * Notify suspend only to gadget driver, but not resume. Resume is
	 * notified as part of wakeup event in dwc3_gadget_wakeup_interrupt().
	 */
	if (next == DWC3_LINK_STATE_U0) {
		if (dwc->link_state == DWC3_LINK_STATE_U3) {
			dbg_event(0xFF, "RESUME", 0);
			dwc->gadget_driver->resume(&dwc->gadget);
		}
	} else if (next == DWC3_LINK_STATE_U3) {
		dbg_event(0xFF, "SUSPEND", 0);
+8 −4
Original line number Diff line number Diff line
@@ -3122,8 +3122,10 @@ static void android_suspend(struct usb_gadget *gadget)
	unsigned long flags;

	spin_lock_irqsave(&cdev->lock, flags);
	if (!dev->suspended) {
		dev->suspended = 1;
		schedule_work(&dev->work);
	}
	spin_unlock_irqrestore(&cdev->lock, flags);

	composite_suspend_func(gadget);
@@ -3136,8 +3138,10 @@ static void android_resume(struct usb_gadget *gadget)
	unsigned long flags;

	spin_lock_irqsave(&cdev->lock, flags);
	if (dev->suspended) {
		dev->suspended = 0;
		schedule_work(&dev->work);
	}
	spin_unlock_irqrestore(&cdev->lock, flags);

	composite_resume_func(gadget);