diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-20 14:38:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-20 14:38:02 -0400 |
commit | 1cd653a665b08a3920e320a71b4ac5b80d36953c (patch) | |
tree | f600a1885faeb16ddb54445235480ae56941a3e7 /drivers/usb/core | |
parent | c1acb0ba330b3bcf4b110c4ae538f4f80b991fda (diff) | |
parent | 2d5733fcd33dd451022d197cb6b476e970519ca7 (diff) |
Merge tag 'usb-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg Kroah-Hartman:
"Here are a number of tiny USB fixes for 3.4-rc4.
Most of them are in the USB gadget area, but a few other minor USB
driver and core fixes are here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'usb-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits)
USB: serial: cp210x: Fixed usb_control_msg timeout values
USB: ehci-tegra: don't call set_irq_flags(IRQF_VALID)
USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb
USB: yurex: Remove allocation of coherent buffer for setup-packet buffer
drivers/usb/misc/usbtest.c: add kfrees
USB: ehci-fsl: Fix kernel crash on mpc5121e
uwb: fix error handling
uwb: fix use of del_timer_sync() in interrupt
EHCI: always clear the STS_FLR status bit
EHCI: fix criterion for resuming the root hub
USB: sierra: avoid QMI/wwan interface on MC77xx
usb: usbtest: avoid integer overflow in alloc_sglist()
usb: usbtest: avoid integer overflow in test_ctrl_queue()
USB: fix deadlock in bConfigurationValue attribute method
usb: gadget: eliminate NULL pointer dereference (bugfix)
usb: gadget: uvc: Remove non-required locking from 'uvc_queue_next_buffer' routine
usb: gadget: rndis: fix Missing req->context assignment
usb: musb: omap: fix the error check for pm_runtime_get_sync
usb: gadget: udc-core: fix asymmetric calls in remove_driver
usb: musb: omap: fix crash when musb glue (omap) gets initialized
...
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hub.c | 3 | ||||
-rw-r--r-- | drivers/usb/core/message.c | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index a2aa9d652c67..ec6c97dadbe4 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1667,7 +1667,6 @@ void usb_disconnect(struct usb_device **pdev) | |||
1667 | { | 1667 | { |
1668 | struct usb_device *udev = *pdev; | 1668 | struct usb_device *udev = *pdev; |
1669 | int i; | 1669 | int i; |
1670 | struct usb_hcd *hcd = bus_to_hcd(udev->bus); | ||
1671 | 1670 | ||
1672 | /* mark the device as inactive, so any further urb submissions for | 1671 | /* mark the device as inactive, so any further urb submissions for |
1673 | * this device (and any of its children) will fail immediately. | 1672 | * this device (and any of its children) will fail immediately. |
@@ -1690,9 +1689,7 @@ void usb_disconnect(struct usb_device **pdev) | |||
1690 | * so that the hardware is now fully quiesced. | 1689 | * so that the hardware is now fully quiesced. |
1691 | */ | 1690 | */ |
1692 | dev_dbg (&udev->dev, "unregistering device\n"); | 1691 | dev_dbg (&udev->dev, "unregistering device\n"); |
1693 | mutex_lock(hcd->bandwidth_mutex); | ||
1694 | usb_disable_device(udev, 0); | 1692 | usb_disable_device(udev, 0); |
1695 | mutex_unlock(hcd->bandwidth_mutex); | ||
1696 | usb_hcd_synchronize_unlinks(udev); | 1693 | usb_hcd_synchronize_unlinks(udev); |
1697 | 1694 | ||
1698 | usb_remove_ep_devs(&udev->ep0); | 1695 | usb_remove_ep_devs(&udev->ep0); |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index aed3e07942d4..ca717da3be95 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1136,8 +1136,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, | |||
1136 | * Deallocates hcd/hardware state for the endpoints (nuking all or most | 1136 | * Deallocates hcd/hardware state for the endpoints (nuking all or most |
1137 | * pending urbs) and usbcore state for the interfaces, so that usbcore | 1137 | * pending urbs) and usbcore state for the interfaces, so that usbcore |
1138 | * must usb_set_configuration() before any interfaces could be used. | 1138 | * must usb_set_configuration() before any interfaces could be used. |
1139 | * | ||
1140 | * Must be called with hcd->bandwidth_mutex held. | ||
1141 | */ | 1139 | */ |
1142 | void usb_disable_device(struct usb_device *dev, int skip_ep0) | 1140 | void usb_disable_device(struct usb_device *dev, int skip_ep0) |
1143 | { | 1141 | { |
@@ -1190,7 +1188,9 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) | |||
1190 | usb_disable_endpoint(dev, i + USB_DIR_IN, false); | 1188 | usb_disable_endpoint(dev, i + USB_DIR_IN, false); |
1191 | } | 1189 | } |
1192 | /* Remove endpoints from the host controller internal state */ | 1190 | /* Remove endpoints from the host controller internal state */ |
1191 | mutex_lock(hcd->bandwidth_mutex); | ||
1193 | usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); | 1192 | usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
1193 | mutex_unlock(hcd->bandwidth_mutex); | ||
1194 | /* Second pass: remove endpoint pointers */ | 1194 | /* Second pass: remove endpoint pointers */ |
1195 | } | 1195 | } |
1196 | for (i = skip_ep0; i < 16; ++i) { | 1196 | for (i = skip_ep0; i < 16; ++i) { |
@@ -1750,7 +1750,6 @@ free_interfaces: | |||
1750 | /* if it's already configured, clear out old state first. | 1750 | /* if it's already configured, clear out old state first. |
1751 | * getting rid of old interfaces means unbinding their drivers. | 1751 | * getting rid of old interfaces means unbinding their drivers. |
1752 | */ | 1752 | */ |
1753 | mutex_lock(hcd->bandwidth_mutex); | ||
1754 | if (dev->state != USB_STATE_ADDRESS) | 1753 | if (dev->state != USB_STATE_ADDRESS) |
1755 | usb_disable_device(dev, 1); /* Skip ep0 */ | 1754 | usb_disable_device(dev, 1); /* Skip ep0 */ |
1756 | 1755 | ||
@@ -1763,6 +1762,7 @@ free_interfaces: | |||
1763 | * host controller will not allow submissions to dropped endpoints. If | 1762 | * host controller will not allow submissions to dropped endpoints. If |
1764 | * this call fails, the device state is unchanged. | 1763 | * this call fails, the device state is unchanged. |
1765 | */ | 1764 | */ |
1765 | mutex_lock(hcd->bandwidth_mutex); | ||
1766 | ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); | 1766 | ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); |
1767 | if (ret < 0) { | 1767 | if (ret < 0) { |
1768 | mutex_unlock(hcd->bandwidth_mutex); | 1768 | mutex_unlock(hcd->bandwidth_mutex); |