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

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

Merge "usb: core: Replace msleep with usleep_range"

parents e580f8dc d25803f1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2993,6 +2993,9 @@ void usb_remove_hcd(struct usb_hcd *hcd)
	cancel_work_sync(&hcd->wakeup_work);
#endif

	/* handle any pending hub events before XHCI stops */
	usb_flush_hub_wq();

	mutex_lock(&usb_bus_idr_lock);
	usb_disconnect(&rhdev);		/* Sets rhdev to NULL */
	mutex_unlock(&usb_bus_idr_lock);
+9 −2
Original line number Diff line number Diff line
@@ -638,6 +638,12 @@ void usb_kick_hub_wq(struct usb_device *hdev)
		kick_hub_wq(hub);
}

void usb_flush_hub_wq(void)
{
	flush_workqueue(hub_wq);
}
EXPORT_SYMBOL(usb_flush_hub_wq);

/*
 * Let the USB core know that a USB 3.0 device has sent a Function Wake Device
 * Notification, which indicates it had initiated remote wakeup.
@@ -3430,7 +3436,8 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
		/* drive resume for USB_RESUME_TIMEOUT msec */
		dev_dbg(&udev->dev, "usb %sresume\n",
				(PMSG_IS_AUTO(msg) ? "auto-" : ""));
		msleep(USB_RESUME_TIMEOUT);
		usleep_range(USB_RESUME_TIMEOUT * 1000,
				(USB_RESUME_TIMEOUT + 1) * 1000);

		/* Virtual root hubs can trigger on GET_PORT_STATUS to
		 * stop resume signaling.  Then finish the resume
@@ -3439,7 +3446,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
		status = hub_port_status(hub, port1, &portstatus, &portchange);

		/* TRSMRCY = 10 msec */
		msleep(10);
		usleep_range(10000, 10500);
	}

 SuspendCleared:
+1 −1
Original line number Diff line number Diff line
@@ -1356,7 +1356,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
				xhci_set_link_state(xhci, port_array, wIndex,
							XDEV_RESUME);
				spin_unlock_irqrestore(&xhci->lock, flags);
				msleep(USB_RESUME_TIMEOUT);
				usleep_range(21000, 21500);
				spin_lock_irqsave(&xhci->lock, flags);
				xhci_set_link_state(xhci, port_array, wIndex,
							XDEV_U0);
+1 −1
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ extern void usb_hc_died(struct usb_hcd *hcd);
extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd);
extern void usb_wakeup_notification(struct usb_device *hdev,
		unsigned int portnum);

extern void usb_flush_hub_wq(void);
extern void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum);
extern void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum);