aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-26 13:29:40 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-26 13:29:40 -0400
commit5a54bd1307471c1cd0521402fe65e2057edcab2f (patch)
tree25fb6a543db4ccc11b6d5662ed2e7facfce39ae7 /drivers/usb
parentf9f35677d81adb0feedcd6e0e661784805c8facd (diff)
parent8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff)
Merge commit 'v2.6.29' into core/header-fixes
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/Makefile1
-rw-r--r--drivers/usb/atm/cxacru.c3
-rw-r--r--drivers/usb/class/cdc-acm.c12
-rw-r--r--drivers/usb/class/usbtmc.c4
-rw-r--r--drivers/usb/core/devio.c12
-rw-r--r--drivers/usb/core/hcd-pci.c15
-rw-r--r--drivers/usb/core/hcd.h1
-rw-r--r--drivers/usb/core/message.c11
-rw-r--r--drivers/usb/gadget/Kconfig1
-rw-r--r--drivers/usb/gadget/f_obex.c4
-rw-r--r--drivers/usb/gadget/file_storage.c6
-rw-r--r--drivers/usb/gadget/fsl_qe_udc.c46
-rw-r--r--drivers/usb/gadget/fsl_usb2_udc.c3
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c4
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci-mem.c1
-rw-r--r--drivers/usb/host/ehci-pci.c1
-rw-r--r--drivers/usb/host/ehci-q.c3
-rw-r--r--drivers/usb/host/ehci-sched.c66
-rw-r--r--drivers/usb/host/ehci.h6
-rw-r--r--drivers/usb/host/ohci-pci.c1
-rw-r--r--drivers/usb/host/uhci-hcd.c1
-rw-r--r--drivers/usb/host/whci/asl.c13
-rw-r--r--drivers/usb/host/whci/hw.c15
-rw-r--r--drivers/usb/host/whci/pzl.c13
-rw-r--r--drivers/usb/host/whci/whcd.h1
-rw-r--r--drivers/usb/image/mdc800.c1
-rw-r--r--drivers/usb/misc/adutux.c6
-rw-r--r--drivers/usb/misc/vstusb.c1
-rw-r--r--drivers/usb/musb/davinci.c15
-rw-r--r--drivers/usb/musb/musb_core.c13
-rw-r--r--drivers/usb/musb/musb_gadget.c4
-rw-r--r--drivers/usb/musb/musb_host.c93
-rw-r--r--drivers/usb/serial/aircable.c4
-rw-r--r--drivers/usb/serial/cp2101.c1
-rw-r--r--drivers/usb/serial/ftdi_sio.c10
-rw-r--r--drivers/usb/serial/ftdi_sio.h23
-rw-r--r--drivers/usb/serial/option.c106
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c10
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.h2
-rw-r--r--drivers/usb/storage/scsiglue.c2
-rw-r--r--drivers/usb/storage/transport.c36
-rw-r--r--drivers/usb/storage/unusual_devs.h37
-rw-r--r--drivers/usb/wusbcore/devconnect.c1
-rw-r--r--drivers/usb/wusbcore/rh.c3
-rw-r--r--drivers/usb/wusbcore/wa-xfer.c4
46 files changed, 392 insertions, 226 deletions
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 8bcde8cde554..b2ceb4aff233 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_USB_MON) += mon/
11obj-$(CONFIG_PCI) += host/ 11obj-$(CONFIG_PCI) += host/
12obj-$(CONFIG_USB_EHCI_HCD) += host/ 12obj-$(CONFIG_USB_EHCI_HCD) += host/
13obj-$(CONFIG_USB_ISP116X_HCD) += host/ 13obj-$(CONFIG_USB_ISP116X_HCD) += host/
14obj-$(CONFIG_USB_ISP1760_HCD) += host/
14obj-$(CONFIG_USB_OHCI_HCD) += host/ 15obj-$(CONFIG_USB_OHCI_HCD) += host/
15obj-$(CONFIG_USB_UHCI_HCD) += host/ 16obj-$(CONFIG_USB_UHCI_HCD) += host/
16obj-$(CONFIG_USB_FHCI_HCD) += host/ 17obj-$(CONFIG_USB_FHCI_HCD) += host/
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 5ed4ae07bac1..6789089e2461 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -485,7 +485,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
485 usb_err(instance->usbatm, "requested transfer size too large (%d, %d)\n", 485 usb_err(instance->usbatm, "requested transfer size too large (%d, %d)\n",
486 wbuflen, rbuflen); 486 wbuflen, rbuflen);
487 ret = -ENOMEM; 487 ret = -ENOMEM;
488 goto fail; 488 goto err;
489 } 489 }
490 490
491 mutex_lock(&instance->cm_serialize); 491 mutex_lock(&instance->cm_serialize);
@@ -565,6 +565,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
565 dbg("cm %#x", cm); 565 dbg("cm %#x", cm);
566fail: 566fail:
567 mutex_unlock(&instance->cm_serialize); 567 mutex_unlock(&instance->cm_serialize);
568err:
568 return ret; 569 return ret;
569} 570}
570 571
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 97ba4a985edc..b3d5a23ab56f 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1349,9 +1349,6 @@ static struct usb_device_id acm_ids[] = {
1349 { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; andrey.arapov@gmail.com */ 1349 { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; andrey.arapov@gmail.com */
1350 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1350 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1351 }, 1351 },
1352 { USB_DEVICE(0x0e8d, 0x3329), /* i-blue 747, Qstarz BT-Q1000, Holux M-241 */
1353 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1354 },
1355 { USB_DEVICE(0x0e8d, 0x3329), /* MediaTek Inc GPS */ 1352 { USB_DEVICE(0x0e8d, 0x3329), /* MediaTek Inc GPS */
1356 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1353 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1357 }, 1354 },
@@ -1379,6 +1376,15 @@ static struct usb_device_id acm_ids[] = {
1379 { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */ 1376 { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */
1380 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1377 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1381 }, 1378 },
1379 { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
1380 },
1381 { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
1382 .driver_info = NO_UNION_NORMAL, /* union descriptor misplaced on
1383 data interface instead of
1384 communications interface.
1385 Maybe we should define a new
1386 quirk for this. */
1387 },
1382 1388
1383 /* control interfaces with various AT-command sets */ 1389 /* control interfaces with various AT-command sets */
1384 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, 1390 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 0f5c05f6f9df..c40a9b284cc9 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -50,6 +50,7 @@
50 50
51static struct usb_device_id usbtmc_devices[] = { 51static struct usb_device_id usbtmc_devices[] = {
52 { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 0), }, 52 { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 0), },
53 { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 1), },
53 { 0, } /* terminating entry */ 54 { 0, } /* terminating entry */
54}; 55};
55MODULE_DEVICE_TABLE(usb, usbtmc_devices); 56MODULE_DEVICE_TABLE(usb, usbtmc_devices);
@@ -106,12 +107,13 @@ static int usbtmc_open(struct inode *inode, struct file *filp)
106{ 107{
107 struct usb_interface *intf; 108 struct usb_interface *intf;
108 struct usbtmc_device_data *data; 109 struct usbtmc_device_data *data;
109 int retval = -ENODEV; 110 int retval = 0;
110 111
111 intf = usb_find_interface(&usbtmc_driver, iminor(inode)); 112 intf = usb_find_interface(&usbtmc_driver, iminor(inode));
112 if (!intf) { 113 if (!intf) {
113 printk(KERN_ERR KBUILD_MODNAME 114 printk(KERN_ERR KBUILD_MODNAME
114 ": can not find device for minor %d", iminor(inode)); 115 ": can not find device for minor %d", iminor(inode));
116 retval = -ENODEV;
115 goto exit; 117 goto exit;
116 } 118 }
117 119
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 7513bb083c15..6585f527e381 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -359,11 +359,6 @@ static void destroy_async(struct dev_state *ps, struct list_head *list)
359 spin_lock_irqsave(&ps->lock, flags); 359 spin_lock_irqsave(&ps->lock, flags);
360 } 360 }
361 spin_unlock_irqrestore(&ps->lock, flags); 361 spin_unlock_irqrestore(&ps->lock, flags);
362 as = async_getcompleted(ps);
363 while (as) {
364 free_async(as);
365 as = async_getcompleted(ps);
366 }
367} 362}
368 363
369static void destroy_async_on_interface(struct dev_state *ps, 364static void destroy_async_on_interface(struct dev_state *ps,
@@ -643,6 +638,7 @@ static int usbdev_release(struct inode *inode, struct file *file)
643 struct dev_state *ps = file->private_data; 638 struct dev_state *ps = file->private_data;
644 struct usb_device *dev = ps->dev; 639 struct usb_device *dev = ps->dev;
645 unsigned int ifnum; 640 unsigned int ifnum;
641 struct async *as;
646 642
647 usb_lock_device(dev); 643 usb_lock_device(dev);
648 644
@@ -661,6 +657,12 @@ static int usbdev_release(struct inode *inode, struct file *file)
661 usb_unlock_device(dev); 657 usb_unlock_device(dev);
662 usb_put_dev(dev); 658 usb_put_dev(dev);
663 put_pid(ps->disc_pid); 659 put_pid(ps->disc_pid);
660
661 as = async_getcompleted(ps);
662 while (as) {
663 free_async(as);
664 as = async_getcompleted(ps);
665 }
664 kfree(ps); 666 kfree(ps);
665 return 0; 667 return 0;
666} 668}
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index c54fc40458b1..a4301dc02d27 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -298,19 +298,6 @@ int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t message)
298EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend); 298EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend);
299 299
300/** 300/**
301 * usb_hcd_pci_resume_early - resume a PCI-based HCD before IRQs are enabled
302 * @dev: USB Host Controller being resumed
303 *
304 * Store this function in the HCD's struct pci_driver as .resume_early.
305 */
306int usb_hcd_pci_resume_early(struct pci_dev *dev)
307{
308 pci_restore_state(dev);
309 return 0;
310}
311EXPORT_SYMBOL_GPL(usb_hcd_pci_resume_early);
312
313/**
314 * usb_hcd_pci_resume - power management resume of a PCI-based HCD 301 * usb_hcd_pci_resume - power management resume of a PCI-based HCD
315 * @dev: USB Host Controller being resumed 302 * @dev: USB Host Controller being resumed
316 * 303 *
@@ -333,6 +320,8 @@ int usb_hcd_pci_resume(struct pci_dev *dev)
333 } 320 }
334#endif 321#endif
335 322
323 pci_restore_state(dev);
324
336 hcd = pci_get_drvdata(dev); 325 hcd = pci_get_drvdata(dev);
337 if (hcd->state != HC_STATE_SUSPENDED) { 326 if (hcd->state != HC_STATE_SUSPENDED) {
338 dev_dbg(hcd->self.controller, 327 dev_dbg(hcd->self.controller,
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 5b94a56bec23..f750eb1ab595 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -257,7 +257,6 @@ extern void usb_hcd_pci_remove(struct pci_dev *dev);
257 257
258#ifdef CONFIG_PM 258#ifdef CONFIG_PM
259extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t msg); 259extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t msg);
260extern int usb_hcd_pci_resume_early(struct pci_dev *dev);
261extern int usb_hcd_pci_resume(struct pci_dev *dev); 260extern int usb_hcd_pci_resume(struct pci_dev *dev);
262#endif /* CONFIG_PM */ 261#endif /* CONFIG_PM */
263 262
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 31fb204f44c6..49e7f56e0d7f 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -653,7 +653,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type,
653 if (result <= 0 && result != -ETIMEDOUT) 653 if (result <= 0 && result != -ETIMEDOUT)
654 continue; 654 continue;
655 if (result > 1 && ((u8 *)buf)[1] != type) { 655 if (result > 1 && ((u8 *)buf)[1] != type) {
656 result = -EPROTO; 656 result = -ENODATA;
657 continue; 657 continue;
658 } 658 }
659 break; 659 break;
@@ -696,8 +696,13 @@ static int usb_get_string(struct usb_device *dev, unsigned short langid,
696 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, 696 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
697 (USB_DT_STRING << 8) + index, langid, buf, size, 697 (USB_DT_STRING << 8) + index, langid, buf, size,
698 USB_CTRL_GET_TIMEOUT); 698 USB_CTRL_GET_TIMEOUT);
699 if (!(result == 0 || result == -EPIPE)) 699 if (result == 0 || result == -EPIPE)
700 break; 700 continue;
701 if (result > 1 && ((u8 *) buf)[1] != USB_DT_STRING) {
702 result = -ENODATA;
703 continue;
704 }
705 break;
701 } 706 }
702 return result; 707 return result;
703} 708}
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 3219d137340a..e55fef52a5dc 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -191,6 +191,7 @@ config USB_GADGET_OMAP
191 boolean "OMAP USB Device Controller" 191 boolean "OMAP USB Device Controller"
192 depends on ARCH_OMAP 192 depends on ARCH_OMAP
193 select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG 193 select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
194 select USB_OTG_UTILS if ARCH_OMAP
194 help 195 help
195 Many Texas Instruments OMAP processors have flexible full 196 Many Texas Instruments OMAP processors have flexible full
196 speed USB device controllers, with support for up to 30 197 speed USB device controllers, with support for up to 30
diff --git a/drivers/usb/gadget/f_obex.c b/drivers/usb/gadget/f_obex.c
index 80c2e7e9622f..38aa896cc5db 100644
--- a/drivers/usb/gadget/f_obex.c
+++ b/drivers/usb/gadget/f_obex.c
@@ -366,9 +366,9 @@ obex_bind(struct usb_configuration *c, struct usb_function *f)
366 f->hs_descriptors = usb_copy_descriptors(hs_function); 366 f->hs_descriptors = usb_copy_descriptors(hs_function);
367 367
368 obex->hs.obex_in = usb_find_endpoint(hs_function, 368 obex->hs.obex_in = usb_find_endpoint(hs_function,
369 f->descriptors, &obex_hs_ep_in_desc); 369 f->hs_descriptors, &obex_hs_ep_in_desc);
370 obex->hs.obex_out = usb_find_endpoint(hs_function, 370 obex->hs.obex_out = usb_find_endpoint(hs_function,
371 f->descriptors, &obex_hs_ep_out_desc); 371 f->hs_descriptors, &obex_hs_ep_out_desc);
372 } 372 }
373 373
374 /* Avoid letting this gadget enumerate until the userspace 374 /* Avoid letting this gadget enumerate until the userspace
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index b10fa31cc915..1ab9dac7e12d 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3879,7 +3879,11 @@ static int __init check_parameters(struct fsg_dev *fsg)
3879 mod_data.protocol_type = USB_SC_SCSI; 3879 mod_data.protocol_type = USB_SC_SCSI;
3880 mod_data.protocol_name = "Transparent SCSI"; 3880 mod_data.protocol_name = "Transparent SCSI";
3881 3881
3882 if (gadget_is_sh(fsg->gadget)) 3882 /* Some peripheral controllers are known not to be able to
3883 * halt bulk endpoints correctly. If one of them is present,
3884 * disable stalls.
3885 */
3886 if (gadget_is_sh(fsg->gadget) || gadget_is_at91(fsg->gadget))
3883 mod_data.can_stall = 0; 3887 mod_data.can_stall = 0;
3884 3888
3885 if (mod_data.release == 0xffff) { // Parameter wasn't set 3889 if (mod_data.release == 0xffff) { // Parameter wasn't set
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index d6c5bcd40064..d701bf4698d2 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -1622,6 +1622,8 @@ static int qe_ep_disable(struct usb_ep *_ep)
1622 nuke(ep, -ESHUTDOWN); 1622 nuke(ep, -ESHUTDOWN);
1623 ep->desc = NULL; 1623 ep->desc = NULL;
1624 ep->stopped = 1; 1624 ep->stopped = 1;
1625 ep->tx_req = NULL;
1626 qe_ep_reset(udc, ep->epnum);
1625 spin_unlock_irqrestore(&udc->lock, flags); 1627 spin_unlock_irqrestore(&udc->lock, flags);
1626 1628
1627 cpm_muram_free(cpm_muram_offset(ep->rxbase)); 1629 cpm_muram_free(cpm_muram_offset(ep->rxbase));
@@ -1681,14 +1683,11 @@ static void qe_free_request(struct usb_ep *_ep, struct usb_request *_req)
1681 kfree(req); 1683 kfree(req);
1682} 1684}
1683 1685
1684/* queues (submits) an I/O request to an endpoint */ 1686static int __qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req)
1685static int qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
1686 gfp_t gfp_flags)
1687{ 1687{
1688 struct qe_ep *ep = container_of(_ep, struct qe_ep, ep); 1688 struct qe_ep *ep = container_of(_ep, struct qe_ep, ep);
1689 struct qe_req *req = container_of(_req, struct qe_req, req); 1689 struct qe_req *req = container_of(_req, struct qe_req, req);
1690 struct qe_udc *udc; 1690 struct qe_udc *udc;
1691 unsigned long flags;
1692 int reval; 1691 int reval;
1693 1692
1694 udc = ep->udc; 1693 udc = ep->udc;
@@ -1732,7 +1731,7 @@ static int qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
1732 list_add_tail(&req->queue, &ep->queue); 1731 list_add_tail(&req->queue, &ep->queue);
1733 dev_vdbg(udc->dev, "gadget have request in %s! %d\n", 1732 dev_vdbg(udc->dev, "gadget have request in %s! %d\n",
1734 ep->name, req->req.length); 1733 ep->name, req->req.length);
1735 spin_lock_irqsave(&udc->lock, flags); 1734
1736 /* push the request to device */ 1735 /* push the request to device */
1737 if (ep_is_in(ep)) 1736 if (ep_is_in(ep))
1738 reval = ep_req_send(ep, req); 1737 reval = ep_req_send(ep, req);
@@ -1748,11 +1747,24 @@ static int qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
1748 if (ep->dir == USB_DIR_OUT) 1747 if (ep->dir == USB_DIR_OUT)
1749 reval = ep_req_receive(ep, req); 1748 reval = ep_req_receive(ep, req);
1750 1749
1751 spin_unlock_irqrestore(&udc->lock, flags);
1752
1753 return 0; 1750 return 0;
1754} 1751}
1755 1752
1753/* queues (submits) an I/O request to an endpoint */
1754static int qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
1755 gfp_t gfp_flags)
1756{
1757 struct qe_ep *ep = container_of(_ep, struct qe_ep, ep);
1758 struct qe_udc *udc = ep->udc;
1759 unsigned long flags;
1760 int ret;
1761
1762 spin_lock_irqsave(&udc->lock, flags);
1763 ret = __qe_ep_queue(_ep, _req);
1764 spin_unlock_irqrestore(&udc->lock, flags);
1765 return ret;
1766}
1767
1756/* dequeues (cancels, unlinks) an I/O request from an endpoint */ 1768/* dequeues (cancels, unlinks) an I/O request from an endpoint */
1757static int qe_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) 1769static int qe_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
1758{ 1770{
@@ -2008,7 +2020,7 @@ static void ch9getstatus(struct qe_udc *udc, u8 request_type, u16 value,
2008 udc->ep0_dir = USB_DIR_IN; 2020 udc->ep0_dir = USB_DIR_IN;
2009 2021
2010 /* data phase */ 2022 /* data phase */
2011 status = qe_ep_queue(&ep->ep, &req->req, GFP_ATOMIC); 2023 status = __qe_ep_queue(&ep->ep, &req->req);
2012 2024
2013 if (status == 0) 2025 if (status == 0)
2014 return; 2026 return;
@@ -2151,6 +2163,9 @@ static int reset_irq(struct qe_udc *udc)
2151{ 2163{
2152 unsigned char i; 2164 unsigned char i;
2153 2165
2166 if (udc->usb_state == USB_STATE_DEFAULT)
2167 return 0;
2168
2154 qe_usb_disable(); 2169 qe_usb_disable();
2155 out_8(&udc->usb_regs->usb_usadr, 0); 2170 out_8(&udc->usb_regs->usb_usadr, 0);
2156 2171
@@ -2442,8 +2457,12 @@ static int __devinit qe_udc_reg_init(struct qe_udc *udc)
2442 struct usb_ctlr __iomem *qe_usbregs; 2457 struct usb_ctlr __iomem *qe_usbregs;
2443 qe_usbregs = udc->usb_regs; 2458 qe_usbregs = udc->usb_regs;
2444 2459
2445 /* Init the usb register */ 2460 /* Spec says that we must enable the USB controller to change mode. */
2446 out_8(&qe_usbregs->usb_usmod, 0x01); 2461 out_8(&qe_usbregs->usb_usmod, 0x01);
2462 /* Mode changed, now disable it, since muram isn't initialized yet. */
2463 out_8(&qe_usbregs->usb_usmod, 0x00);
2464
2465 /* Initialize the rest. */
2447 out_be16(&qe_usbregs->usb_usbmr, 0); 2466 out_be16(&qe_usbregs->usb_usbmr, 0);
2448 out_8(&qe_usbregs->usb_uscom, 0); 2467 out_8(&qe_usbregs->usb_uscom, 0);
2449 out_be16(&qe_usbregs->usb_usber, USBER_ALL_CLEAR); 2468 out_be16(&qe_usbregs->usb_usber, USBER_ALL_CLEAR);
@@ -2604,6 +2623,10 @@ static int __devinit qe_udc_probe(struct of_device *ofdev,
2604 (unsigned long)udc_controller); 2623 (unsigned long)udc_controller);
2605 /* request irq and disable DR */ 2624 /* request irq and disable DR */
2606 udc_controller->usb_irq = irq_of_parse_and_map(np, 0); 2625 udc_controller->usb_irq = irq_of_parse_and_map(np, 0);
2626 if (!udc_controller->usb_irq) {
2627 ret = -EINVAL;
2628 goto err_noirq;
2629 }
2607 2630
2608 ret = request_irq(udc_controller->usb_irq, qe_udc_irq, 0, 2631 ret = request_irq(udc_controller->usb_irq, qe_udc_irq, 0,
2609 driver_name, udc_controller); 2632 driver_name, udc_controller);
@@ -2625,6 +2648,8 @@ static int __devinit qe_udc_probe(struct of_device *ofdev,
2625err6: 2648err6:
2626 free_irq(udc_controller->usb_irq, udc_controller); 2649 free_irq(udc_controller->usb_irq, udc_controller);
2627err5: 2650err5:
2651 irq_dispose_mapping(udc_controller->usb_irq);
2652err_noirq:
2628 if (udc_controller->nullmap) { 2653 if (udc_controller->nullmap) {
2629 dma_unmap_single(udc_controller->gadget.dev.parent, 2654 dma_unmap_single(udc_controller->gadget.dev.parent,
2630 udc_controller->nullp, 256, 2655 udc_controller->nullp, 256,
@@ -2648,7 +2673,7 @@ err2:
2648 iounmap(udc_controller->usb_regs); 2673 iounmap(udc_controller->usb_regs);
2649err1: 2674err1:
2650 kfree(udc_controller); 2675 kfree(udc_controller);
2651 2676 udc_controller = NULL;
2652 return ret; 2677 return ret;
2653} 2678}
2654 2679
@@ -2710,6 +2735,7 @@ static int __devexit qe_udc_remove(struct of_device *ofdev)
2710 kfree(ep->txframe); 2735 kfree(ep->txframe);
2711 2736
2712 free_irq(udc_controller->usb_irq, udc_controller); 2737 free_irq(udc_controller->usb_irq, udc_controller);
2738 irq_dispose_mapping(udc_controller->usb_irq);
2713 2739
2714 tasklet_kill(&udc_controller->rx_tasklet); 2740 tasklet_kill(&udc_controller->rx_tasklet);
2715 2741
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c
index f3c6703cffda..d8d9a52a44b3 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -404,7 +404,10 @@ static void struct_ep_qh_setup(struct fsl_udc *udc, unsigned char ep_num,
404 } 404 }
405 if (zlt) 405 if (zlt)
406 tmp |= EP_QUEUE_HEAD_ZLT_SEL; 406 tmp |= EP_QUEUE_HEAD_ZLT_SEL;
407
407 p_QH->max_pkt_length = cpu_to_le32(tmp); 408 p_QH->max_pkt_length = cpu_to_le32(tmp);
409 p_QH->next_dtd_ptr = 1;
410 p_QH->size_ioc_int_sts = 0;
408 411
409 return; 412 return;
410} 413}
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 9b36205c5759..0ce4e2819847 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -904,8 +904,8 @@ static void pxa25x_ep_fifo_flush(struct usb_ep *_ep)
904 904
905 /* most IN status is the same, but ISO can't stall */ 905 /* most IN status is the same, but ISO can't stall */
906 *ep->reg_udccs = UDCCS_BI_TPC|UDCCS_BI_FTF|UDCCS_BI_TUR 906 *ep->reg_udccs = UDCCS_BI_TPC|UDCCS_BI_FTF|UDCCS_BI_TUR
907 | (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) 907 | (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC
908 ? 0 : UDCCS_BI_SST; 908 ? 0 : UDCCS_BI_SST);
909} 909}
910 910
911 911
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 4725d15d096f..e551bb38852b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -485,6 +485,7 @@ static int ehci_init(struct usb_hcd *hcd)
485 * periodic_size can shrink by USBCMD update if hcc_params allows. 485 * periodic_size can shrink by USBCMD update if hcc_params allows.
486 */ 486 */
487 ehci->periodic_size = DEFAULT_I_TDPS; 487 ehci->periodic_size = DEFAULT_I_TDPS;
488 INIT_LIST_HEAD(&ehci->cached_itd_list);
488 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) 489 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
489 return retval; 490 return retval;
490 491
@@ -497,6 +498,7 @@ static int ehci_init(struct usb_hcd *hcd)
497 498
498 ehci->reclaim = NULL; 499 ehci->reclaim = NULL;
499 ehci->next_uframe = -1; 500 ehci->next_uframe = -1;
501 ehci->clock_frame = -1;
500 502
501 /* 503 /*
502 * dedicate a qh for the async ring head, since we couldn't unlink 504 * dedicate a qh for the async ring head, since we couldn't unlink
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 0431397836f6..10d52919abbb 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -128,6 +128,7 @@ static inline void qh_put (struct ehci_qh *qh)
128 128
129static void ehci_mem_cleanup (struct ehci_hcd *ehci) 129static void ehci_mem_cleanup (struct ehci_hcd *ehci)
130{ 130{
131 free_cached_itd_list(ehci);
131 if (ehci->async) 132 if (ehci->async)
132 qh_put (ehci->async); 133 qh_put (ehci->async);
133 ehci->async = NULL; 134 ehci->async = NULL;
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index bb21fb0a4969..abb9a7706ec7 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -432,7 +432,6 @@ static struct pci_driver ehci_pci_driver = {
432 432
433#ifdef CONFIG_PM 433#ifdef CONFIG_PM
434 .suspend = usb_hcd_pci_suspend, 434 .suspend = usb_hcd_pci_suspend,
435 .resume_early = usb_hcd_pci_resume_early,
436 .resume = usb_hcd_pci_resume, 435 .resume = usb_hcd_pci_resume,
437#endif 436#endif
438 .shutdown = usb_hcd_pci_shutdown, 437 .shutdown = usb_hcd_pci_shutdown,
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 3712b925b315..ecc9b66c03cd 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1095,7 +1095,8 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1095 prev->qh_next = qh->qh_next; 1095 prev->qh_next = qh->qh_next;
1096 wmb (); 1096 wmb ();
1097 1097
1098 if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) { 1098 /* If the controller isn't running, we don't have to wait for it */
1099 if (unlikely(!HC_IS_RUNNING(ehci_to_hcd(ehci)->state))) {
1099 /* if (unlikely (qh->reclaim != 0)) 1100 /* if (unlikely (qh->reclaim != 0))
1100 * this will recurse, probably not much 1101 * this will recurse, probably not much
1101 */ 1102 */
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index a081ee65bde6..1d0b49e3f192 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1004,7 +1004,8 @@ iso_stream_put(struct ehci_hcd *ehci, struct ehci_iso_stream *stream)
1004 1004
1005 is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0; 1005 is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0;
1006 stream->bEndpointAddress &= 0x0f; 1006 stream->bEndpointAddress &= 0x0f;
1007 stream->ep->hcpriv = NULL; 1007 if (stream->ep)
1008 stream->ep->hcpriv = NULL;
1008 1009
1009 if (stream->rescheduled) { 1010 if (stream->rescheduled) {
1010 ehci_info (ehci, "ep%d%s-iso rescheduled " 1011 ehci_info (ehci, "ep%d%s-iso rescheduled "
@@ -1535,7 +1536,7 @@ itd_link_urb (
1535 struct ehci_itd, itd_list); 1536 struct ehci_itd, itd_list);
1536 list_move_tail (&itd->itd_list, &stream->td_list); 1537 list_move_tail (&itd->itd_list, &stream->td_list);
1537 itd->stream = iso_stream_get (stream); 1538 itd->stream = iso_stream_get (stream);
1538 itd->urb = usb_get_urb (urb); 1539 itd->urb = urb;
1539 itd_init (ehci, stream, itd); 1540 itd_init (ehci, stream, itd);
1540 } 1541 }
1541 1542
@@ -1644,7 +1645,7 @@ itd_complete (
1644 (void) disable_periodic(ehci); 1645 (void) disable_periodic(ehci);
1645 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--; 1646 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
1646 1647
1647 if (unlikely (list_empty (&stream->td_list))) { 1648 if (unlikely(list_is_singular(&stream->td_list))) {
1648 ehci_to_hcd(ehci)->self.bandwidth_allocated 1649 ehci_to_hcd(ehci)->self.bandwidth_allocated
1649 -= stream->bandwidth; 1650 -= stream->bandwidth;
1650 ehci_vdbg (ehci, 1651 ehci_vdbg (ehci,
@@ -1653,14 +1654,27 @@ itd_complete (
1653 (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); 1654 (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
1654 } 1655 }
1655 iso_stream_put (ehci, stream); 1656 iso_stream_put (ehci, stream);
1656 /* OK to recycle this ITD now that its completion callback ran. */ 1657
1657done: 1658done:
1658 usb_put_urb(urb);
1659 itd->urb = NULL; 1659 itd->urb = NULL;
1660 itd->stream = NULL; 1660 if (ehci->clock_frame != itd->frame || itd->index[7] != -1) {
1661 list_move(&itd->itd_list, &stream->free_list); 1661 /* OK to recycle this ITD now. */
1662 iso_stream_put(ehci, stream); 1662 itd->stream = NULL;
1663 1663 list_move(&itd->itd_list, &stream->free_list);
1664 iso_stream_put(ehci, stream);
1665 } else {
1666 /* HW might remember this ITD, so we can't recycle it yet.
1667 * Move it to a safe place until a new frame starts.
1668 */
1669 list_move(&itd->itd_list, &ehci->cached_itd_list);
1670 if (stream->refcount == 2) {
1671 /* If iso_stream_put() were called here, stream
1672 * would be freed. Instead, just prevent reuse.
1673 */
1674 stream->ep->hcpriv = NULL;
1675 stream->ep = NULL;
1676 }
1677 }
1664 return retval; 1678 return retval;
1665} 1679}
1666 1680
@@ -1934,7 +1948,7 @@ sitd_link_urb (
1934 struct ehci_sitd, sitd_list); 1948 struct ehci_sitd, sitd_list);
1935 list_move_tail (&sitd->sitd_list, &stream->td_list); 1949 list_move_tail (&sitd->sitd_list, &stream->td_list);
1936 sitd->stream = iso_stream_get (stream); 1950 sitd->stream = iso_stream_get (stream);
1937 sitd->urb = usb_get_urb (urb); 1951 sitd->urb = urb;
1938 1952
1939 sitd_patch(ehci, stream, sitd, sched, packet); 1953 sitd_patch(ehci, stream, sitd, sched, packet);
1940 sitd_link (ehci, (next_uframe >> 3) % ehci->periodic_size, 1954 sitd_link (ehci, (next_uframe >> 3) % ehci->periodic_size,
@@ -2019,7 +2033,7 @@ sitd_complete (
2019 (void) disable_periodic(ehci); 2033 (void) disable_periodic(ehci);
2020 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--; 2034 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
2021 2035
2022 if (list_empty (&stream->td_list)) { 2036 if (list_is_singular(&stream->td_list)) {
2023 ehci_to_hcd(ehci)->self.bandwidth_allocated 2037 ehci_to_hcd(ehci)->self.bandwidth_allocated
2024 -= stream->bandwidth; 2038 -= stream->bandwidth;
2025 ehci_vdbg (ehci, 2039 ehci_vdbg (ehci,
@@ -2030,7 +2044,6 @@ sitd_complete (
2030 iso_stream_put (ehci, stream); 2044 iso_stream_put (ehci, stream);
2031 /* OK to recycle this SITD now that its completion callback ran. */ 2045 /* OK to recycle this SITD now that its completion callback ran. */
2032done: 2046done:
2033 usb_put_urb(urb);
2034 sitd->urb = NULL; 2047 sitd->urb = NULL;
2035 sitd->stream = NULL; 2048 sitd->stream = NULL;
2036 list_move(&sitd->sitd_list, &stream->free_list); 2049 list_move(&sitd->sitd_list, &stream->free_list);
@@ -2101,6 +2114,20 @@ done:
2101 2114
2102/*-------------------------------------------------------------------------*/ 2115/*-------------------------------------------------------------------------*/
2103 2116
2117static void free_cached_itd_list(struct ehci_hcd *ehci)
2118{
2119 struct ehci_itd *itd, *n;
2120
2121 list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) {
2122 struct ehci_iso_stream *stream = itd->stream;
2123 itd->stream = NULL;
2124 list_move(&itd->itd_list, &stream->free_list);
2125 iso_stream_put(ehci, stream);
2126 }
2127}
2128
2129/*-------------------------------------------------------------------------*/
2130
2104static void 2131static void
2105scan_periodic (struct ehci_hcd *ehci) 2132scan_periodic (struct ehci_hcd *ehci)
2106{ 2133{
@@ -2115,10 +2142,17 @@ scan_periodic (struct ehci_hcd *ehci)
2115 * Touches as few pages as possible: cache-friendly. 2142 * Touches as few pages as possible: cache-friendly.
2116 */ 2143 */
2117 now_uframe = ehci->next_uframe; 2144 now_uframe = ehci->next_uframe;
2118 if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) 2145 if (HC_IS_RUNNING(ehci_to_hcd(ehci)->state)) {
2119 clock = ehci_readl(ehci, &ehci->regs->frame_index); 2146 clock = ehci_readl(ehci, &ehci->regs->frame_index);
2120 else 2147 clock_frame = (clock >> 3) % ehci->periodic_size;
2148 } else {
2121 clock = now_uframe + mod - 1; 2149 clock = now_uframe + mod - 1;
2150 clock_frame = -1;
2151 }
2152 if (ehci->clock_frame != clock_frame) {
2153 free_cached_itd_list(ehci);
2154 ehci->clock_frame = clock_frame;
2155 }
2122 clock %= mod; 2156 clock %= mod;
2123 clock_frame = clock >> 3; 2157 clock_frame = clock >> 3;
2124 2158
@@ -2277,6 +2311,10 @@ restart:
2277 /* rescan the rest of this frame, then ... */ 2311 /* rescan the rest of this frame, then ... */
2278 clock = now; 2312 clock = now;
2279 clock_frame = clock >> 3; 2313 clock_frame = clock >> 3;
2314 if (ehci->clock_frame != clock_frame) {
2315 free_cached_itd_list(ehci);
2316 ehci->clock_frame = clock_frame;
2317 }
2280 } else { 2318 } else {
2281 now_uframe++; 2319 now_uframe++;
2282 now_uframe %= mod; 2320 now_uframe %= mod;
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index fb7054ccf4fc..262b00c9b334 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -87,6 +87,10 @@ struct ehci_hcd { /* one per controller */
87 int next_uframe; /* scan periodic, start here */ 87 int next_uframe; /* scan periodic, start here */
88 unsigned periodic_sched; /* periodic activity count */ 88 unsigned periodic_sched; /* periodic activity count */
89 89
90 /* list of itds completed while clock_frame was still active */
91 struct list_head cached_itd_list;
92 unsigned clock_frame;
93
90 /* per root hub port */ 94 /* per root hub port */
91 unsigned long reset_done [EHCI_MAX_ROOT_PORTS]; 95 unsigned long reset_done [EHCI_MAX_ROOT_PORTS];
92 96
@@ -220,6 +224,8 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
220 } 224 }
221} 225}
222 226
227static void free_cached_itd_list(struct ehci_hcd *ehci);
228
223/*-------------------------------------------------------------------------*/ 229/*-------------------------------------------------------------------------*/
224 230
225#include <linux/usb/ehci_def.h> 231#include <linux/usb/ehci_def.h>
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 5d625c3fd423..f9961b4c0da3 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -487,7 +487,6 @@ static struct pci_driver ohci_pci_driver = {
487 487
488#ifdef CONFIG_PM 488#ifdef CONFIG_PM
489 .suspend = usb_hcd_pci_suspend, 489 .suspend = usb_hcd_pci_suspend,
490 .resume_early = usb_hcd_pci_resume_early,
491 .resume = usb_hcd_pci_resume, 490 .resume = usb_hcd_pci_resume,
492#endif 491#endif
493 492
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 944f7e0ca4df..cf5e4cf7ea42 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -942,7 +942,6 @@ static struct pci_driver uhci_pci_driver = {
942 942
943#ifdef CONFIG_PM 943#ifdef CONFIG_PM
944 .suspend = usb_hcd_pci_suspend, 944 .suspend = usb_hcd_pci_suspend,
945 .resume_early = usb_hcd_pci_resume_early,
946 .resume = usb_hcd_pci_resume, 945 .resume = usb_hcd_pci_resume,
947#endif /* PM */ 946#endif /* PM */
948}; 947};
diff --git a/drivers/usb/host/whci/asl.c b/drivers/usb/host/whci/asl.c
index 577c0d29849d..958751ccea43 100644
--- a/drivers/usb/host/whci/asl.c
+++ b/drivers/usb/host/whci/asl.c
@@ -170,12 +170,17 @@ void asl_stop(struct whc *whc)
170void asl_update(struct whc *whc, uint32_t wusbcmd) 170void asl_update(struct whc *whc, uint32_t wusbcmd)
171{ 171{
172 struct wusbhc *wusbhc = &whc->wusbhc; 172 struct wusbhc *wusbhc = &whc->wusbhc;
173 long t;
173 174
174 mutex_lock(&wusbhc->mutex); 175 mutex_lock(&wusbhc->mutex);
175 if (wusbhc->active) { 176 if (wusbhc->active) {
176 whc_write_wusbcmd(whc, wusbcmd, wusbcmd); 177 whc_write_wusbcmd(whc, wusbcmd, wusbcmd);
177 wait_event(whc->async_list_wq, 178 t = wait_event_timeout(
178 (le_readl(whc->base + WUSBCMD) & WUSBCMD_ASYNC_UPDATED) == 0); 179 whc->async_list_wq,
180 (le_readl(whc->base + WUSBCMD) & WUSBCMD_ASYNC_UPDATED) == 0,
181 msecs_to_jiffies(1000));
182 if (t == 0)
183 whc_hw_error(whc, "ASL update timeout");
179 } 184 }
180 mutex_unlock(&wusbhc->mutex); 185 mutex_unlock(&wusbhc->mutex);
181} 186}
@@ -222,13 +227,13 @@ void scan_async_work(struct work_struct *work)
222 * Now that the ASL is updated, complete the removal of any 227 * Now that the ASL is updated, complete the removal of any
223 * removed qsets. 228 * removed qsets.
224 */ 229 */
225 spin_lock(&whc->lock); 230 spin_lock_irq(&whc->lock);
226 231
227 list_for_each_entry_safe(qset, t, &whc->async_removed_list, list_node) { 232 list_for_each_entry_safe(qset, t, &whc->async_removed_list, list_node) {
228 qset_remove_complete(whc, qset); 233 qset_remove_complete(whc, qset);
229 } 234 }
230 235
231 spin_unlock(&whc->lock); 236 spin_unlock_irq(&whc->lock);
232} 237}
233 238
234/** 239/**
diff --git a/drivers/usb/host/whci/hw.c b/drivers/usb/host/whci/hw.c
index d498e7203217..6afa2e379160 100644
--- a/drivers/usb/host/whci/hw.c
+++ b/drivers/usb/host/whci/hw.c
@@ -87,3 +87,18 @@ out:
87 87
88 return ret; 88 return ret;
89} 89}
90
91/**
92 * whc_hw_error - recover from a hardware error
93 * @whc: the WHCI HC that broke.
94 * @reason: a description of the failure.
95 *
96 * Recover from broken hardware with a full reset.
97 */
98void whc_hw_error(struct whc *whc, const char *reason)
99{
100 struct wusbhc *wusbhc = &whc->wusbhc;
101
102 dev_err(&whc->umc->dev, "hardware error: %s\n", reason);
103 wusbhc_reset_all(wusbhc);
104}
diff --git a/drivers/usb/host/whci/pzl.c b/drivers/usb/host/whci/pzl.c
index 2ae5abf69a6a..df8b85f07092 100644
--- a/drivers/usb/host/whci/pzl.c
+++ b/drivers/usb/host/whci/pzl.c
@@ -183,12 +183,17 @@ void pzl_stop(struct whc *whc)
183void pzl_update(struct whc *whc, uint32_t wusbcmd) 183void pzl_update(struct whc *whc, uint32_t wusbcmd)
184{ 184{
185 struct wusbhc *wusbhc = &whc->wusbhc; 185 struct wusbhc *wusbhc = &whc->wusbhc;
186 long t;
186 187
187 mutex_lock(&wusbhc->mutex); 188 mutex_lock(&wusbhc->mutex);
188 if (wusbhc->active) { 189 if (wusbhc->active) {
189 whc_write_wusbcmd(whc, wusbcmd, wusbcmd); 190 whc_write_wusbcmd(whc, wusbcmd, wusbcmd);
190 wait_event(whc->periodic_list_wq, 191 t = wait_event_timeout(
191 (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0); 192 whc->periodic_list_wq,
193 (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0,
194 msecs_to_jiffies(1000));
195 if (t == 0)
196 whc_hw_error(whc, "PZL update timeout");
192 } 197 }
193 mutex_unlock(&wusbhc->mutex); 198 mutex_unlock(&wusbhc->mutex);
194} 199}
@@ -250,13 +255,13 @@ void scan_periodic_work(struct work_struct *work)
250 * Now that the PZL is updated, complete the removal of any 255 * Now that the PZL is updated, complete the removal of any
251 * removed qsets. 256 * removed qsets.
252 */ 257 */
253 spin_lock(&whc->lock); 258 spin_lock_irq(&whc->lock);
254 259
255 list_for_each_entry_safe(qset, t, &whc->periodic_removed_list, list_node) { 260 list_for_each_entry_safe(qset, t, &whc->periodic_removed_list, list_node) {
256 qset_remove_complete(whc, qset); 261 qset_remove_complete(whc, qset);
257 } 262 }
258 263
259 spin_unlock(&whc->lock); 264 spin_unlock_irq(&whc->lock);
260} 265}
261 266
262/** 267/**
diff --git a/drivers/usb/host/whci/whcd.h b/drivers/usb/host/whci/whcd.h
index 0f3540f04f53..d3543a181dc9 100644
--- a/drivers/usb/host/whci/whcd.h
+++ b/drivers/usb/host/whci/whcd.h
@@ -137,6 +137,7 @@ void whc_clean_up(struct whc *whc);
137/* hw.c */ 137/* hw.c */
138void whc_write_wusbcmd(struct whc *whc, u32 mask, u32 val); 138void whc_write_wusbcmd(struct whc *whc, u32 mask, u32 val);
139int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len); 139int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len);
140void whc_hw_error(struct whc *whc, const char *reason);
140 141
141/* wusb.c */ 142/* wusb.c */
142int whc_wusbhc_start(struct wusbhc *wusbhc); 143int whc_wusbhc_start(struct wusbhc *wusbhc);
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c
index 878c77ca086e..972f20b3406c 100644
--- a/drivers/usb/image/mdc800.c
+++ b/drivers/usb/image/mdc800.c
@@ -499,6 +499,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
499 retval = usb_register_dev(intf, &mdc800_class); 499 retval = usb_register_dev(intf, &mdc800_class);
500 if (retval) { 500 if (retval) {
501 dev_err(&intf->dev, "Not able to get a minor for this device.\n"); 501 dev_err(&intf->dev, "Not able to get a minor for this device.\n");
502 mutex_unlock(&mdc800->io_lock);
502 return -ENODEV; 503 return -ENODEV;
503 } 504 }
504 505
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index 7b6922e08ed1..203526542013 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -376,7 +376,7 @@ static int adu_release(struct inode *inode, struct file *file)
376 if (dev->open_count <= 0) { 376 if (dev->open_count <= 0) {
377 dbg(1," %s : device not opened", __func__); 377 dbg(1," %s : device not opened", __func__);
378 retval = -ENODEV; 378 retval = -ENODEV;
379 goto exit; 379 goto unlock;
380 } 380 }
381 381
382 adu_release_internal(dev); 382 adu_release_internal(dev);
@@ -385,9 +385,9 @@ static int adu_release(struct inode *inode, struct file *file)
385 if (!dev->open_count) /* ... and we're the last user */ 385 if (!dev->open_count) /* ... and we're the last user */
386 adu_delete(dev); 386 adu_delete(dev);
387 } 387 }
388 388unlock:
389exit:
390 mutex_unlock(&adutux_mutex); 389 mutex_unlock(&adutux_mutex);
390exit:
391 dbg(2," %s : leave, return value %d", __func__, retval); 391 dbg(2," %s : leave, return value %d", __func__, retval);
392 return retval; 392 return retval;
393} 393}
diff --git a/drivers/usb/misc/vstusb.c b/drivers/usb/misc/vstusb.c
index 63dff9ba73c5..f26ea8dc1577 100644
--- a/drivers/usb/misc/vstusb.c
+++ b/drivers/usb/misc/vstusb.c
@@ -401,6 +401,7 @@ static ssize_t vstusb_write(struct file *file, const char __user *buffer,
401 } 401 }
402 402
403 if (copy_from_user(buf, buffer, count)) { 403 if (copy_from_user(buf, buffer, count)) {
404 mutex_unlock(&vstdev->lock);
404 dev_err(&dev->dev, "%s: can't copy_from_user\n", __func__); 405 dev_err(&dev->dev, "%s: can't copy_from_user\n", __func__);
405 retval = -EFAULT; 406 retval = -EFAULT;
406 goto exit; 407 goto exit;
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 5a8fd5d57a11..2dc7606f319c 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -377,18 +377,8 @@ int __init musb_platform_init(struct musb *musb)
377 u32 revision; 377 u32 revision;
378 378
379 musb->mregs += DAVINCI_BASE_OFFSET; 379 musb->mregs += DAVINCI_BASE_OFFSET;
380#if 0
381 /* REVISIT there's something odd about clocking, this
382 * didn't appear do the job ...
383 */
384 musb->clock = clk_get(pDevice, "usb");
385 if (IS_ERR(musb->clock))
386 return PTR_ERR(musb->clock);
387 380
388 status = clk_enable(musb->clock); 381 clk_enable(musb->clock);
389 if (status < 0)
390 return -ENODEV;
391#endif
392 382
393 /* returns zero if e.g. not clocked */ 383 /* returns zero if e.g. not clocked */
394 revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG); 384 revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG);
@@ -453,5 +443,8 @@ int musb_platform_exit(struct musb *musb)
453 } 443 }
454 444
455 phy_off(); 445 phy_off();
446
447 clk_disable(musb->clock);
448
456 return 0; 449 return 0;
457} 450}
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 2cc34fa05b73..af77e4659006 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -115,7 +115,7 @@
115 115
116 116
117unsigned musb_debug; 117unsigned musb_debug;
118module_param(musb_debug, uint, S_IRUGO | S_IWUSR); 118module_param_named(debug, musb_debug, uint, S_IRUGO | S_IWUSR);
119MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); 119MODULE_PARM_DESC(debug, "Debug message level. Default = 0");
120 120
121#define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" 121#define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia"
@@ -767,6 +767,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
767#ifdef CONFIG_USB_MUSB_HDRC_HCD 767#ifdef CONFIG_USB_MUSB_HDRC_HCD
768 case OTG_STATE_A_HOST: 768 case OTG_STATE_A_HOST:
769 case OTG_STATE_A_SUSPEND: 769 case OTG_STATE_A_SUSPEND:
770 usb_hcd_resume_root_hub(musb_to_hcd(musb));
770 musb_root_disconnect(musb); 771 musb_root_disconnect(musb);
771 if (musb->a_wait_bcon != 0) 772 if (musb->a_wait_bcon != 0)
772 musb_platform_try_idle(musb, jiffies 773 musb_platform_try_idle(musb, jiffies
@@ -1815,7 +1816,7 @@ static void musb_free(struct musb *musb)
1815#ifdef CONFIG_SYSFS 1816#ifdef CONFIG_SYSFS
1816 device_remove_file(musb->controller, &dev_attr_mode); 1817 device_remove_file(musb->controller, &dev_attr_mode);
1817 device_remove_file(musb->controller, &dev_attr_vbus); 1818 device_remove_file(musb->controller, &dev_attr_vbus);
1818#ifdef CONFIG_USB_MUSB_OTG 1819#ifdef CONFIG_USB_GADGET_MUSB_HDRC
1819 device_remove_file(musb->controller, &dev_attr_srp); 1820 device_remove_file(musb->controller, &dev_attr_srp);
1820#endif 1821#endif
1821#endif 1822#endif
@@ -2063,7 +2064,7 @@ fail2:
2063#ifdef CONFIG_SYSFS 2064#ifdef CONFIG_SYSFS
2064 device_remove_file(musb->controller, &dev_attr_mode); 2065 device_remove_file(musb->controller, &dev_attr_mode);
2065 device_remove_file(musb->controller, &dev_attr_vbus); 2066 device_remove_file(musb->controller, &dev_attr_vbus);
2066#ifdef CONFIG_USB_MUSB_OTG 2067#ifdef CONFIG_USB_GADGET_MUSB_HDRC
2067 device_remove_file(musb->controller, &dev_attr_srp); 2068 device_remove_file(musb->controller, &dev_attr_srp);
2068#endif 2069#endif
2069#endif 2070#endif
@@ -2243,10 +2244,10 @@ static int __init musb_init(void)
2243 return platform_driver_probe(&musb_driver, musb_probe); 2244 return platform_driver_probe(&musb_driver, musb_probe);
2244} 2245}
2245 2246
2246/* make us init after usbcore and before usb 2247/* make us init after usbcore and i2c (transceivers, regulators, etc)
2247 * gadget and host-side drivers start to register 2248 * and before usb gadget and host-side drivers start to register
2248 */ 2249 */
2249subsys_initcall(musb_init); 2250fs_initcall(musb_init);
2250 2251
2251static void __exit musb_cleanup(void) 2252static void __exit musb_cleanup(void)
2252{ 2253{
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 4ea305387981..c7ebd0867fcc 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -575,7 +575,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
575 struct usb_request *request = &req->request; 575 struct usb_request *request = &req->request;
576 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; 576 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
577 void __iomem *epio = musb->endpoints[epnum].regs; 577 void __iomem *epio = musb->endpoints[epnum].regs;
578 u16 fifo_count = 0; 578 unsigned fifo_count = 0;
579 u16 len = musb_ep->packet_sz; 579 u16 len = musb_ep->packet_sz;
580 580
581 csr = musb_readw(epio, MUSB_RXCSR); 581 csr = musb_readw(epio, MUSB_RXCSR);
@@ -687,7 +687,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
687 len, fifo_count, 687 len, fifo_count,
688 musb_ep->packet_sz); 688 musb_ep->packet_sz);
689 689
690 fifo_count = min(len, fifo_count); 690 fifo_count = min_t(unsigned, len, fifo_count);
691 691
692#ifdef CONFIG_USB_TUSB_OMAP_DMA 692#ifdef CONFIG_USB_TUSB_OMAP_DMA
693 if (tusb_dma_omap() && musb_ep->dma) { 693 if (tusb_dma_omap() && musb_ep->dma) {
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index a035ceccf950..6dbbd0786a6a 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -335,16 +335,11 @@ musb_save_toggle(struct musb_hw_ep *ep, int is_in, struct urb *urb)
335static struct musb_qh * 335static struct musb_qh *
336musb_giveback(struct musb_qh *qh, struct urb *urb, int status) 336musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
337{ 337{
338 int is_in;
339 struct musb_hw_ep *ep = qh->hw_ep; 338 struct musb_hw_ep *ep = qh->hw_ep;
340 struct musb *musb = ep->musb; 339 struct musb *musb = ep->musb;
340 int is_in = usb_pipein(urb->pipe);
341 int ready = qh->is_ready; 341 int ready = qh->is_ready;
342 342
343 if (ep->is_shared_fifo)
344 is_in = 1;
345 else
346 is_in = usb_pipein(urb->pipe);
347
348 /* save toggle eagerly, for paranoia */ 343 /* save toggle eagerly, for paranoia */
349 switch (qh->type) { 344 switch (qh->type) {
350 case USB_ENDPOINT_XFER_BULK: 345 case USB_ENDPOINT_XFER_BULK:
@@ -432,7 +427,7 @@ musb_advance_schedule(struct musb *musb, struct urb *urb,
432 else 427 else
433 qh = musb_giveback(qh, urb, urb->status); 428 qh = musb_giveback(qh, urb, urb->status);
434 429
435 if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) { 430 if (qh != NULL && qh->is_ready) {
436 DBG(4, "... next ep%d %cX urb %p\n", 431 DBG(4, "... next ep%d %cX urb %p\n",
437 hw_ep->epnum, is_in ? 'R' : 'T', 432 hw_ep->epnum, is_in ? 'R' : 'T',
438 next_urb(qh)); 433 next_urb(qh));
@@ -942,8 +937,8 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb)
942 switch (musb->ep0_stage) { 937 switch (musb->ep0_stage) {
943 case MUSB_EP0_IN: 938 case MUSB_EP0_IN:
944 fifo_dest = urb->transfer_buffer + urb->actual_length; 939 fifo_dest = urb->transfer_buffer + urb->actual_length;
945 fifo_count = min(len, ((u16) (urb->transfer_buffer_length 940 fifo_count = min_t(size_t, len, urb->transfer_buffer_length -
946 - urb->actual_length))); 941 urb->actual_length);
947 if (fifo_count < len) 942 if (fifo_count < len)
948 urb->status = -EOVERFLOW; 943 urb->status = -EOVERFLOW;
949 944
@@ -976,10 +971,9 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb)
976 } 971 }
977 /* FALLTHROUGH */ 972 /* FALLTHROUGH */
978 case MUSB_EP0_OUT: 973 case MUSB_EP0_OUT:
979 fifo_count = min(qh->maxpacket, ((u16) 974 fifo_count = min_t(size_t, qh->maxpacket,
980 (urb->transfer_buffer_length 975 urb->transfer_buffer_length -
981 - urb->actual_length))); 976 urb->actual_length);
982
983 if (fifo_count) { 977 if (fifo_count) {
984 fifo_dest = (u8 *) (urb->transfer_buffer 978 fifo_dest = (u8 *) (urb->transfer_buffer
985 + urb->actual_length); 979 + urb->actual_length);
@@ -1161,7 +1155,8 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1161 struct urb *urb; 1155 struct urb *urb;
1162 struct musb_hw_ep *hw_ep = musb->endpoints + epnum; 1156 struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
1163 void __iomem *epio = hw_ep->regs; 1157 void __iomem *epio = hw_ep->regs;
1164 struct musb_qh *qh = hw_ep->out_qh; 1158 struct musb_qh *qh = hw_ep->is_shared_fifo ? hw_ep->in_qh
1159 : hw_ep->out_qh;
1165 u32 status = 0; 1160 u32 status = 0;
1166 void __iomem *mbase = musb->mregs; 1161 void __iomem *mbase = musb->mregs;
1167 struct dma_channel *dma; 1162 struct dma_channel *dma;
@@ -1308,7 +1303,8 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1308 * packets before updating TXCSR ... other docs disagree ... 1303 * packets before updating TXCSR ... other docs disagree ...
1309 */ 1304 */
1310 /* PIO: start next packet in this URB */ 1305 /* PIO: start next packet in this URB */
1311 wLength = min(qh->maxpacket, (u16) wLength); 1306 if (wLength > qh->maxpacket)
1307 wLength = qh->maxpacket;
1312 musb_write_fifo(hw_ep, wLength, buf); 1308 musb_write_fifo(hw_ep, wLength, buf);
1313 qh->segsize = wLength; 1309 qh->segsize = wLength;
1314 1310
@@ -1867,19 +1863,21 @@ static int musb_urb_enqueue(
1867 } 1863 }
1868 qh->type_reg = type_reg; 1864 qh->type_reg = type_reg;
1869 1865
1870 /* precompute rxinterval/txinterval register */ 1866 /* Precompute RXINTERVAL/TXINTERVAL register */
1871 interval = min((u8)16, epd->bInterval); /* log encoding */
1872 switch (qh->type) { 1867 switch (qh->type) {
1873 case USB_ENDPOINT_XFER_INT: 1868 case USB_ENDPOINT_XFER_INT:
1874 /* fullspeed uses linear encoding */ 1869 /*
1875 if (USB_SPEED_FULL == urb->dev->speed) { 1870 * Full/low speeds use the linear encoding,
1876 interval = epd->bInterval; 1871 * high speed uses the logarithmic encoding.
1877 if (!interval) 1872 */
1878 interval = 1; 1873 if (urb->dev->speed <= USB_SPEED_FULL) {
1874 interval = max_t(u8, epd->bInterval, 1);
1875 break;
1879 } 1876 }
1880 /* FALLTHROUGH */ 1877 /* FALLTHROUGH */
1881 case USB_ENDPOINT_XFER_ISOC: 1878 case USB_ENDPOINT_XFER_ISOC:
1882 /* iso always uses log encoding */ 1879 /* ISO always uses logarithmic encoding */
1880 interval = min_t(u8, epd->bInterval, 16);
1883 break; 1881 break;
1884 default: 1882 default:
1885 /* REVISIT we actually want to use NAK limits, hinting to the 1883 /* REVISIT we actually want to use NAK limits, hinting to the
@@ -2037,9 +2035,9 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
2037 goto done; 2035 goto done;
2038 2036
2039 /* Any URB not actively programmed into endpoint hardware can be 2037 /* Any URB not actively programmed into endpoint hardware can be
2040 * immediately given back. Such an URB must be at the head of its 2038 * immediately given back; that's any URB not at the head of an
2041 * endpoint queue, unless someday we get real DMA queues. And even 2039 * endpoint queue, unless someday we get real DMA queues. And even
2042 * then, it might not be known to the hardware... 2040 * if it's at the head, it might not be known to the hardware...
2043 * 2041 *
2044 * Otherwise abort current transfer, pending dma, etc.; urb->status 2042 * Otherwise abort current transfer, pending dma, etc.; urb->status
2045 * has already been updated. This is a synchronous abort; it'd be 2043 * has already been updated. This is a synchronous abort; it'd be
@@ -2078,6 +2076,15 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
2078 qh->is_ready = 0; 2076 qh->is_ready = 0;
2079 __musb_giveback(musb, urb, 0); 2077 __musb_giveback(musb, urb, 0);
2080 qh->is_ready = ready; 2078 qh->is_ready = ready;
2079
2080 /* If nothing else (usually musb_giveback) is using it
2081 * and its URB list has emptied, recycle this qh.
2082 */
2083 if (ready && list_empty(&qh->hep->urb_list)) {
2084 qh->hep->hcpriv = NULL;
2085 list_del(&qh->ring);
2086 kfree(qh);
2087 }
2081 } else 2088 } else
2082 ret = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); 2089 ret = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
2083done: 2090done:
@@ -2093,15 +2100,16 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
2093 unsigned long flags; 2100 unsigned long flags;
2094 struct musb *musb = hcd_to_musb(hcd); 2101 struct musb *musb = hcd_to_musb(hcd);
2095 u8 is_in = epnum & USB_DIR_IN; 2102 u8 is_in = epnum & USB_DIR_IN;
2096 struct musb_qh *qh = hep->hcpriv; 2103 struct musb_qh *qh;
2097 struct urb *urb, *tmp; 2104 struct urb *urb;
2098 struct list_head *sched; 2105 struct list_head *sched;
2099 2106
2100 if (!qh)
2101 return;
2102
2103 spin_lock_irqsave(&musb->lock, flags); 2107 spin_lock_irqsave(&musb->lock, flags);
2104 2108
2109 qh = hep->hcpriv;
2110 if (qh == NULL)
2111 goto exit;
2112
2105 switch (qh->type) { 2113 switch (qh->type) {
2106 case USB_ENDPOINT_XFER_CONTROL: 2114 case USB_ENDPOINT_XFER_CONTROL:
2107 sched = &musb->control; 2115 sched = &musb->control;
@@ -2135,13 +2143,28 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
2135 2143
2136 /* cleanup */ 2144 /* cleanup */
2137 musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); 2145 musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
2138 } else
2139 urb = NULL;
2140 2146
2141 /* then just nuke all the others */ 2147 /* Then nuke all the others ... and advance the
2142 list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list) 2148 * queue on hw_ep (e.g. bulk ring) when we're done.
2143 musb_giveback(qh, urb, -ESHUTDOWN); 2149 */
2150 while (!list_empty(&hep->urb_list)) {
2151 urb = next_urb(qh);
2152 urb->status = -ESHUTDOWN;
2153 musb_advance_schedule(musb, urb, qh->hw_ep, is_in);
2154 }
2155 } else {
2156 /* Just empty the queue; the hardware is busy with
2157 * other transfers, and since !qh->is_ready nothing
2158 * will activate any of these as it advances.
2159 */
2160 while (!list_empty(&hep->urb_list))
2161 __musb_giveback(musb, next_urb(qh), -ESHUTDOWN);
2144 2162
2163 hep->hcpriv = NULL;
2164 list_del(&qh->ring);
2165 kfree(qh);
2166 }
2167exit:
2145 spin_unlock_irqrestore(&musb->lock, flags); 2168 spin_unlock_irqrestore(&musb->lock, flags);
2146} 2169}
2147 2170
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index 537f953bd7f8..6d106e74265e 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -621,9 +621,9 @@ static int __init aircable_init(void)
621 goto failed_usb_register; 621 goto failed_usb_register;
622 return 0; 622 return 0;
623 623
624failed_serial_register:
625 usb_serial_deregister(&aircable_device);
626failed_usb_register: 624failed_usb_register:
625 usb_serial_deregister(&aircable_device);
626failed_serial_register:
627 return retval; 627 return retval;
628} 628}
629 629
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index 027f4b7dde86..9b4082b58c5b 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -79,6 +79,7 @@ static struct usb_device_id id_table [] = {
79 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ 79 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
80 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ 80 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
81 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 81 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
82 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
82 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ 83 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */
83 { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */ 84 { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
84 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ 85 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 75597337583e..ae84c326a540 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -662,6 +662,12 @@ static struct usb_device_id id_table_combined [] = {
662 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 662 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
663 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 663 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
664 { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 664 { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) },
665 { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID) },
666 { USB_DEVICE(ATMEL_VID, STK541_PID) },
667 { USB_DEVICE(DE_VID, STB_PID) },
668 { USB_DEVICE(DE_VID, WHT_PID) },
669 { USB_DEVICE(ADI_VID, ADI_GNICE_PID),
670 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
665 { }, /* Optional parameter entry */ 671 { }, /* Optional parameter entry */
666 { } /* Terminating entry */ 672 { } /* Terminating entry */
667}; 673};
@@ -1064,8 +1070,10 @@ static int set_serial_info(struct tty_struct *tty,
1064 1070
1065 if (!capable(CAP_SYS_ADMIN)) { 1071 if (!capable(CAP_SYS_ADMIN)) {
1066 if (((new_serial.flags & ~ASYNC_USR_MASK) != 1072 if (((new_serial.flags & ~ASYNC_USR_MASK) !=
1067 (priv->flags & ~ASYNC_USR_MASK))) 1073 (priv->flags & ~ASYNC_USR_MASK))) {
1074 unlock_kernel();
1068 return -EPERM; 1075 return -EPERM;
1076 }
1069 priv->flags = ((priv->flags & ~ASYNC_USR_MASK) | 1077 priv->flags = ((priv->flags & ~ASYNC_USR_MASK) |
1070 (new_serial.flags & ASYNC_USR_MASK)); 1078 (new_serial.flags & ASYNC_USR_MASK));
1071 priv->custom_divisor = new_serial.custom_divisor; 1079 priv->custom_divisor = new_serial.custom_divisor;
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 1b62eff475d2..daaf63db0b50 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -844,6 +844,9 @@
844#define TML_VID 0x1B91 /* Vendor ID */ 844#define TML_VID 0x1B91 /* Vendor ID */
845#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */ 845#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
846 846
847/* NDI Polaris System */
848#define FTDI_NDI_HUC_PID 0xDA70
849
847/* Propox devices */ 850/* Propox devices */
848#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738 851#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
849 852
@@ -890,6 +893,26 @@
890#define DIEBOLD_BCS_SE923_PID 0xfb99 893#define DIEBOLD_BCS_SE923_PID 0xfb99
891 894
892/* 895/*
896 * Atmel STK541
897 */
898#define ATMEL_VID 0x03eb /* Vendor ID */
899#define STK541_PID 0x2109 /* Zigbee Controller */
900
901/*
902 * Dresden Elektronic Sensor Terminal Board
903 */
904#define DE_VID 0x1cf1 /* Vendor ID */
905#define STB_PID 0x0001 /* Sensor Terminal Board */
906#define WHT_PID 0x0004 /* Wireless Handheld Terminal */
907
908/*
909 * Blackfin gnICE JTAG
910 * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice
911 */
912#define ADI_VID 0x0456
913#define ADI_GNICE_PID 0xF000
914
915/*
893 * BmRequestType: 1100 0000b 916 * BmRequestType: 1100 0000b
894 * bRequest: FTDI_E2_READ 917 * bRequest: FTDI_E2_READ
895 * wValue: 0 918 * wValue: 0
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 6c89da9c6fea..61ebddc48497 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -89,6 +89,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
89#define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041 89#define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041
90#define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061 90#define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061
91#define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100 91#define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100
92#define OPTION_PRODUCT_GTM380_MODEM 0x7201
92 93
93#define HUAWEI_VENDOR_ID 0x12D1 94#define HUAWEI_VENDOR_ID 0x12D1
94#define HUAWEI_PRODUCT_E600 0x1001 95#define HUAWEI_PRODUCT_E600 0x1001
@@ -197,16 +198,18 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
197/* OVATION PRODUCTS */ 198/* OVATION PRODUCTS */
198#define NOVATELWIRELESS_PRODUCT_MC727 0x4100 199#define NOVATELWIRELESS_PRODUCT_MC727 0x4100
199#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 200#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400
201#define NOVATELWIRELESS_PRODUCT_U727 0x5010
200 202
201/* FUTURE NOVATEL PRODUCTS */ 203/* FUTURE NOVATEL PRODUCTS */
202#define NOVATELWIRELESS_PRODUCT_EVDO_1 0x6000 204#define NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED 0X6000
203#define NOVATELWIRELESS_PRODUCT_HSPA_1 0x7000 205#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001
204#define NOVATELWIRELESS_PRODUCT_EMBEDDED_1 0x8000 206#define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0X7000
205#define NOVATELWIRELESS_PRODUCT_GLOBAL_1 0x9000 207#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0X7001
206#define NOVATELWIRELESS_PRODUCT_EVDO_2 0x6001 208#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0X8000
207#define NOVATELWIRELESS_PRODUCT_HSPA_2 0x7001 209#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0X8001
208#define NOVATELWIRELESS_PRODUCT_EMBEDDED_2 0x8001 210#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0X9000
209#define NOVATELWIRELESS_PRODUCT_GLOBAL_2 0x9001 211#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0X9001
212#define NOVATELWIRELESS_PRODUCT_GLOBAL 0XA001
210 213
211/* AMOI PRODUCTS */ 214/* AMOI PRODUCTS */
212#define AMOI_VENDOR_ID 0x1614 215#define AMOI_VENDOR_ID 0x1614
@@ -216,6 +219,27 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
216 219
217#define DELL_VENDOR_ID 0x413C 220#define DELL_VENDOR_ID 0x413C
218 221
222/* Dell modems */
223#define DELL_PRODUCT_5700_MINICARD 0x8114
224#define DELL_PRODUCT_5500_MINICARD 0x8115
225#define DELL_PRODUCT_5505_MINICARD 0x8116
226#define DELL_PRODUCT_5700_EXPRESSCARD 0x8117
227#define DELL_PRODUCT_5510_EXPRESSCARD 0x8118
228
229#define DELL_PRODUCT_5700_MINICARD_SPRINT 0x8128
230#define DELL_PRODUCT_5700_MINICARD_TELUS 0x8129
231
232#define DELL_PRODUCT_5720_MINICARD_VZW 0x8133
233#define DELL_PRODUCT_5720_MINICARD_SPRINT 0x8134
234#define DELL_PRODUCT_5720_MINICARD_TELUS 0x8135
235#define DELL_PRODUCT_5520_MINICARD_CINGULAR 0x8136
236#define DELL_PRODUCT_5520_MINICARD_GENERIC_L 0x8137
237#define DELL_PRODUCT_5520_MINICARD_GENERIC_I 0x8138
238
239#define DELL_PRODUCT_5730_MINICARD_SPRINT 0x8180
240#define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181
241#define DELL_PRODUCT_5730_MINICARD_VZW 0x8182
242
219#define KYOCERA_VENDOR_ID 0x0c88 243#define KYOCERA_VENDOR_ID 0x0c88
220#define KYOCERA_PRODUCT_KPC650 0x17da 244#define KYOCERA_PRODUCT_KPC650 0x17da
221#define KYOCERA_PRODUCT_KPC680 0x180a 245#define KYOCERA_PRODUCT_KPC680 0x180a
@@ -266,19 +290,13 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
266 290
267/* ZTE PRODUCTS */ 291/* ZTE PRODUCTS */
268#define ZTE_VENDOR_ID 0x19d2 292#define ZTE_VENDOR_ID 0x19d2
293#define ZTE_PRODUCT_MF622 0x0001
269#define ZTE_PRODUCT_MF628 0x0015 294#define ZTE_PRODUCT_MF628 0x0015
270#define ZTE_PRODUCT_MF626 0x0031 295#define ZTE_PRODUCT_MF626 0x0031
271#define ZTE_PRODUCT_CDMA_TECH 0xfffe 296#define ZTE_PRODUCT_CDMA_TECH 0xfffe
272 297
273/* Ericsson products */ 298#define BENQ_VENDOR_ID 0x04a5
274#define ERICSSON_VENDOR_ID 0x0bdb 299#define BENQ_PRODUCT_H10 0x4068
275#define ERICSSON_PRODUCT_F3507G 0x1900
276
277/* Pantech products */
278#define PANTECH_VENDOR_ID 0x106c
279#define PANTECH_PRODUCT_PC5740 0x3701
280#define PANTECH_PRODUCT_PC5750 0x3702 /* PX-500 */
281#define PANTECH_PRODUCT_UM150 0x3711
282 300
283static struct usb_device_id option_ids[] = { 301static struct usb_device_id option_ids[] = {
284 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 302 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
@@ -305,6 +323,7 @@ static struct usb_device_id option_ids[] = {
305 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) }, 323 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) },
306 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) }, 324 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) },
307 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) }, 325 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) },
326 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTM380_MODEM) },
308 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q101) }, 327 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q101) },
309 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q111) }, 328 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q111) },
310 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) }, 329 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) },
@@ -395,31 +414,37 @@ static struct usb_device_id option_ids[] = {
395 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ 414 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */
396 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ 415 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */
397 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ 416 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */
398 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_1) }, /* Novatel EVDO product */ 417 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */
399 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_1) }, /* Novatel HSPA product */ 418 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED) }, /* Novatel EVDO product */
400 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_1) }, /* Novatel Embedded product */ 419 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */
401 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_1) }, /* Novatel Global product */ 420 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */
402 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_2) }, /* Novatel EVDO product */ 421 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */
403 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_2) }, /* Novatel HSPA product */ 422 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, /* Novatel EVDO product */
404 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_2) }, /* Novatel Embedded product */ 423 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) }, /* Novatel HSPA product */
405 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_2) }, /* Novatel Global product */ 424 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, /* Novatel EVDO Embedded product */
425 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, /* Novatel HSPA Embedded product */
426 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL) }, /* Novatel Global product */
406 427
407 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, 428 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
408 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, 429 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
409 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, 430 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) },
410 431
411 { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ 432 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
412 { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ 433 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
413 { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ 434 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5505_MINICARD) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
414 { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ 435 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_EXPRESSCARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */
415 { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ 436 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5510_EXPRESSCARD) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */
416 { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ 437 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_SPRINT) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
417 { USB_DEVICE(DELL_VENDOR_ID, 0x8129) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */ 438 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_TELUS) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */
418 { USB_DEVICE(DELL_VENDOR_ID, 0x8133) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ 439 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_VZW) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
419 { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */ 440 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_SPRINT) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
420 { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */ 441 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_TELUS) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
421 { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */ 442 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_CINGULAR) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
422 { USB_DEVICE(DELL_VENDOR_ID, 0x8147) }, /* Dell Wireless 5530 Mobile Broadband (3G HSPA) Mini-Card */ 443 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_L) }, /* Dell Wireless HSDPA 5520 */
444 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_I) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */
445 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
446 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
447 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
423 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ 448 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
424 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 449 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
425 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, 450 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
@@ -484,13 +509,12 @@ static struct usb_device_id option_ids[] = {
484 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 509 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
485 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ 510 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
486 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, 511 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
512 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622) },
487 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, 513 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) },
488 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, 514 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) },
489 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, 515 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) },
490 { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G) }, 516 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
491 { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5740) }, 517 { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */
492 { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5750) },
493 { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_UM150) },
494 { } /* Terminating entry */ 518 { } /* Terminating entry */
495}; 519};
496MODULE_DEVICE_TABLE(usb, option_ids); 520MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index baf591137b80..2620bf6fe5e1 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -176,7 +176,7 @@ static unsigned int product_5052_count;
176/* the array dimension is the number of default entries plus */ 176/* the array dimension is the number of default entries plus */
177/* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ 177/* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */
178/* null entry */ 178/* null entry */
179static struct usb_device_id ti_id_table_3410[7+TI_EXTRA_VID_PID_COUNT+1] = { 179static struct usb_device_id ti_id_table_3410[10+TI_EXTRA_VID_PID_COUNT+1] = {
180 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, 180 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
181 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, 181 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
182 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, 182 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
@@ -185,9 +185,11 @@ static struct usb_device_id ti_id_table_3410[7+TI_EXTRA_VID_PID_COUNT+1] = {
185 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, 185 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) },
186 { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, 186 { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) },
187 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, 187 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
188 { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
189 { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
188}; 190};
189 191
190static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = { 192static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
191 { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, 193 { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) },
192 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, 194 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
193 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, 195 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
@@ -195,7 +197,7 @@ static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = {
195 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, 197 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
196}; 198};
197 199
198static struct usb_device_id ti_id_table_combined[6+2*TI_EXTRA_VID_PID_COUNT+1] = { 200static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = {
199 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, 201 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
200 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, 202 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
201 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, 203 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
@@ -208,6 +210,8 @@ static struct usb_device_id ti_id_table_combined[6+2*TI_EXTRA_VID_PID_COUNT+1] =
208 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, 210 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
209 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, 211 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
210 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, 212 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
213 { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
214 { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
211 { } 215 { }
212}; 216};
213 217
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h
index b7ea5dbadee5..f323c6025858 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.h
+++ b/drivers/usb/serial/ti_usb_3410_5052.h
@@ -30,6 +30,8 @@
30#define IBM_VENDOR_ID 0x04b3 30#define IBM_VENDOR_ID 0x04b3
31#define TI_3410_PRODUCT_ID 0x3410 31#define TI_3410_PRODUCT_ID 0x3410
32#define IBM_4543_PRODUCT_ID 0x4543 32#define IBM_4543_PRODUCT_ID 0x4543
33#define IBM_454B_PRODUCT_ID 0x454b
34#define IBM_454C_PRODUCT_ID 0x454c
33#define TI_3410_EZ430_ID 0xF430 /* TI ez430 development tool */ 35#define TI_3410_EZ430_ID 0xF430 /* TI ez430 development tool */
34#define TI_5052_BOOT_PRODUCT_ID 0x5052 /* no EEPROM, no firmware */ 36#define TI_5052_BOOT_PRODUCT_ID 0x5052 /* no EEPROM, no firmware */
35#define TI_5152_BOOT_PRODUCT_ID 0x5152 /* no EEPROM, no firmware */ 37#define TI_5152_BOOT_PRODUCT_ID 0x5152 /* no EEPROM, no firmware */
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 2a42b862aa9f..727c506417cc 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -64,6 +64,7 @@
64 */ 64 */
65#define VENDOR_ID_NOKIA 0x0421 65#define VENDOR_ID_NOKIA 0x0421
66#define VENDOR_ID_NIKON 0x04b0 66#define VENDOR_ID_NIKON 0x04b0
67#define VENDOR_ID_PENTAX 0x0a17
67#define VENDOR_ID_MOTOROLA 0x22b8 68#define VENDOR_ID_MOTOROLA 0x22b8
68 69
69/*********************************************************************** 70/***********************************************************************
@@ -158,6 +159,7 @@ static int slave_configure(struct scsi_device *sdev)
158 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) { 159 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) {
159 case VENDOR_ID_NOKIA: 160 case VENDOR_ID_NOKIA:
160 case VENDOR_ID_NIKON: 161 case VENDOR_ID_NIKON:
162 case VENDOR_ID_PENTAX:
161 case VENDOR_ID_MOTOROLA: 163 case VENDOR_ID_MOTOROLA:
162 if (!(us->fflags & (US_FL_FIX_CAPACITY | 164 if (!(us->fflags & (US_FL_FIX_CAPACITY |
163 US_FL_CAPACITY_OK))) 165 US_FL_CAPACITY_OK)))
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 1d5438e6363b..fb65d221cedf 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -558,32 +558,10 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)
558 558
559 if (srb->result == SAM_STAT_GOOD && scsi_get_resid(srb) == 0) { 559 if (srb->result == SAM_STAT_GOOD && scsi_get_resid(srb) == 0) {
560 560
561 /* The command succeeded. If the capacity is odd 561 /* The command succeeded. We know this device doesn't
562 * (i.e., if the sector number is even) then the 562 * have the last-sector bug, so stop checking it.
563 * "always-even" heuristic would be wrong for this
564 * device. Issue a WARN() so that the kerneloops.org
565 * project will be notified and we will then know to
566 * mark the device with a CAPACITY_OK flag. Hopefully
567 * this will occur for only a few devices.
568 *
569 * Use the sign of us->last_sector_hacks to tell whether
570 * the warning has already been issued; we don't need
571 * more than one warning per device.
572 */ 563 */
573 if (!(sector & 1) && us->use_last_sector_hacks > 0) { 564 us->use_last_sector_hacks = 0;
574 unsigned vid = le16_to_cpu(
575 us->pusb_dev->descriptor.idVendor);
576 unsigned pid = le16_to_cpu(
577 us->pusb_dev->descriptor.idProduct);
578 unsigned rev = le16_to_cpu(
579 us->pusb_dev->descriptor.bcdDevice);
580
581 WARN(1, "%s: Successful last sector success at %u, "
582 "device %04x:%04x:%04x\n",
583 sdkp->disk->disk_name, sector,
584 vid, pid, rev);
585 us->use_last_sector_hacks = -1;
586 }
587 565
588 } else { 566 } else {
589 /* The command failed. Allow up to 3 retries in case this 567 /* The command failed. Allow up to 3 retries in case this
@@ -599,14 +577,6 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)
599 srb->result = SAM_STAT_CHECK_CONDITION; 577 srb->result = SAM_STAT_CHECK_CONDITION;
600 memcpy(srb->sense_buffer, record_not_found, 578 memcpy(srb->sense_buffer, record_not_found,
601 sizeof(record_not_found)); 579 sizeof(record_not_found));
602
603 /* In theory we might want to issue a WARN() here if the
604 * capacity is even, since it could indicate the device
605 * has the READ CAPACITY bug _and_ the real capacity is
606 * odd. But it could also indicate that the device
607 * simply can't access its last sector, a failure mode
608 * which is surprisingly common. So no warning.
609 */
610 } 580 }
611 581
612 done: 582 done:
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 69269f739563..cfde74a6faa3 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -226,7 +226,7 @@ UNUSUAL_DEV( 0x0421, 0x047c, 0x0370, 0x0610,
226 US_FL_MAX_SECTORS_64 ), 226 US_FL_MAX_SECTORS_64 ),
227 227
228/* Reported by Manuel Osdoba <manuel.osdoba@tu-ilmenau.de> */ 228/* Reported by Manuel Osdoba <manuel.osdoba@tu-ilmenau.de> */
229UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x0452, 229UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x9999,
230 "Nokia", 230 "Nokia",
231 "Nokia 6233", 231 "Nokia 6233",
232 US_SC_DEVICE, US_PR_DEVICE, NULL, 232 US_SC_DEVICE, US_PR_DEVICE, NULL,
@@ -907,13 +907,13 @@ UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff,
907 "Genesys Logic", 907 "Genesys Logic",
908 "USB to IDE Optical", 908 "USB to IDE Optical",
909 US_SC_DEVICE, US_PR_DEVICE, NULL, 909 US_SC_DEVICE, US_PR_DEVICE, NULL,
910 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ), 910 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ),
911 911
912UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff, 912UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff,
913 "Genesys Logic", 913 "Genesys Logic",
914 "USB to IDE Disk", 914 "USB to IDE Disk",
915 US_SC_DEVICE, US_PR_DEVICE, NULL, 915 US_SC_DEVICE, US_PR_DEVICE, NULL,
916 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ), 916 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ),
917 917
918/* Reported by Ben Efros <ben@pc-doctor.com> */ 918/* Reported by Ben Efros <ben@pc-doctor.com> */
919UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451, 919UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451,
@@ -951,7 +951,9 @@ UNUSUAL_DEV( 0x066f, 0x8000, 0x0001, 0x0001,
951 US_FL_FIX_CAPACITY ), 951 US_FL_FIX_CAPACITY ),
952 952
953/* Reported by Richard -=[]=- <micro_flyer@hotmail.com> */ 953/* Reported by Richard -=[]=- <micro_flyer@hotmail.com> */
954UNUSUAL_DEV( 0x067b, 0x2507, 0x0100, 0x0100, 954/* Change to bcdDeviceMin (0x0100 to 0x0001) reported by
955 * Thomas Bartosik <tbartdev@gmx-topmail.de> */
956UNUSUAL_DEV( 0x067b, 0x2507, 0x0001, 0x0100,
955 "Prolific Technology Inc.", 957 "Prolific Technology Inc.",
956 "Mass Storage Device", 958 "Mass Storage Device",
957 US_SC_DEVICE, US_PR_DEVICE, NULL, 959 US_SC_DEVICE, US_PR_DEVICE, NULL,
@@ -1214,7 +1216,7 @@ UNUSUAL_DEV( 0x07c4, 0xa400, 0x0000, 0xffff,
1214 "Datafab", 1216 "Datafab",
1215 "KECF-USB", 1217 "KECF-USB",
1216 US_SC_DEVICE, US_PR_DEVICE, NULL, 1218 US_SC_DEVICE, US_PR_DEVICE, NULL,
1217 US_FL_FIX_INQUIRY ), 1219 US_FL_FIX_INQUIRY | US_FL_FIX_CAPACITY ),
1218 1220
1219/* Reported by Rauch Wolke <rauchwolke@gmx.net> */ 1221/* Reported by Rauch Wolke <rauchwolke@gmx.net> */
1220UNUSUAL_DEV( 0x07c4, 0xa4a5, 0x0000, 0xffff, 1222UNUSUAL_DEV( 0x07c4, 0xa4a5, 0x0000, 0xffff,
@@ -1354,21 +1356,6 @@ UNUSUAL_DEV( 0x0a17, 0x0004, 0x1000, 0x1000,
1354 US_SC_DEVICE, US_PR_DEVICE, NULL, 1356 US_SC_DEVICE, US_PR_DEVICE, NULL,
1355 US_FL_FIX_INQUIRY ), 1357 US_FL_FIX_INQUIRY ),
1356 1358
1357
1358/* Submitted by Per Winkvist <per.winkvist@uk.com> */
1359UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
1360 "Pentax",
1361 "Optio S/S4",
1362 US_SC_DEVICE, US_PR_DEVICE, NULL,
1363 US_FL_FIX_INQUIRY ),
1364
1365/* Reported by Jaak Ristioja <Ristioja@gmail.com> */
1366UNUSUAL_DEV( 0x0a17, 0x006e, 0x0100, 0x0100,
1367 "Pentax",
1368 "K10D",
1369 US_SC_DEVICE, US_PR_DEVICE, NULL,
1370 US_FL_FIX_CAPACITY ),
1371
1372/* These are virtual windows driver CDs, which the zd1211rw driver 1359/* These are virtual windows driver CDs, which the zd1211rw driver
1373 * automatically converts into WLAN devices. */ 1360 * automatically converts into WLAN devices. */
1374UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101, 1361UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
@@ -1405,6 +1392,16 @@ UNUSUAL_DEV( 0x0af0, 0x7401, 0x0000, 0x0000,
1405 US_SC_DEVICE, US_PR_DEVICE, NULL, 1392 US_SC_DEVICE, US_PR_DEVICE, NULL,
1406 0 ), 1393 0 ),
1407 1394
1395/* Reported by Jan Dumon <j.dumon@option.com>
1396 * This device (wrongly) has a vendor-specific device descriptor.
1397 * The entry is needed so usb-storage can bind to it's mass-storage
1398 * interface as an interface driver */
1399UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0000,
1400 "Option",
1401 "GI 0431 SD-Card",
1402 US_SC_DEVICE, US_PR_DEVICE, NULL,
1403 0 ),
1404
1408/* Reported by Ben Efros <ben@pc-doctor.com> */ 1405/* Reported by Ben Efros <ben@pc-doctor.com> */
1409UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000, 1406UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000,
1410 "Seagate", 1407 "Seagate",
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c
index e2e7e4bc8463..8e18141bb2e0 100644
--- a/drivers/usb/wusbcore/devconnect.c
+++ b/drivers/usb/wusbcore/devconnect.c
@@ -386,6 +386,7 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc,
386 | USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED); 386 | USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED);
387 port->change |= USB_PORT_STAT_C_CONNECTION | USB_PORT_STAT_C_ENABLE; 387 port->change |= USB_PORT_STAT_C_CONNECTION | USB_PORT_STAT_C_ENABLE;
388 if (wusb_dev) { 388 if (wusb_dev) {
389 dev_dbg(wusbhc->dev, "disconnecting device from port %d\n", wusb_dev->port_idx);
389 if (!list_empty(&wusb_dev->cack_node)) 390 if (!list_empty(&wusb_dev->cack_node))
390 list_del_init(&wusb_dev->cack_node); 391 list_del_init(&wusb_dev->cack_node);
391 /* For the one in cack_add() */ 392 /* For the one in cack_add() */
diff --git a/drivers/usb/wusbcore/rh.c b/drivers/usb/wusbcore/rh.c
index 3937bf6f8cef..9fe4246cecb9 100644
--- a/drivers/usb/wusbcore/rh.c
+++ b/drivers/usb/wusbcore/rh.c
@@ -100,6 +100,9 @@ static int wusbhc_rh_port_reset(struct wusbhc *wusbhc, u8 port_idx)
100 struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx); 100 struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx);
101 struct wusb_dev *wusb_dev = port->wusb_dev; 101 struct wusb_dev *wusb_dev = port->wusb_dev;
102 102
103 if (wusb_dev == NULL)
104 return -ENOTCONN;
105
103 port->status |= USB_PORT_STAT_RESET; 106 port->status |= USB_PORT_STAT_RESET;
104 port->change |= USB_PORT_STAT_C_RESET; 107 port->change |= USB_PORT_STAT_C_RESET;
105 108
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c
index 238a96aee3a1..613a5fc490d3 100644
--- a/drivers/usb/wusbcore/wa-xfer.c
+++ b/drivers/usb/wusbcore/wa-xfer.c
@@ -921,8 +921,10 @@ static void wa_urb_enqueue_b(struct wa_xfer *xfer)
921 result = -ENODEV; 921 result = -ENODEV;
922 /* FIXME: segmentation broken -- kills DWA */ 922 /* FIXME: segmentation broken -- kills DWA */
923 mutex_lock(&wusbhc->mutex); /* get a WUSB dev */ 923 mutex_lock(&wusbhc->mutex); /* get a WUSB dev */
924 if (urb->dev == NULL) 924 if (urb->dev == NULL) {
925 mutex_unlock(&wusbhc->mutex);
925 goto error_dev_gone; 926 goto error_dev_gone;
927 }
926 wusb_dev = __wusb_dev_get_by_usb_dev(wusbhc, urb->dev); 928 wusb_dev = __wusb_dev_get_by_usb_dev(wusbhc, urb->dev);
927 if (wusb_dev == NULL) { 929 if (wusb_dev == NULL) {
928 mutex_unlock(&wusbhc->mutex); 930 mutex_unlock(&wusbhc->mutex);