diff options
author | JP Abgrall <jpa@google.com> | 2012-05-04 15:03:06 -0700 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2012-05-04 15:03:06 -0700 |
commit | 84b5110abf84dfe8cbcb1434488f259137ac232e (patch) | |
tree | 77ceac266f22138afee355b00f0b8d075b23d73a /drivers/usb/core/message.c | |
parent | 601b4b2b4a396b69e4524d1c3065d0d80efd0cb5 (diff) | |
parent | 758aaf52f607604164e93feff93b725d491e44f7 (diff) | |
download | kernel_samsung_crespo-84b5110abf84dfe8cbcb1434488f259137ac232e.zip kernel_samsung_crespo-84b5110abf84dfe8cbcb1434488f259137ac232e.tar.gz kernel_samsung_crespo-84b5110abf84dfe8cbcb1434488f259137ac232e.tar.bz2 |
Merge remote-tracking branch 'common/android-3.0' into android-samsung-30-wip-mergedown
* common/android-3.0: (135 commits)
net: wireless: bcmdhd: Avoid turning radio UP twice on start
cpufreq: interactive: add boost pulse interface
net: wireless: bcmdhd: Set MMC_PM_KEEP_POWER flag on suspend
net: wireless: bcmdhd: Update to Version 5.90.195.61
net: wireless: bcmdhd: Turn OFF wlan power if interface UP fails
ARM: vfp: only clear vfp state for current cpu in vfp_pm_suspend
arm: vfp: Fix memory corruption on PM suspend
Linux 3.0.30
tcp: fix TCP_MAXSEG for established IPv6 passive sockets
net ax25: Reorder ax25_exit to remove races.
ksz884x: don't copy too much in netdev_set_mac_address()
netns: do not leak net_generic data on failed init
tcp: fix tcp_grow_window() for large incoming frames
dummy: Add ndo_uninit().
net: usb: smsc75xx: fix mtu
net_sched: gred: Fix oops in gred_dump() in WRED mode
net/ethernet: ks8851_mll fix rx frame buffer overflow
net: smsc911x: fix skb handling in receive path
8139cp: set intr mask after its handler is registered
atl1: fix kernel panic in case of DMA errors
...
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r-- | drivers/usb/core/message.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 0b5ec23..1eebd45 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -308,7 +308,8 @@ static void sg_complete(struct urb *urb) retval = usb_unlink_urb(io->urbs [i]); if (retval != -EINPROGRESS && retval != -ENODEV && - retval != -EBUSY) + retval != -EBUSY && + retval != -EIDRM) dev_err(&io->dev->dev, "%s, unlink --> %d\n", __func__, retval); @@ -317,7 +318,6 @@ static void sg_complete(struct urb *urb) } spin_lock(&io->lock); } - urb->dev = NULL; /* on the last completion, signal usb_sg_wait() */ io->bytes += urb->actual_length; @@ -524,7 +524,6 @@ void usb_sg_wait(struct usb_sg_request *io) case -ENXIO: /* hc didn't queue this one */ case -EAGAIN: case -ENOMEM: - io->urbs[i]->dev = NULL; retval = 0; yield(); break; @@ -542,7 +541,6 @@ void usb_sg_wait(struct usb_sg_request *io) /* fail any uncompleted urbs */ default: - io->urbs[i]->dev = NULL; io->urbs[i]->status = retval; dev_dbg(&io->dev->dev, "%s, submit --> %d\n", __func__, retval); @@ -593,7 +591,10 @@ void usb_sg_cancel(struct usb_sg_request *io) if (!io->urbs [i]->dev) continue; retval = usb_unlink_urb(io->urbs [i]); - if (retval != -EINPROGRESS && retval != -EBUSY) + if (retval != -EINPROGRESS + && retval != -ENODEV + && retval != -EBUSY + && retval != -EIDRM) dev_warn(&io->dev->dev, "%s, unlink --> %d\n", __func__, retval); } @@ -1135,8 +1136,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, * Deallocates hcd/hardware state for the endpoints (nuking all or most * pending urbs) and usbcore state for the interfaces, so that usbcore * must usb_set_configuration() before any interfaces could be used. - * - * Must be called with hcd->bandwidth_mutex held. */ void usb_disable_device(struct usb_device *dev, int skip_ep0) { @@ -1189,7 +1188,9 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) usb_disable_endpoint(dev, i + USB_DIR_IN, false); } /* Remove endpoints from the host controller internal state */ + mutex_lock(hcd->bandwidth_mutex); usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); + mutex_unlock(hcd->bandwidth_mutex); /* Second pass: remove endpoint pointers */ } for (i = skip_ep0; i < 16; ++i) { @@ -1749,7 +1750,6 @@ free_interfaces: /* if it's already configured, clear out old state first. * getting rid of old interfaces means unbinding their drivers. */ - mutex_lock(hcd->bandwidth_mutex); if (dev->state != USB_STATE_ADDRESS) usb_disable_device(dev, 1); /* Skip ep0 */ @@ -1762,6 +1762,7 @@ free_interfaces: * host controller will not allow submissions to dropped endpoints. If * this call fails, the device state is unchanged. */ + mutex_lock(hcd->bandwidth_mutex); ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); if (ret < 0) { mutex_unlock(hcd->bandwidth_mutex); |