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

Commit 7c427f45 authored by Linus Torvalds's avatar Linus Torvalds
Browse files


Pull USB fixes from Greg KH:
 "Here are a number of fixes for the USB core and drivers for 3.4-rc2

  Lots of tiny xhci fixes here, a few usb-serial driver fixes and new
  device ids, and a smattering of other minor fixes in different USB
  drivers.

  Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org&gt;">

* tag 'usb-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (30 commits)
  USB: update usbtmc api documentation
  xHCI: Correct the #define XHCI_LEGACY_DISABLE_SMI
  xHCI: use gfp flags from caller instead of GFP_ATOMIC
  xHCI: add XHCI_RESET_ON_RESUME quirk for VIA xHCI host
  USB: fix bug of device descriptor got from superspeed device
  xhci: Fix register save/restore order.
  xhci: Restore event ring dequeue pointer on resume.
  xhci: Don't write zeroed pointers to xHC registers.
  xhci: Warn when hosts don't halt.
  xhci: don't re-enable IE constantly
  usb: xhci: fix section mismatch in linux-next
  xHCI: correct to print the true HSEE of USBCMD
  USB: serial: fix race between probe and open
  UHCI: hub_status_data should indicate if ports are resuming
  EHCI: keep track of ports being resumed and indicate in hub_status_data
  USB: fix race between root-hub suspend and remote wakeup
  USB: sierra: add support for Sierra Wireless MC7710
  USB: ftdi_sio: fix race condition in TIOCMIWAIT, and abort of TIOCMIWAIT when the device is removed
  USB: ftdi_sio: fix status line change handling for TIOCMIWAIT and TIOCGICOUNT
  USB: don't ignore suspend errors for root hubs
  ...
parents f4f9c1ac 9de29225
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
What:		/sys/bus/usb/drivers/usbtmc/devices/*/interface_capabilities
What:		/sys/bus/usb/drivers/usbtmc/devices/*/device_capabilities
What:		/sys/bus/usb/drivers/usbtmc/*/interface_capabilities
What:		/sys/bus/usb/drivers/usbtmc/*/device_capabilities
Date:		August 2008
Contact:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Description:
@@ -12,8 +12,8 @@ Description:
		The files are read only.


What:		/sys/bus/usb/drivers/usbtmc/devices/*/usb488_interface_capabilities
What:		/sys/bus/usb/drivers/usbtmc/devices/*/usb488_device_capabilities
What:		/sys/bus/usb/drivers/usbtmc/*/usb488_interface_capabilities
What:		/sys/bus/usb/drivers/usbtmc/*/usb488_device_capabilities
Date:		August 2008
Contact:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Description:
@@ -27,7 +27,7 @@ Description:
		The files are read only.


What:		/sys/bus/usb/drivers/usbtmc/devices/*/TermChar
What:		/sys/bus/usb/drivers/usbtmc/*/TermChar
Date:		August 2008
Contact:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Description:
@@ -40,7 +40,7 @@ Description:
		sent to the device or not.


What:		/sys/bus/usb/drivers/usbtmc/devices/*/TermCharEnabled
What:		/sys/bus/usb/drivers/usbtmc/*/TermCharEnabled
Date:		August 2008
Contact:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Description:
@@ -51,7 +51,7 @@ Description:
		published by the USB-IF.


What:		/sys/bus/usb/drivers/usbtmc/devices/*/auto_abort
What:		/sys/bus/usb/drivers/usbtmc/*/auto_abort
Date:		August 2008
Contact:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Description:
+22 −0
Original line number Diff line number Diff line
@@ -168,6 +168,28 @@ that if the completion handler or anyone else tries to resubmit it
they will get a -EPERM error.  Thus you can be sure that when
usb_kill_urb() returns, the URB is totally idle.

There is a lifetime issue to consider.  An URB may complete at any
time, and the completion handler may free the URB.  If this happens
while usb_unlink_urb or usb_kill_urb is running, it will cause a
memory-access violation.  The driver is responsible for avoiding this,
which often means some sort of lock will be needed to prevent the URB
from being deallocated while it is still in use.

On the other hand, since usb_unlink_urb may end up calling the
completion handler, the handler must not take any lock that is held
when usb_unlink_urb is invoked.  The general solution to this problem
is to increment the URB's reference count while holding the lock, then
drop the lock and call usb_unlink_urb or usb_kill_urb, and then
decrement the URB's reference count.  You increment the reference
count by calling

	struct urb *usb_get_urb(struct urb *urb)

(ignore the return value; it is the same as the argument) and
decrement the reference count by calling usb_free_urb.  Of course,
none of this is necessary if there's no danger of the URB being freed
by the completion handler.


1.7. What about the completion handler?

+3 −3
Original line number Diff line number Diff line
@@ -183,10 +183,10 @@ An input control transfer to get a port status.
d5ea89a0 3575914555 S Ci:1:001:0 s a3 00 0000 0003 0004 4 <
d5ea89a0 3575914560 C Ci:1:001:0 0 4 = 01050000

An output bulk transfer to send a SCSI command 0x5E in a 31-byte Bulk wrapper
to a storage device at address 5:
An output bulk transfer to send a SCSI command 0x28 (READ_10) in a 31-byte
Bulk wrapper to a storage device at address 5:

dd65f0e8 4128379752 S Bo:1:005:2 -115 31 = 55534243 5e000000 00000000 00000600 00000000 00000000 00000000 000000
dd65f0e8 4128379752 S Bo:1:005:2 -115 31 = 55534243 ad000000 00800000 80010a28 20000000 20000040 00000000 000000
dd65f0e8 4128379808 C Bo:1:005:2 0 31 >

* Raw binary format and API
+8 −8
Original line number Diff line number Diff line
@@ -2,14 +2,6 @@
# USB device configuration
#

menuconfig USB_SUPPORT
	bool "USB support"
	depends on HAS_IOMEM
	default y
	---help---
	  This option adds core support for Universal Serial Bus (USB).
	  You will also need drivers from the following menu to make use of it.

# many non-PCI SOC chips embed OHCI
config USB_ARCH_HAS_OHCI
	boolean
@@ -63,6 +55,14 @@ config USB_ARCH_HAS_XHCI
	boolean
	default PCI

menuconfig USB_SUPPORT
	bool "USB support"
	depends on HAS_IOMEM
	default y
	---help---
	  This option adds core support for Universal Serial Bus (USB).
	  You will also need drivers from the following menu to make use of it.

if USB_SUPPORT

config USB_COMMON
+7 −2
Original line number Diff line number Diff line
@@ -1189,8 +1189,13 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
	if (status == 0) {
		status = usb_suspend_device(udev, msg);

		/* Again, ignore errors during system sleep transitions */
		if (!PMSG_IS_AUTO(msg))
		/*
		 * Ignore errors from non-root-hub devices during
		 * system sleep transitions.  For the most part,
		 * these devices should go to low power anyway when
		 * the entire bus is suspended.
		 */
		if (udev->parent && !PMSG_IS_AUTO(msg))
			status = 0;
	}

Loading