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

Commit db8cbfad authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB fixes from Greg KH:
 "Here are a number of USB fixes for 3.11-rc3.

  Lots of little things, nothing major.  A number of new device ids,
  build fixes for DMA, and a bunch of other minor things.  All of these
  have been in the linux-next tree"

* tag 'usb-3.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (40 commits)
  usb: Clear both buffers when clearing a control transfer TT buffer.
  usb/gadget: free opts struct on error recovery
  USB: mos7840: fix memory leak in open
  usb: serial: option.c: remove ONDA MT825UP product ID fromdriver
  usb: serial: option: add Olivetti Olicard 200
  usb: serial: option: blacklist ONDA MT689DC QMI interface
  xhci: fix null pointer dereference on ring_doorbell_for_active_rings
  usb: host: xhci: Enable XHCI_SPURIOUS_SUCCESS for all controllers with xhci 1.0
  usb: fix build warning in pci-quirks.h when CONFIG_PCI is not enabled
  usb: xhci: Mark two functions __maybe_unused
  xhci: Avoid NULL pointer deref when host dies.
  usb: serial: option: Add ONYX 3G device support
  USB: ti_usb_3410_5052: fix dynamic-id matching
  usb: option: add TP-LINK MA260
  USB: option: add D-Link DWM-152/C1 and DWM-156/C1
  USB: EHCI: Fix resume signalling on remote wakeup
  USB: cp210x: add MMB and PI ZigBee USB Device Support
  usb: cp210x support SEL C662 Vendor/Device
  USB: option: append Petatel NP10T device to GSM modems list
  USB: misc: Add Manhattan Hi-Speed USB DVI Converter to sisusbvga
  ...
parents ab20fb81 2c7b871b
Loading
Loading
Loading
Loading
+40 −8
Original line number Diff line number Diff line
@@ -668,6 +668,15 @@ resubmit:
static inline int
hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
{
	/* Need to clear both directions for control ep */
	if (((devinfo >> 11) & USB_ENDPOINT_XFERTYPE_MASK) ==
			USB_ENDPOINT_XFER_CONTROL) {
		int status = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
				HUB_CLEAR_TT_BUFFER, USB_RT_PORT,
				devinfo ^ 0x8000, tt, NULL, 0, 1000);
		if (status)
			return status;
	}
	return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
			       HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo,
			       tt, NULL, 0, 1000);
@@ -2848,6 +2857,15 @@ static int usb_disable_function_remotewakeup(struct usb_device *udev)
				USB_CTRL_SET_TIMEOUT);
}

/* Count of wakeup-enabled devices at or below udev */
static unsigned wakeup_enabled_descendants(struct usb_device *udev)
{
	struct usb_hub *hub = usb_hub_to_struct_hub(udev);

	return udev->do_remote_wakeup +
			(hub ? hub->wakeup_enabled_descendants : 0);
}

/*
 * usb_port_suspend - suspend a usb device's upstream port
 * @udev: device that's no longer in active use, not a root hub
@@ -2888,8 +2906,8 @@ static int usb_disable_function_remotewakeup(struct usb_device *udev)
 * Linux (2.6) currently has NO mechanisms to initiate that:  no khubd
 * timer, no SRP, no requests through sysfs.
 *
 * If Runtime PM isn't enabled or used, non-SuperSpeed devices really get
 * suspended only when their bus goes into global suspend (i.e., the root
 * If Runtime PM isn't enabled or used, non-SuperSpeed devices may not get
 * suspended until their bus goes into global suspend (i.e., the root
 * hub is suspended).  Nevertheless, we change @udev->state to
 * USB_STATE_SUSPENDED as this is the device's "logical" state.  The actual
 * upstream port setting is stored in @udev->port_is_suspended.
@@ -2960,15 +2978,21 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
	/* see 7.1.7.6 */
	if (hub_is_superspeed(hub->hdev))
		status = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_U3);
	else if (PMSG_IS_AUTO(msg))
		status = set_port_feature(hub->hdev, port1,
						USB_PORT_FEAT_SUSPEND);

	/*
	 * For system suspend, we do not need to enable the suspend feature
	 * on individual USB-2 ports.  The devices will automatically go
	 * into suspend a few ms after the root hub stops sending packets.
	 * The USB 2.0 spec calls this "global suspend".
	 *
	 * However, many USB hubs have a bug: They don't relay wakeup requests
	 * from a downstream port if the port's suspend feature isn't on.
	 * Therefore we will turn on the suspend feature if udev or any of its
	 * descendants is enabled for remote wakeup.
	 */
	else if (PMSG_IS_AUTO(msg) || wakeup_enabled_descendants(udev) > 0)
		status = set_port_feature(hub->hdev, port1,
				USB_PORT_FEAT_SUSPEND);
	else {
		really_suspend = false;
		status = 0;
@@ -3003,15 +3027,16 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
		if (!PMSG_IS_AUTO(msg))
			status = 0;
	} else {
		/* device has up to 10 msec to fully suspend */
		dev_dbg(&udev->dev, "usb %ssuspend, wakeup %d\n",
				(PMSG_IS_AUTO(msg) ? "auto-" : ""),
				udev->do_remote_wakeup);
		usb_set_device_state(udev, USB_STATE_SUSPENDED);
		if (really_suspend) {
			udev->port_is_suspended = 1;

			/* device has up to 10 msec to fully suspend */
			msleep(10);
		}
		usb_set_device_state(udev, USB_STATE_SUSPENDED);
	}

	/*
@@ -3293,7 +3318,11 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
	unsigned		port1;
	int			status;

	/* Warn if children aren't already suspended */
	/*
	 * Warn if children aren't already suspended.
	 * Also, add up the number of wakeup-enabled descendants.
	 */
	hub->wakeup_enabled_descendants = 0;
	for (port1 = 1; port1 <= hdev->maxchild; port1++) {
		struct usb_device	*udev;

@@ -3303,6 +3332,9 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
			if (PMSG_IS_AUTO(msg))
				return -EBUSY;
		}
		if (udev)
			hub->wakeup_enabled_descendants +=
					wakeup_enabled_descendants(udev);
	}

	if (hdev->do_remote_wakeup && hub->quirk_check_port_auto_suspend) {
+3 −0
Original line number Diff line number Diff line
@@ -59,6 +59,9 @@ struct usb_hub {
	struct usb_tt		tt;		/* Transaction Translator */

	unsigned		mA_per_port;	/* current for each child */
#ifdef	CONFIG_PM
	unsigned		wakeup_enabled_descendants;
#endif

	unsigned		limited_power:1;
	unsigned		quiescing:1;
+1 −1
Original line number Diff line number Diff line
config USB_DWC3
	tristate "DesignWare USB3 DRD Core Support"
	depends on (USB || USB_GADGET) && GENERIC_HARDIRQS
	depends on (USB || USB_GADGET) && GENERIC_HARDIRQS && HAS_DMA
	select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
	help
	  Say Y or M here if your system has a Dual Role SuperSpeed
+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ static int dwc3_probe(struct platform_device *pdev)
	}

	if (IS_ERR(dwc->usb3_phy)) {
		ret = PTR_ERR(dwc->usb2_phy);
		ret = PTR_ERR(dwc->usb3_phy);

		/*
		 * if -ENXIO is returned, it means PHY layer wasn't
+2 −2
Original line number Diff line number Diff line
@@ -759,8 +759,8 @@ struct dwc3 {

struct dwc3_event_type {
	u32	is_devspec:1;
	u32	type:6;
	u32	reserved8_31:25;
	u32	type:7;
	u32	reserved8_31:24;
} __packed;

#define DWC3_DEPEVT_XFERCOMPLETE	0x01
Loading