diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-15 20:10:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-15 20:10:02 -0400 |
commit | 41c8c535237e9cea522024548c5bc37f7d34a81f (patch) | |
tree | 9064b1bcd52bd0f8f255590e30a41f9e054b94dd /drivers | |
parent | 8e53ed10f871a077cc61374c74e0bbab25264208 (diff) | |
parent | b3a3dd074f7053ef824ad077e5331b52220ceba1 (diff) |
Merge tag 'usb-3.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg Kroah-Hartman:
"Here are a bunch of tiny fixes for the USB core and drivers for
3.5-rc3
A bunch of gadget fixes, and new device ids, as well as some fixes for
a number of different regressions that have been reported recently.
We also fixed some PCI host controllers to resolve a long-standing bug
with a whole class of host controllers that have been plaguing people
for a number of kernel releases, preventing their systems from
suspending properly.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'usb-3.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (41 commits)
USB: fix gathering of interface associations
usb: ehci-sh: fix illegal phy_init() running when platform_data is NULL
usb: cdc-acm: fix devices not unthrottled on open
Fix OMAP EHCI suspend/resume failure (i693)
USB: ohci-hub: Mark ohci_finish_controller_resume() as __maybe_unused
usb: use usb_serial_put in usb_serial_probe errors
USB: EHCI: Fix build warning in xilinx ehci driver
USB: fix PS3 EHCI systems
xHCI: Increase the timeout for controller save/restore state operation
xhci: Don't free endpoints in xhci_mem_cleanup()
xhci: Fix invalid loop check in xhci_free_tt_info()
xhci: Fix error path return value.
USB: Checking the wrong variable in usb_disable_lpm()
usb-storage: Add 090c:1000 to unusal-devs
USB: serial-generic: use a single set of device IDs
USB: serial: Enforce USB driver and USB serial driver match
USB: add NO_D3_DURING_SLEEP flag and revert 151b61284776be2
USB: option: add more YUGA device ids
USB: mos7840: Fix compilation of usb serial driver
USB: option: fix memory leak
...
Diffstat (limited to 'drivers')
39 files changed, 352 insertions, 168 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 447e83472c01..77cb54a65cde 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1744,6 +1744,11 @@ int pci_prepare_to_sleep(struct pci_dev *dev) | |||
1744 | if (target_state == PCI_POWER_ERROR) | 1744 | if (target_state == PCI_POWER_ERROR) |
1745 | return -EIO; | 1745 | return -EIO; |
1746 | 1746 | ||
1747 | /* Some devices mustn't be in D3 during system sleep */ | ||
1748 | if (target_state == PCI_D3hot && | ||
1749 | (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP)) | ||
1750 | return 0; | ||
1751 | |||
1747 | pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); | 1752 | pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); |
1748 | 1753 | ||
1749 | error = pci_set_power_state(dev, target_state); | 1754 | error = pci_set_power_state(dev, target_state); |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 2a7521677541..194b243a2817 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -2929,6 +2929,32 @@ static void __devinit disable_igfx_irq(struct pci_dev *dev) | |||
2929 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq); | 2929 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq); |
2930 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); | 2930 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); |
2931 | 2931 | ||
2932 | /* | ||
2933 | * The Intel 6 Series/C200 Series chipset's EHCI controllers on many | ||
2934 | * ASUS motherboards will cause memory corruption or a system crash | ||
2935 | * if they are in D3 while the system is put into S3 sleep. | ||
2936 | */ | ||
2937 | static void __devinit asus_ehci_no_d3(struct pci_dev *dev) | ||
2938 | { | ||
2939 | const char *sys_info; | ||
2940 | static const char good_Asus_board[] = "P8Z68-V"; | ||
2941 | |||
2942 | if (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP) | ||
2943 | return; | ||
2944 | if (dev->subsystem_vendor != PCI_VENDOR_ID_ASUSTEK) | ||
2945 | return; | ||
2946 | sys_info = dmi_get_system_info(DMI_BOARD_NAME); | ||
2947 | if (sys_info && memcmp(sys_info, good_Asus_board, | ||
2948 | sizeof(good_Asus_board) - 1) == 0) | ||
2949 | return; | ||
2950 | |||
2951 | dev_info(&dev->dev, "broken D3 during system sleep on ASUS\n"); | ||
2952 | dev->dev_flags |= PCI_DEV_FLAGS_NO_D3_DURING_SLEEP; | ||
2953 | device_set_wakeup_capable(&dev->dev, false); | ||
2954 | } | ||
2955 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c26, asus_ehci_no_d3); | ||
2956 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c2d, asus_ehci_no_d3); | ||
2957 | |||
2932 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, | 2958 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, |
2933 | struct pci_fixup *end) | 2959 | struct pci_fixup *end) |
2934 | { | 2960 | { |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index f2a120eea9d4..36a2a0b7b82c 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -567,6 +567,14 @@ static int acm_port_activate(struct tty_port *port, struct tty_struct *tty) | |||
567 | 567 | ||
568 | usb_autopm_put_interface(acm->control); | 568 | usb_autopm_put_interface(acm->control); |
569 | 569 | ||
570 | /* | ||
571 | * Unthrottle device in case the TTY was closed while throttled. | ||
572 | */ | ||
573 | spin_lock_irq(&acm->read_lock); | ||
574 | acm->throttled = 0; | ||
575 | acm->throttle_req = 0; | ||
576 | spin_unlock_irq(&acm->read_lock); | ||
577 | |||
570 | if (acm_submit_read_urbs(acm, GFP_KERNEL)) | 578 | if (acm_submit_read_urbs(acm, GFP_KERNEL)) |
571 | goto error_submit_read_urbs; | 579 | goto error_submit_read_urbs; |
572 | 580 | ||
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index ea8b304f0e85..8fd398dffced 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -55,6 +55,15 @@ static const struct usb_device_id wdm_ids[] = { | |||
55 | .bInterfaceSubClass = 1, | 55 | .bInterfaceSubClass = 1, |
56 | .bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */ | 56 | .bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */ |
57 | }, | 57 | }, |
58 | { | ||
59 | /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */ | ||
60 | .match_flags = USB_DEVICE_ID_MATCH_VENDOR | | ||
61 | USB_DEVICE_ID_MATCH_INT_INFO, | ||
62 | .idVendor = HUAWEI_VENDOR_ID, | ||
63 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | ||
64 | .bInterfaceSubClass = 1, | ||
65 | .bInterfaceProtocol = 57, /* NOTE: CDC ECM control interface! */ | ||
66 | }, | ||
58 | { } | 67 | { } |
59 | }; | 68 | }; |
60 | 69 | ||
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 57ed9e400c06..622b4a48e732 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -493,15 +493,6 @@ static int hcd_pci_suspend_noirq(struct device *dev) | |||
493 | 493 | ||
494 | pci_save_state(pci_dev); | 494 | pci_save_state(pci_dev); |
495 | 495 | ||
496 | /* | ||
497 | * Some systems crash if an EHCI controller is in D3 during | ||
498 | * a sleep transition. We have to leave such controllers in D0. | ||
499 | */ | ||
500 | if (hcd->broken_pci_sleep) { | ||
501 | dev_dbg(dev, "Staying in PCI D0\n"); | ||
502 | return retval; | ||
503 | } | ||
504 | |||
505 | /* If the root hub is dead rather than suspended, disallow remote | 496 | /* If the root hub is dead rather than suspended, disallow remote |
506 | * wakeup. usb_hc_died() should ensure that both hosts are marked as | 497 | * wakeup. usb_hc_died() should ensure that both hosts are marked as |
507 | * dying, so we only need to check the primary roothub. | 498 | * dying, so we only need to check the primary roothub. |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 04fb834c3fa1..25a7422ee657 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -3379,7 +3379,7 @@ int usb_disable_lpm(struct usb_device *udev) | |||
3379 | return 0; | 3379 | return 0; |
3380 | 3380 | ||
3381 | udev->lpm_disable_count++; | 3381 | udev->lpm_disable_count++; |
3382 | if ((udev->u1_params.timeout == 0 && udev->u1_params.timeout == 0)) | 3382 | if ((udev->u1_params.timeout == 0 && udev->u2_params.timeout == 0)) |
3383 | return 0; | 3383 | return 0; |
3384 | 3384 | ||
3385 | /* If LPM is enabled, attempt to disable it. */ | 3385 | /* If LPM is enabled, attempt to disable it. */ |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index b548cf1dbc62..bdd1c6749d88 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1838,7 +1838,6 @@ free_interfaces: | |||
1838 | intfc = cp->intf_cache[i]; | 1838 | intfc = cp->intf_cache[i]; |
1839 | intf->altsetting = intfc->altsetting; | 1839 | intf->altsetting = intfc->altsetting; |
1840 | intf->num_altsetting = intfc->num_altsetting; | 1840 | intf->num_altsetting = intfc->num_altsetting; |
1841 | intf->intf_assoc = find_iad(dev, cp, i); | ||
1842 | kref_get(&intfc->ref); | 1841 | kref_get(&intfc->ref); |
1843 | 1842 | ||
1844 | alt = usb_altnum_to_altsetting(intf, 0); | 1843 | alt = usb_altnum_to_altsetting(intf, 0); |
@@ -1851,6 +1850,8 @@ free_interfaces: | |||
1851 | if (!alt) | 1850 | if (!alt) |
1852 | alt = &intf->altsetting[0]; | 1851 | alt = &intf->altsetting[0]; |
1853 | 1852 | ||
1853 | intf->intf_assoc = | ||
1854 | find_iad(dev, cp, alt->desc.bInterfaceNumber); | ||
1854 | intf->cur_altsetting = alt; | 1855 | intf->cur_altsetting = alt; |
1855 | usb_enable_interface(dev, intf, true); | 1856 | usb_enable_interface(dev, intf, true); |
1856 | intf->dev.parent = &dev->dev; | 1857 | intf->dev.parent = &dev->dev; |
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index e23bf7984aaf..9a9bced813ed 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -599,12 +599,6 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
599 | 599 | ||
600 | spin_lock_irqsave(&ep->udc->lock, flags); | 600 | spin_lock_irqsave(&ep->udc->lock, flags); |
601 | 601 | ||
602 | if (ep->ep.desc) { | ||
603 | spin_unlock_irqrestore(&ep->udc->lock, flags); | ||
604 | DBG(DBG_ERR, "ep%d already enabled\n", ep->index); | ||
605 | return -EBUSY; | ||
606 | } | ||
607 | |||
608 | ep->ep.desc = desc; | 602 | ep->ep.desc = desc; |
609 | ep->ep.maxpacket = maxpacket; | 603 | ep->ep.maxpacket = maxpacket; |
610 | 604 | ||
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 51881f3bd07a..b09452d6f33a 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
@@ -1596,7 +1596,7 @@ static int qe_ep_enable(struct usb_ep *_ep, | |||
1596 | ep = container_of(_ep, struct qe_ep, ep); | 1596 | ep = container_of(_ep, struct qe_ep, ep); |
1597 | 1597 | ||
1598 | /* catch various bogus parameters */ | 1598 | /* catch various bogus parameters */ |
1599 | if (!_ep || !desc || ep->ep.desc || _ep->name == ep_name[0] || | 1599 | if (!_ep || !desc || _ep->name == ep_name[0] || |
1600 | (desc->bDescriptorType != USB_DT_ENDPOINT)) | 1600 | (desc->bDescriptorType != USB_DT_ENDPOINT)) |
1601 | return -EINVAL; | 1601 | return -EINVAL; |
1602 | 1602 | ||
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 28316858208b..bc6f9bb9994a 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c | |||
@@ -567,7 +567,7 @@ static int fsl_ep_enable(struct usb_ep *_ep, | |||
567 | ep = container_of(_ep, struct fsl_ep, ep); | 567 | ep = container_of(_ep, struct fsl_ep, ep); |
568 | 568 | ||
569 | /* catch various bogus parameters */ | 569 | /* catch various bogus parameters */ |
570 | if (!_ep || !desc || ep->ep.desc | 570 | if (!_ep || !desc |
571 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) | 571 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) |
572 | return -EINVAL; | 572 | return -EINVAL; |
573 | 573 | ||
@@ -2575,7 +2575,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev) | |||
2575 | /* for ep0: the desc defined here; | 2575 | /* for ep0: the desc defined here; |
2576 | * for other eps, gadget layer called ep_enable with defined desc | 2576 | * for other eps, gadget layer called ep_enable with defined desc |
2577 | */ | 2577 | */ |
2578 | udc_controller->eps[0].desc = &fsl_ep0_desc; | 2578 | udc_controller->eps[0].ep.desc = &fsl_ep0_desc; |
2579 | udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD; | 2579 | udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD; |
2580 | 2580 | ||
2581 | /* setup the udc->eps[] for non-control endpoints and link | 2581 | /* setup the udc->eps[] for non-control endpoints and link |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index 5cd7b7e7ddb4..f61a967f7082 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h | |||
@@ -568,10 +568,10 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length) | |||
568 | /* | 568 | /* |
569 | * ### internal used help routines. | 569 | * ### internal used help routines. |
570 | */ | 570 | */ |
571 | #define ep_index(EP) ((EP)->desc->bEndpointAddress&0xF) | 571 | #define ep_index(EP) ((EP)->ep.desc->bEndpointAddress&0xF) |
572 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) | 572 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) |
573 | #define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ | 573 | #define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ |
574 | USB_DIR_IN ):((EP)->desc->bEndpointAddress \ | 574 | USB_DIR_IN) : ((EP)->ep.desc->bEndpointAddress \ |
575 | & USB_DIR_IN)==USB_DIR_IN) | 575 | & USB_DIR_IN)==USB_DIR_IN) |
576 | #define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \ | 576 | #define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \ |
577 | &udc->eps[pipe]) | 577 | &udc->eps[pipe]) |
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index b241e6c6a7f2..3d28fb976c78 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -102,7 +102,7 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
102 | unsigned long flags; | 102 | unsigned long flags; |
103 | 103 | ||
104 | ep = container_of(_ep, struct goku_ep, ep); | 104 | ep = container_of(_ep, struct goku_ep, ep); |
105 | if (!_ep || !desc || ep->ep.desc | 105 | if (!_ep || !desc |
106 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 106 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
107 | return -EINVAL; | 107 | return -EINVAL; |
108 | dev = ep->dev; | 108 | dev = ep->dev; |
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index dbcd1329495e..117a4bba1b8c 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c | |||
@@ -464,7 +464,7 @@ static int mv_ep_enable(struct usb_ep *_ep, | |||
464 | ep = container_of(_ep, struct mv_ep, ep); | 464 | ep = container_of(_ep, struct mv_ep, ep); |
465 | udc = ep->udc; | 465 | udc = ep->udc; |
466 | 466 | ||
467 | if (!_ep || !desc || ep->ep.desc | 467 | if (!_ep || !desc |
468 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 468 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
469 | return -EINVAL; | 469 | return -EINVAL; |
470 | 470 | ||
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 7ba32469c5bd..a460e8c204f4 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -153,7 +153,7 @@ static int omap_ep_enable(struct usb_ep *_ep, | |||
153 | u16 maxp; | 153 | u16 maxp; |
154 | 154 | ||
155 | /* catch various bogus parameters */ | 155 | /* catch various bogus parameters */ |
156 | if (!_ep || !desc || ep->ep.desc | 156 | if (!_ep || !desc |
157 | || desc->bDescriptorType != USB_DT_ENDPOINT | 157 | || desc->bDescriptorType != USB_DT_ENDPOINT |
158 | || ep->bEndpointAddress != desc->bEndpointAddress | 158 | || ep->bEndpointAddress != desc->bEndpointAddress |
159 | || ep->maxpacket < usb_endpoint_maxp(desc)) { | 159 | || ep->maxpacket < usb_endpoint_maxp(desc)) { |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index d7c8cb3bf759..f7ff9e8e746a 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -218,7 +218,7 @@ static int pxa25x_ep_enable (struct usb_ep *_ep, | |||
218 | struct pxa25x_udc *dev; | 218 | struct pxa25x_udc *dev; |
219 | 219 | ||
220 | ep = container_of (_ep, struct pxa25x_ep, ep); | 220 | ep = container_of (_ep, struct pxa25x_ep, ep); |
221 | if (!_ep || !desc || ep->ep.desc || _ep->name == ep0name | 221 | if (!_ep || !desc || _ep->name == ep0name |
222 | || desc->bDescriptorType != USB_DT_ENDPOINT | 222 | || desc->bDescriptorType != USB_DT_ENDPOINT |
223 | || ep->bEndpointAddress != desc->bEndpointAddress | 223 | || ep->bEndpointAddress != desc->bEndpointAddress |
224 | || ep->fifo_size < usb_endpoint_maxp (desc)) { | 224 | || ep->fifo_size < usb_endpoint_maxp (desc)) { |
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index 36c6836eeb0f..236b271871a0 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -760,7 +760,7 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep, | |||
760 | u32 ecr = 0; | 760 | u32 ecr = 0; |
761 | 761 | ||
762 | hsep = our_ep(_ep); | 762 | hsep = our_ep(_ep); |
763 | if (!_ep || !desc || hsep->ep.desc || _ep->name == ep0name | 763 | if (!_ep || !desc || _ep->name == ep0name |
764 | || desc->bDescriptorType != USB_DT_ENDPOINT | 764 | || desc->bDescriptorType != USB_DT_ENDPOINT |
765 | || hsep->bEndpointAddress != desc->bEndpointAddress | 765 | || hsep->bEndpointAddress != desc->bEndpointAddress |
766 | || ep_maxpacket(hsep) < usb_endpoint_maxp(desc)) | 766 | || ep_maxpacket(hsep) < usb_endpoint_maxp(desc)) |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 3de71d37d75e..f2e51f50e528 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -1062,7 +1062,7 @@ static int s3c2410_udc_ep_enable(struct usb_ep *_ep, | |||
1062 | 1062 | ||
1063 | ep = to_s3c2410_ep(_ep); | 1063 | ep = to_s3c2410_ep(_ep); |
1064 | 1064 | ||
1065 | if (!_ep || !desc || ep->ep.desc | 1065 | if (!_ep || !desc |
1066 | || _ep->name == ep0name | 1066 | || _ep->name == ep0name |
1067 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 1067 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
1068 | return -EINVAL; | 1068 | return -EINVAL; |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index b100f5f9f4b6..800be38c78b4 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -671,7 +671,9 @@ static int ehci_init(struct usb_hcd *hcd) | |||
671 | hw = ehci->async->hw; | 671 | hw = ehci->async->hw; |
672 | hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); | 672 | hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); |
673 | hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); | 673 | hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); |
674 | #if defined(CONFIG_PPC_PS3) | ||
674 | hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */ | 675 | hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */ |
676 | #endif | ||
675 | hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); | 677 | hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); |
676 | hw->hw_qtd_next = EHCI_LIST_END(ehci); | 678 | hw->hw_qtd_next = EHCI_LIST_END(ehci); |
677 | ehci->async->qh_state = QH_STATE_LINKED; | 679 | ehci->async->qh_state = QH_STATE_LINKED; |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index a44294d13494..17cfb8a1131c 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/regulator/consumer.h> | 43 | #include <linux/regulator/consumer.h> |
44 | #include <linux/pm_runtime.h> | 44 | #include <linux/pm_runtime.h> |
45 | #include <linux/gpio.h> | 45 | #include <linux/gpio.h> |
46 | #include <linux/clk.h> | ||
46 | 47 | ||
47 | /* EHCI Register Set */ | 48 | /* EHCI Register Set */ |
48 | #define EHCI_INSNREG04 (0xA0) | 49 | #define EHCI_INSNREG04 (0xA0) |
@@ -55,6 +56,15 @@ | |||
55 | #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 | 56 | #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 |
56 | #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 | 57 | #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 |
57 | 58 | ||
59 | /* Errata i693 */ | ||
60 | static struct clk *utmi_p1_fck; | ||
61 | static struct clk *utmi_p2_fck; | ||
62 | static struct clk *xclk60mhsp1_ck; | ||
63 | static struct clk *xclk60mhsp2_ck; | ||
64 | static struct clk *usbhost_p1_fck; | ||
65 | static struct clk *usbhost_p2_fck; | ||
66 | static struct clk *init_60m_fclk; | ||
67 | |||
58 | /*-------------------------------------------------------------------------*/ | 68 | /*-------------------------------------------------------------------------*/ |
59 | 69 | ||
60 | static const struct hc_driver ehci_omap_hc_driver; | 70 | static const struct hc_driver ehci_omap_hc_driver; |
@@ -70,6 +80,41 @@ static inline u32 ehci_read(void __iomem *base, u32 reg) | |||
70 | return __raw_readl(base + reg); | 80 | return __raw_readl(base + reg); |
71 | } | 81 | } |
72 | 82 | ||
83 | /* Erratum i693 workaround sequence */ | ||
84 | static void omap_ehci_erratum_i693(struct ehci_hcd *ehci) | ||
85 | { | ||
86 | int ret = 0; | ||
87 | |||
88 | /* Switch to the internal 60 MHz clock */ | ||
89 | ret = clk_set_parent(utmi_p1_fck, init_60m_fclk); | ||
90 | if (ret != 0) | ||
91 | ehci_err(ehci, "init_60m_fclk set parent" | ||
92 | "failed error:%d\n", ret); | ||
93 | |||
94 | ret = clk_set_parent(utmi_p2_fck, init_60m_fclk); | ||
95 | if (ret != 0) | ||
96 | ehci_err(ehci, "init_60m_fclk set parent" | ||
97 | "failed error:%d\n", ret); | ||
98 | |||
99 | clk_enable(usbhost_p1_fck); | ||
100 | clk_enable(usbhost_p2_fck); | ||
101 | |||
102 | /* Wait 1ms and switch back to the external clock */ | ||
103 | mdelay(1); | ||
104 | ret = clk_set_parent(utmi_p1_fck, xclk60mhsp1_ck); | ||
105 | if (ret != 0) | ||
106 | ehci_err(ehci, "xclk60mhsp1_ck set parent" | ||
107 | "failed error:%d\n", ret); | ||
108 | |||
109 | ret = clk_set_parent(utmi_p2_fck, xclk60mhsp2_ck); | ||
110 | if (ret != 0) | ||
111 | ehci_err(ehci, "xclk60mhsp2_ck set parent" | ||
112 | "failed error:%d\n", ret); | ||
113 | |||
114 | clk_disable(usbhost_p1_fck); | ||
115 | clk_disable(usbhost_p2_fck); | ||
116 | } | ||
117 | |||
73 | static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | 118 | static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) |
74 | { | 119 | { |
75 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); | 120 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); |
@@ -100,6 +145,50 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | |||
100 | } | 145 | } |
101 | } | 146 | } |
102 | 147 | ||
148 | static int omap_ehci_hub_control( | ||
149 | struct usb_hcd *hcd, | ||
150 | u16 typeReq, | ||
151 | u16 wValue, | ||
152 | u16 wIndex, | ||
153 | char *buf, | ||
154 | u16 wLength | ||
155 | ) | ||
156 | { | ||
157 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
158 | u32 __iomem *status_reg = &ehci->regs->port_status[ | ||
159 | (wIndex & 0xff) - 1]; | ||
160 | u32 temp; | ||
161 | unsigned long flags; | ||
162 | int retval = 0; | ||
163 | |||
164 | spin_lock_irqsave(&ehci->lock, flags); | ||
165 | |||
166 | if (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_SUSPEND) { | ||
167 | temp = ehci_readl(ehci, status_reg); | ||
168 | if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) { | ||
169 | retval = -EPIPE; | ||
170 | goto done; | ||
171 | } | ||
172 | |||
173 | temp &= ~PORT_WKCONN_E; | ||
174 | temp |= PORT_WKDISC_E | PORT_WKOC_E; | ||
175 | ehci_writel(ehci, temp | PORT_SUSPEND, status_reg); | ||
176 | |||
177 | omap_ehci_erratum_i693(ehci); | ||
178 | |||
179 | set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports); | ||
180 | goto done; | ||
181 | } | ||
182 | |||
183 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
184 | |||
185 | /* Handle the hub control events here */ | ||
186 | return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength); | ||
187 | done: | ||
188 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
189 | return retval; | ||
190 | } | ||
191 | |||
103 | static void disable_put_regulator( | 192 | static void disable_put_regulator( |
104 | struct ehci_hcd_omap_platform_data *pdata) | 193 | struct ehci_hcd_omap_platform_data *pdata) |
105 | { | 194 | { |
@@ -264,8 +353,76 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
264 | /* root ports should always stay powered */ | 353 | /* root ports should always stay powered */ |
265 | ehci_port_power(omap_ehci, 1); | 354 | ehci_port_power(omap_ehci, 1); |
266 | 355 | ||
356 | /* get clocks */ | ||
357 | utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk"); | ||
358 | if (IS_ERR(utmi_p1_fck)) { | ||
359 | ret = PTR_ERR(utmi_p1_fck); | ||
360 | dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret); | ||
361 | goto err_add_hcd; | ||
362 | } | ||
363 | |||
364 | xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck"); | ||
365 | if (IS_ERR(xclk60mhsp1_ck)) { | ||
366 | ret = PTR_ERR(xclk60mhsp1_ck); | ||
367 | dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret); | ||
368 | goto err_utmi_p1_fck; | ||
369 | } | ||
370 | |||
371 | utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk"); | ||
372 | if (IS_ERR(utmi_p2_fck)) { | ||
373 | ret = PTR_ERR(utmi_p2_fck); | ||
374 | dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret); | ||
375 | goto err_xclk60mhsp1_ck; | ||
376 | } | ||
377 | |||
378 | xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck"); | ||
379 | if (IS_ERR(xclk60mhsp2_ck)) { | ||
380 | ret = PTR_ERR(xclk60mhsp2_ck); | ||
381 | dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret); | ||
382 | goto err_utmi_p2_fck; | ||
383 | } | ||
384 | |||
385 | usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk"); | ||
386 | if (IS_ERR(usbhost_p1_fck)) { | ||
387 | ret = PTR_ERR(usbhost_p1_fck); | ||
388 | dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret); | ||
389 | goto err_xclk60mhsp2_ck; | ||
390 | } | ||
391 | |||
392 | usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk"); | ||
393 | if (IS_ERR(usbhost_p2_fck)) { | ||
394 | ret = PTR_ERR(usbhost_p2_fck); | ||
395 | dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret); | ||
396 | goto err_usbhost_p1_fck; | ||
397 | } | ||
398 | |||
399 | init_60m_fclk = clk_get(dev, "init_60m_fclk"); | ||
400 | if (IS_ERR(init_60m_fclk)) { | ||
401 | ret = PTR_ERR(init_60m_fclk); | ||
402 | dev_err(dev, "init_60m_fclk failed error:%d\n", ret); | ||
403 | goto err_usbhost_p2_fck; | ||
404 | } | ||
405 | |||
267 | return 0; | 406 | return 0; |
268 | 407 | ||
408 | err_usbhost_p2_fck: | ||
409 | clk_put(usbhost_p2_fck); | ||
410 | |||
411 | err_usbhost_p1_fck: | ||
412 | clk_put(usbhost_p1_fck); | ||
413 | |||
414 | err_xclk60mhsp2_ck: | ||
415 | clk_put(xclk60mhsp2_ck); | ||
416 | |||
417 | err_utmi_p2_fck: | ||
418 | clk_put(utmi_p2_fck); | ||
419 | |||
420 | err_xclk60mhsp1_ck: | ||
421 | clk_put(xclk60mhsp1_ck); | ||
422 | |||
423 | err_utmi_p1_fck: | ||
424 | clk_put(utmi_p1_fck); | ||
425 | |||
269 | err_add_hcd: | 426 | err_add_hcd: |
270 | disable_put_regulator(pdata); | 427 | disable_put_regulator(pdata); |
271 | pm_runtime_put_sync(dev); | 428 | pm_runtime_put_sync(dev); |
@@ -294,6 +451,15 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
294 | disable_put_regulator(dev->platform_data); | 451 | disable_put_regulator(dev->platform_data); |
295 | iounmap(hcd->regs); | 452 | iounmap(hcd->regs); |
296 | usb_put_hcd(hcd); | 453 | usb_put_hcd(hcd); |
454 | |||
455 | clk_put(utmi_p1_fck); | ||
456 | clk_put(utmi_p2_fck); | ||
457 | clk_put(xclk60mhsp1_ck); | ||
458 | clk_put(xclk60mhsp2_ck); | ||
459 | clk_put(usbhost_p1_fck); | ||
460 | clk_put(usbhost_p2_fck); | ||
461 | clk_put(init_60m_fclk); | ||
462 | |||
297 | pm_runtime_put_sync(dev); | 463 | pm_runtime_put_sync(dev); |
298 | pm_runtime_disable(dev); | 464 | pm_runtime_disable(dev); |
299 | 465 | ||
@@ -364,7 +530,7 @@ static const struct hc_driver ehci_omap_hc_driver = { | |||
364 | * root hub support | 530 | * root hub support |
365 | */ | 531 | */ |
366 | .hub_status_data = ehci_hub_status_data, | 532 | .hub_status_data = ehci_hub_status_data, |
367 | .hub_control = ehci_hub_control, | 533 | .hub_control = omap_ehci_hub_control, |
368 | .bus_suspend = ehci_bus_suspend, | 534 | .bus_suspend = ehci_bus_suspend, |
369 | .bus_resume = ehci_bus_resume, | 535 | .bus_resume = ehci_bus_resume, |
370 | 536 | ||
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index bc94d7bf072d..123481793a47 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -144,14 +144,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
144 | hcd->has_tt = 1; | 144 | hcd->has_tt = 1; |
145 | tdi_reset(ehci); | 145 | tdi_reset(ehci); |
146 | } | 146 | } |
147 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) { | ||
148 | /* EHCI #1 or #2 on 6 Series/C200 Series chipset */ | ||
149 | if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) { | ||
150 | ehci_info(ehci, "broken D3 during system sleep on ASUS\n"); | ||
151 | hcd->broken_pci_sleep = 1; | ||
152 | device_set_wakeup_capable(&pdev->dev, false); | ||
153 | } | ||
154 | } | ||
155 | break; | 147 | break; |
156 | case PCI_VENDOR_ID_TDI: | 148 | case PCI_VENDOR_ID_TDI: |
157 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { | 149 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { |
diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c index ca819cdd0c5e..e7cb3925abf8 100644 --- a/drivers/usb/host/ehci-sh.c +++ b/drivers/usb/host/ehci-sh.c | |||
@@ -126,8 +126,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) | |||
126 | goto fail_create_hcd; | 126 | goto fail_create_hcd; |
127 | } | 127 | } |
128 | 128 | ||
129 | if (pdev->dev.platform_data != NULL) | 129 | pdata = pdev->dev.platform_data; |
130 | pdata = pdev->dev.platform_data; | ||
131 | 130 | ||
132 | /* initialize hcd */ | 131 | /* initialize hcd */ |
133 | hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev, | 132 | hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev, |
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index 9c2cc4633894..e9713d589e30 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c | |||
@@ -270,14 +270,12 @@ static int ehci_hcd_xilinx_of_remove(struct platform_device *op) | |||
270 | * | 270 | * |
271 | * Properly shutdown the hcd, call driver's shutdown routine. | 271 | * Properly shutdown the hcd, call driver's shutdown routine. |
272 | */ | 272 | */ |
273 | static int ehci_hcd_xilinx_of_shutdown(struct platform_device *op) | 273 | static void ehci_hcd_xilinx_of_shutdown(struct platform_device *op) |
274 | { | 274 | { |
275 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); | 275 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); |
276 | 276 | ||
277 | if (hcd->driver->shutdown) | 277 | if (hcd->driver->shutdown) |
278 | hcd->driver->shutdown(hcd); | 278 | hcd->driver->shutdown(hcd); |
279 | |||
280 | return 0; | ||
281 | } | 279 | } |
282 | 280 | ||
283 | 281 | ||
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 836772dfabd3..2f3619eefefa 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -317,7 +317,7 @@ static int ohci_bus_resume (struct usb_hcd *hcd) | |||
317 | } | 317 | } |
318 | 318 | ||
319 | /* Carry out the final steps of resuming the controller device */ | 319 | /* Carry out the final steps of resuming the controller device */ |
320 | static void ohci_finish_controller_resume(struct usb_hcd *hcd) | 320 | static void __maybe_unused ohci_finish_controller_resume(struct usb_hcd *hcd) |
321 | { | 321 | { |
322 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | 322 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
323 | int port; | 323 | int port; |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index ec4338eec826..77689bd64cac 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -793,10 +793,9 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci, | |||
793 | struct xhci_virt_device *virt_dev, | 793 | struct xhci_virt_device *virt_dev, |
794 | int slot_id) | 794 | int slot_id) |
795 | { | 795 | { |
796 | struct list_head *tt; | ||
797 | struct list_head *tt_list_head; | 796 | struct list_head *tt_list_head; |
798 | struct list_head *tt_next; | 797 | struct xhci_tt_bw_info *tt_info, *next; |
799 | struct xhci_tt_bw_info *tt_info; | 798 | bool slot_found = false; |
800 | 799 | ||
801 | /* If the device never made it past the Set Address stage, | 800 | /* If the device never made it past the Set Address stage, |
802 | * it may not have the real_port set correctly. | 801 | * it may not have the real_port set correctly. |
@@ -808,34 +807,16 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci, | |||
808 | } | 807 | } |
809 | 808 | ||
810 | tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts); | 809 | tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts); |
811 | if (list_empty(tt_list_head)) | 810 | list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) { |
812 | return; | 811 | /* Multi-TT hubs will have more than one entry */ |
813 | 812 | if (tt_info->slot_id == slot_id) { | |
814 | list_for_each(tt, tt_list_head) { | 813 | slot_found = true; |
815 | tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list); | 814 | list_del(&tt_info->tt_list); |
816 | if (tt_info->slot_id == slot_id) | 815 | kfree(tt_info); |
816 | } else if (slot_found) { | ||
817 | break; | 817 | break; |
818 | } | ||
818 | } | 819 | } |
819 | /* Cautionary measure in case the hub was disconnected before we | ||
820 | * stored the TT information. | ||
821 | */ | ||
822 | if (tt_info->slot_id != slot_id) | ||
823 | return; | ||
824 | |||
825 | tt_next = tt->next; | ||
826 | tt_info = list_entry(tt, struct xhci_tt_bw_info, | ||
827 | tt_list); | ||
828 | /* Multi-TT hubs will have more than one entry */ | ||
829 | do { | ||
830 | list_del(tt); | ||
831 | kfree(tt_info); | ||
832 | tt = tt_next; | ||
833 | if (list_empty(tt_list_head)) | ||
834 | break; | ||
835 | tt_next = tt->next; | ||
836 | tt_info = list_entry(tt, struct xhci_tt_bw_info, | ||
837 | tt_list); | ||
838 | } while (tt_info->slot_id == slot_id); | ||
839 | } | 820 | } |
840 | 821 | ||
841 | int xhci_alloc_tt_info(struct xhci_hcd *xhci, | 822 | int xhci_alloc_tt_info(struct xhci_hcd *xhci, |
@@ -1791,17 +1772,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1791 | { | 1772 | { |
1792 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); | 1773 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); |
1793 | struct dev_info *dev_info, *next; | 1774 | struct dev_info *dev_info, *next; |
1794 | struct list_head *tt_list_head; | ||
1795 | struct list_head *tt; | ||
1796 | struct list_head *endpoints; | ||
1797 | struct list_head *ep, *q; | ||
1798 | struct xhci_tt_bw_info *tt_info; | ||
1799 | struct xhci_interval_bw_table *bwt; | ||
1800 | struct xhci_virt_ep *virt_ep; | ||
1801 | |||
1802 | unsigned long flags; | 1775 | unsigned long flags; |
1803 | int size; | 1776 | int size; |
1804 | int i; | 1777 | int i, j, num_ports; |
1805 | 1778 | ||
1806 | /* Free the Event Ring Segment Table and the actual Event Ring */ | 1779 | /* Free the Event Ring Segment Table and the actual Event Ring */ |
1807 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); | 1780 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); |
@@ -1860,21 +1833,22 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1860 | } | 1833 | } |
1861 | spin_unlock_irqrestore(&xhci->lock, flags); | 1834 | spin_unlock_irqrestore(&xhci->lock, flags); |
1862 | 1835 | ||
1863 | bwt = &xhci->rh_bw->bw_table; | 1836 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
1864 | for (i = 0; i < XHCI_MAX_INTERVAL; i++) { | 1837 | for (i = 0; i < num_ports; i++) { |
1865 | endpoints = &bwt->interval_bw[i].endpoints; | 1838 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; |
1866 | list_for_each_safe(ep, q, endpoints) { | 1839 | for (j = 0; j < XHCI_MAX_INTERVAL; j++) { |
1867 | virt_ep = list_entry(ep, struct xhci_virt_ep, bw_endpoint_list); | 1840 | struct list_head *ep = &bwt->interval_bw[j].endpoints; |
1868 | list_del(&virt_ep->bw_endpoint_list); | 1841 | while (!list_empty(ep)) |
1869 | kfree(virt_ep); | 1842 | list_del_init(ep->next); |
1870 | } | 1843 | } |
1871 | } | 1844 | } |
1872 | 1845 | ||
1873 | tt_list_head = &xhci->rh_bw->tts; | 1846 | for (i = 0; i < num_ports; i++) { |
1874 | list_for_each_safe(tt, q, tt_list_head) { | 1847 | struct xhci_tt_bw_info *tt, *n; |
1875 | tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list); | 1848 | list_for_each_entry_safe(tt, n, &xhci->rh_bw[i].tts, tt_list) { |
1876 | list_del(tt); | 1849 | list_del(&tt->tt_list); |
1877 | kfree(tt_info); | 1850 | kfree(tt); |
1851 | } | ||
1878 | } | 1852 | } |
1879 | 1853 | ||
1880 | xhci->num_usb2_ports = 0; | 1854 | xhci->num_usb2_ports = 0; |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index afdc73ee84a6..a979cd0dbe0f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -795,8 +795,8 @@ int xhci_suspend(struct xhci_hcd *xhci) | |||
795 | command = xhci_readl(xhci, &xhci->op_regs->command); | 795 | command = xhci_readl(xhci, &xhci->op_regs->command); |
796 | command |= CMD_CSS; | 796 | command |= CMD_CSS; |
797 | xhci_writel(xhci, command, &xhci->op_regs->command); | 797 | xhci_writel(xhci, command, &xhci->op_regs->command); |
798 | if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10*100)) { | 798 | if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10 * 1000)) { |
799 | xhci_warn(xhci, "WARN: xHC CMD_CSS timeout\n"); | 799 | xhci_warn(xhci, "WARN: xHC save state timeout\n"); |
800 | spin_unlock_irq(&xhci->lock); | 800 | spin_unlock_irq(&xhci->lock); |
801 | return -ETIMEDOUT; | 801 | return -ETIMEDOUT; |
802 | } | 802 | } |
@@ -848,8 +848,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
848 | command |= CMD_CRS; | 848 | command |= CMD_CRS; |
849 | xhci_writel(xhci, command, &xhci->op_regs->command); | 849 | xhci_writel(xhci, command, &xhci->op_regs->command); |
850 | if (handshake(xhci, &xhci->op_regs->status, | 850 | if (handshake(xhci, &xhci->op_regs->status, |
851 | STS_RESTORE, 0, 10*100)) { | 851 | STS_RESTORE, 0, 10 * 1000)) { |
852 | xhci_dbg(xhci, "WARN: xHC CMD_CSS timeout\n"); | 852 | xhci_warn(xhci, "WARN: xHC restore state timeout\n"); |
853 | spin_unlock_irq(&xhci->lock); | 853 | spin_unlock_irq(&xhci->lock); |
854 | return -ETIMEDOUT; | 854 | return -ETIMEDOUT; |
855 | } | 855 | } |
@@ -3906,7 +3906,7 @@ static u16 xhci_get_timeout_no_hub_lpm(struct usb_device *udev, | |||
3906 | default: | 3906 | default: |
3907 | dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n", | 3907 | dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n", |
3908 | __func__); | 3908 | __func__); |
3909 | return -EINVAL; | 3909 | return USB3_LPM_DISABLED; |
3910 | } | 3910 | } |
3911 | 3911 | ||
3912 | if (sel <= max_sel_pel && pel <= max_sel_pel) | 3912 | if (sel <= max_sel_pel && pel <= max_sel_pel) |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 768b4b55c816..9d63ba4d10d6 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | 35 | ||
36 | #include <mach/cputype.h> | 36 | #include <mach/cputype.h> |
37 | #include <mach/hardware.h> | ||
37 | 38 | ||
38 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
39 | 40 | ||
diff --git a/drivers/usb/musb/davinci.h b/drivers/usb/musb/davinci.h index 046c84433cad..371baa0ee509 100644 --- a/drivers/usb/musb/davinci.h +++ b/drivers/usb/musb/davinci.h | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | /* Integrated highspeed/otg PHY */ | 17 | /* Integrated highspeed/otg PHY */ |
18 | #define USBPHY_CTL_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x34) | 18 | #define USBPHY_CTL_PADDR 0x01c40034 |
19 | #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */ | 19 | #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */ |
20 | #define USBPHY_PHYCLKGD BIT(8) | 20 | #define USBPHY_PHYCLKGD BIT(8) |
21 | #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */ | 21 | #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */ |
@@ -27,7 +27,7 @@ | |||
27 | #define USBPHY_OTGPDWN BIT(1) | 27 | #define USBPHY_OTGPDWN BIT(1) |
28 | #define USBPHY_PHYPDWN BIT(0) | 28 | #define USBPHY_PHYPDWN BIT(0) |
29 | 29 | ||
30 | #define DM355_DEEPSLEEP_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x48) | 30 | #define DM355_DEEPSLEEP_PADDR 0x01c40048 |
31 | #define DRVVBUS_FORCE BIT(2) | 31 | #define DRVVBUS_FORCE BIT(2) |
32 | #define DRVVBUS_OVERRIDE BIT(1) | 32 | #define DRVVBUS_OVERRIDE BIT(1) |
33 | 33 | ||
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index f42c29b11f71..95918dacc99a 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1232,6 +1232,7 @@ static int musb_gadget_disable(struct usb_ep *ep) | |||
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | musb_ep->desc = NULL; | 1234 | musb_ep->desc = NULL; |
1235 | musb_ep->end_point.desc = NULL; | ||
1235 | 1236 | ||
1236 | /* abort all pending DMA and requests */ | 1237 | /* abort all pending DMA and requests */ |
1237 | nuke(musb_ep, -ESHUTDOWN); | 1238 | nuke(musb_ep, -ESHUTDOWN); |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 1b1926200ba7..73d25cd8cba5 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -82,6 +82,7 @@ static const struct usb_device_id id_table[] = { | |||
82 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ | 82 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ |
83 | { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */ | 83 | { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */ |
84 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ | 84 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ |
85 | { USB_DEVICE(0x10C4, 0x80C4) }, /* Cygnal Integrated Products, Inc., Optris infrared thermometer */ | ||
85 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 86 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
86 | { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */ | 87 | { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */ |
87 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ | 88 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 8c084ea34e26..bc912e5a3beb 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -737,6 +737,7 @@ static struct usb_device_id id_table_combined [] = { | |||
737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | 738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, |
739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, | 739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, |
740 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) }, | ||
740 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 741 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
741 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 742 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
742 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 743 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index f3c7c78ede33..5661c7e2d415 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -784,6 +784,7 @@ | |||
784 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | 784 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ |
785 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | 785 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ |
786 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ | 786 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ |
787 | #define RTSYSTEMS_RTS01_PID 0x9e57 /* USB-RTS01 Radio Cable */ | ||
787 | 788 | ||
788 | 789 | ||
789 | /* | 790 | /* |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 105a6d898ca4..9b026bf7afef 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -39,13 +39,6 @@ MODULE_PARM_DESC(product, "User specified USB idProduct"); | |||
39 | 39 | ||
40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ | 40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ |
41 | 41 | ||
42 | /* we want to look at all devices, as the vendor/product id can change | ||
43 | * depending on the command line argument */ | ||
44 | static const struct usb_device_id generic_serial_ids[] = { | ||
45 | {.driver_info = 42}, | ||
46 | {} | ||
47 | }; | ||
48 | |||
49 | /* All of the device info needed for the Generic Serial Converter */ | 42 | /* All of the device info needed for the Generic Serial Converter */ |
50 | struct usb_serial_driver usb_serial_generic_device = { | 43 | struct usb_serial_driver usb_serial_generic_device = { |
51 | .driver = { | 44 | .driver = { |
@@ -79,7 +72,8 @@ int usb_serial_generic_register(int _debug) | |||
79 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; | 72 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; |
80 | 73 | ||
81 | /* register our generic driver with ourselves */ | 74 | /* register our generic driver with ourselves */ |
82 | retval = usb_serial_register_drivers(serial_drivers, "usbserial_generic", generic_serial_ids); | 75 | retval = usb_serial_register_drivers(serial_drivers, |
76 | "usbserial_generic", generic_device_ids); | ||
83 | #endif | 77 | #endif |
84 | return retval; | 78 | return retval; |
85 | } | 79 | } |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index d0ec1aa52719..a71fa0aa0406 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -309,13 +309,16 @@ static int mct_u232_set_modem_ctrl(struct usb_serial *serial, | |||
309 | MCT_U232_SET_REQUEST_TYPE, | 309 | MCT_U232_SET_REQUEST_TYPE, |
310 | 0, 0, buf, MCT_U232_SET_MODEM_CTRL_SIZE, | 310 | 0, 0, buf, MCT_U232_SET_MODEM_CTRL_SIZE, |
311 | WDR_TIMEOUT); | 311 | WDR_TIMEOUT); |
312 | if (rc < 0) | 312 | kfree(buf); |
313 | dev_err(&serial->dev->dev, | 313 | |
314 | "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); | ||
315 | dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr); | 314 | dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr); |
316 | 315 | ||
317 | kfree(buf); | 316 | if (rc < 0) { |
318 | return rc; | 317 | dev_err(&serial->dev->dev, |
318 | "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); | ||
319 | return rc; | ||
320 | } | ||
321 | return 0; | ||
319 | } /* mct_u232_set_modem_ctrl */ | 322 | } /* mct_u232_set_modem_ctrl */ |
320 | 323 | ||
321 | static int mct_u232_get_modem_stat(struct usb_serial *serial, | 324 | static int mct_u232_get_modem_stat(struct usb_serial *serial, |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 29160f8b5101..57eca2448424 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -190,7 +190,7 @@ | |||
190 | 190 | ||
191 | static int device_type; | 191 | static int device_type; |
192 | 192 | ||
193 | static const struct usb_device_id id_table[] __devinitconst = { | 193 | static const struct usb_device_id id_table[] = { |
194 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, | 194 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, |
195 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 195 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
196 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, | 196 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 1aae9028cd0b..e668a2460bd4 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -47,6 +47,7 @@ | |||
47 | /* Function prototypes */ | 47 | /* Function prototypes */ |
48 | static int option_probe(struct usb_serial *serial, | 48 | static int option_probe(struct usb_serial *serial, |
49 | const struct usb_device_id *id); | 49 | const struct usb_device_id *id); |
50 | static void option_release(struct usb_serial *serial); | ||
50 | static int option_send_setup(struct usb_serial_port *port); | 51 | static int option_send_setup(struct usb_serial_port *port); |
51 | static void option_instat_callback(struct urb *urb); | 52 | static void option_instat_callback(struct urb *urb); |
52 | 53 | ||
@@ -150,6 +151,7 @@ static void option_instat_callback(struct urb *urb); | |||
150 | #define HUAWEI_PRODUCT_E14AC 0x14AC | 151 | #define HUAWEI_PRODUCT_E14AC 0x14AC |
151 | #define HUAWEI_PRODUCT_K3806 0x14AE | 152 | #define HUAWEI_PRODUCT_K3806 0x14AE |
152 | #define HUAWEI_PRODUCT_K4605 0x14C6 | 153 | #define HUAWEI_PRODUCT_K4605 0x14C6 |
154 | #define HUAWEI_PRODUCT_K5005 0x14C8 | ||
153 | #define HUAWEI_PRODUCT_K3770 0x14C9 | 155 | #define HUAWEI_PRODUCT_K3770 0x14C9 |
154 | #define HUAWEI_PRODUCT_K3771 0x14CA | 156 | #define HUAWEI_PRODUCT_K3771 0x14CA |
155 | #define HUAWEI_PRODUCT_K4510 0x14CB | 157 | #define HUAWEI_PRODUCT_K4510 0x14CB |
@@ -425,7 +427,7 @@ static void option_instat_callback(struct urb *urb); | |||
425 | #define SAMSUNG_VENDOR_ID 0x04e8 | 427 | #define SAMSUNG_VENDOR_ID 0x04e8 |
426 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 | 428 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 |
427 | 429 | ||
428 | /* YUGA products www.yuga-info.com*/ | 430 | /* YUGA products www.yuga-info.com gavin.kx@qq.com */ |
429 | #define YUGA_VENDOR_ID 0x257A | 431 | #define YUGA_VENDOR_ID 0x257A |
430 | #define YUGA_PRODUCT_CEM600 0x1601 | 432 | #define YUGA_PRODUCT_CEM600 0x1601 |
431 | #define YUGA_PRODUCT_CEM610 0x1602 | 433 | #define YUGA_PRODUCT_CEM610 0x1602 |
@@ -442,6 +444,8 @@ static void option_instat_callback(struct urb *urb); | |||
442 | #define YUGA_PRODUCT_CEU516 0x160C | 444 | #define YUGA_PRODUCT_CEU516 0x160C |
443 | #define YUGA_PRODUCT_CEU528 0x160D | 445 | #define YUGA_PRODUCT_CEU528 0x160D |
444 | #define YUGA_PRODUCT_CEU526 0x160F | 446 | #define YUGA_PRODUCT_CEU526 0x160F |
447 | #define YUGA_PRODUCT_CEU881 0x161F | ||
448 | #define YUGA_PRODUCT_CEU882 0x162F | ||
445 | 449 | ||
446 | #define YUGA_PRODUCT_CWM600 0x2601 | 450 | #define YUGA_PRODUCT_CWM600 0x2601 |
447 | #define YUGA_PRODUCT_CWM610 0x2602 | 451 | #define YUGA_PRODUCT_CWM610 0x2602 |
@@ -457,23 +461,26 @@ static void option_instat_callback(struct urb *urb); | |||
457 | #define YUGA_PRODUCT_CWU518 0x260B | 461 | #define YUGA_PRODUCT_CWU518 0x260B |
458 | #define YUGA_PRODUCT_CWU516 0x260C | 462 | #define YUGA_PRODUCT_CWU516 0x260C |
459 | #define YUGA_PRODUCT_CWU528 0x260D | 463 | #define YUGA_PRODUCT_CWU528 0x260D |
464 | #define YUGA_PRODUCT_CWU581 0x260E | ||
460 | #define YUGA_PRODUCT_CWU526 0x260F | 465 | #define YUGA_PRODUCT_CWU526 0x260F |
461 | 466 | #define YUGA_PRODUCT_CWU582 0x261F | |
462 | #define YUGA_PRODUCT_CLM600 0x2601 | 467 | #define YUGA_PRODUCT_CWU583 0x262F |
463 | #define YUGA_PRODUCT_CLM610 0x2602 | 468 | |
464 | #define YUGA_PRODUCT_CLM500 0x2603 | 469 | #define YUGA_PRODUCT_CLM600 0x3601 |
465 | #define YUGA_PRODUCT_CLM510 0x2604 | 470 | #define YUGA_PRODUCT_CLM610 0x3602 |
466 | #define YUGA_PRODUCT_CLM800 0x2605 | 471 | #define YUGA_PRODUCT_CLM500 0x3603 |
467 | #define YUGA_PRODUCT_CLM900 0x2606 | 472 | #define YUGA_PRODUCT_CLM510 0x3604 |
468 | 473 | #define YUGA_PRODUCT_CLM800 0x3605 | |
469 | #define YUGA_PRODUCT_CLU718 0x2607 | 474 | #define YUGA_PRODUCT_CLM900 0x3606 |
470 | #define YUGA_PRODUCT_CLU716 0x2608 | 475 | |
471 | #define YUGA_PRODUCT_CLU728 0x2609 | 476 | #define YUGA_PRODUCT_CLU718 0x3607 |
472 | #define YUGA_PRODUCT_CLU726 0x260A | 477 | #define YUGA_PRODUCT_CLU716 0x3608 |
473 | #define YUGA_PRODUCT_CLU518 0x260B | 478 | #define YUGA_PRODUCT_CLU728 0x3609 |
474 | #define YUGA_PRODUCT_CLU516 0x260C | 479 | #define YUGA_PRODUCT_CLU726 0x360A |
475 | #define YUGA_PRODUCT_CLU528 0x260D | 480 | #define YUGA_PRODUCT_CLU518 0x360B |
476 | #define YUGA_PRODUCT_CLU526 0x260F | 481 | #define YUGA_PRODUCT_CLU516 0x360C |
482 | #define YUGA_PRODUCT_CLU528 0x360D | ||
483 | #define YUGA_PRODUCT_CLU526 0x360F | ||
477 | 484 | ||
478 | /* Viettel products */ | 485 | /* Viettel products */ |
479 | #define VIETTEL_VENDOR_ID 0x2262 | 486 | #define VIETTEL_VENDOR_ID 0x2262 |
@@ -666,6 +673,11 @@ static const struct usb_device_id option_ids[] = { | |||
666 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, | 673 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, |
667 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), | 674 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), |
668 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 675 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
676 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x31) }, | ||
677 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x32) }, | ||
678 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x31) }, | ||
679 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x32) }, | ||
680 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x33) }, | ||
669 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) }, | 681 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) }, |
670 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) }, | 682 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) }, |
671 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) }, | 683 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) }, |
@@ -1209,6 +1221,11 @@ static const struct usb_device_id option_ids[] = { | |||
1209 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) }, | 1221 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) }, |
1210 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, | 1222 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, |
1211 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, | 1223 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, |
1224 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU881) }, | ||
1225 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU882) }, | ||
1226 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU581) }, | ||
1227 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU582) }, | ||
1228 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU583) }, | ||
1212 | { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, | 1229 | { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, |
1213 | { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, | 1230 | { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, |
1214 | { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */ | 1231 | { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */ |
@@ -1245,7 +1262,7 @@ static struct usb_serial_driver option_1port_device = { | |||
1245 | .ioctl = usb_wwan_ioctl, | 1262 | .ioctl = usb_wwan_ioctl, |
1246 | .attach = usb_wwan_startup, | 1263 | .attach = usb_wwan_startup, |
1247 | .disconnect = usb_wwan_disconnect, | 1264 | .disconnect = usb_wwan_disconnect, |
1248 | .release = usb_wwan_release, | 1265 | .release = option_release, |
1249 | .read_int_callback = option_instat_callback, | 1266 | .read_int_callback = option_instat_callback, |
1250 | #ifdef CONFIG_PM | 1267 | #ifdef CONFIG_PM |
1251 | .suspend = usb_wwan_suspend, | 1268 | .suspend = usb_wwan_suspend, |
@@ -1259,35 +1276,6 @@ static struct usb_serial_driver * const serial_drivers[] = { | |||
1259 | 1276 | ||
1260 | static bool debug; | 1277 | static bool debug; |
1261 | 1278 | ||
1262 | /* per port private data */ | ||
1263 | |||
1264 | #define N_IN_URB 4 | ||
1265 | #define N_OUT_URB 4 | ||
1266 | #define IN_BUFLEN 4096 | ||
1267 | #define OUT_BUFLEN 4096 | ||
1268 | |||
1269 | struct option_port_private { | ||
1270 | /* Input endpoints and buffer for this port */ | ||
1271 | struct urb *in_urbs[N_IN_URB]; | ||
1272 | u8 *in_buffer[N_IN_URB]; | ||
1273 | /* Output endpoints and buffer for this port */ | ||
1274 | struct urb *out_urbs[N_OUT_URB]; | ||
1275 | u8 *out_buffer[N_OUT_URB]; | ||
1276 | unsigned long out_busy; /* Bit vector of URBs in use */ | ||
1277 | int opened; | ||
1278 | struct usb_anchor delayed; | ||
1279 | |||
1280 | /* Settings for the port */ | ||
1281 | int rts_state; /* Handshaking pins (outputs) */ | ||
1282 | int dtr_state; | ||
1283 | int cts_state; /* Handshaking pins (inputs) */ | ||
1284 | int dsr_state; | ||
1285 | int dcd_state; | ||
1286 | int ri_state; | ||
1287 | |||
1288 | unsigned long tx_start_time[N_OUT_URB]; | ||
1289 | }; | ||
1290 | |||
1291 | module_usb_serial_driver(serial_drivers, option_ids); | 1279 | module_usb_serial_driver(serial_drivers, option_ids); |
1292 | 1280 | ||
1293 | static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, | 1281 | static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, |
@@ -1356,12 +1344,22 @@ static int option_probe(struct usb_serial *serial, | |||
1356 | return 0; | 1344 | return 0; |
1357 | } | 1345 | } |
1358 | 1346 | ||
1347 | static void option_release(struct usb_serial *serial) | ||
1348 | { | ||
1349 | struct usb_wwan_intf_private *priv = usb_get_serial_data(serial); | ||
1350 | |||
1351 | usb_wwan_release(serial); | ||
1352 | |||
1353 | kfree(priv); | ||
1354 | } | ||
1355 | |||
1359 | static void option_instat_callback(struct urb *urb) | 1356 | static void option_instat_callback(struct urb *urb) |
1360 | { | 1357 | { |
1361 | int err; | 1358 | int err; |
1362 | int status = urb->status; | 1359 | int status = urb->status; |
1363 | struct usb_serial_port *port = urb->context; | 1360 | struct usb_serial_port *port = urb->context; |
1364 | struct option_port_private *portdata = usb_get_serial_port_data(port); | 1361 | struct usb_wwan_port_private *portdata = |
1362 | usb_get_serial_port_data(port); | ||
1365 | 1363 | ||
1366 | dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); | 1364 | dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); |
1367 | 1365 | ||
@@ -1421,7 +1419,7 @@ static int option_send_setup(struct usb_serial_port *port) | |||
1421 | struct usb_serial *serial = port->serial; | 1419 | struct usb_serial *serial = port->serial; |
1422 | struct usb_wwan_intf_private *intfdata = | 1420 | struct usb_wwan_intf_private *intfdata = |
1423 | (struct usb_wwan_intf_private *) serial->private; | 1421 | (struct usb_wwan_intf_private *) serial->private; |
1424 | struct option_port_private *portdata; | 1422 | struct usb_wwan_port_private *portdata; |
1425 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; | 1423 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; |
1426 | int val = 0; | 1424 | int val = 0; |
1427 | 1425 | ||
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 0d5fe59ebb9e..996015c5f1ac 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -105,7 +105,13 @@ static const struct usb_device_id id_table[] = { | |||
105 | {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */ | 105 | {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */ |
106 | {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */ | 106 | {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */ |
107 | {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ | 107 | {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ |
108 | {USB_DEVICE(0x1199, 0x9010)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
109 | {USB_DEVICE(0x1199, 0x9012)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
108 | {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ | 110 | {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ |
111 | {USB_DEVICE(0x1199, 0x9014)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
112 | {USB_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ | ||
113 | {USB_DEVICE(0x1199, 0x9018)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
114 | {USB_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ | ||
109 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ | 115 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ |
110 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ | 116 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ |
111 | { } /* Terminating entry */ | 117 | { } /* Terminating entry */ |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ba54a0a8235c..d423d36acc04 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -294,6 +294,10 @@ static const struct usb_device_id id_table[] = { | |||
294 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ | 294 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ |
295 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | 295 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
296 | }, | 296 | }, |
297 | /* AT&T Direct IP LTE modems */ | ||
298 | { USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF), | ||
299 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | ||
300 | }, | ||
297 | { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ | 301 | { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ |
298 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | 302 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
299 | }, | 303 | }, |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 6a1b609a0d94..27483f91a4a3 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -659,12 +659,14 @@ exit: | |||
659 | static struct usb_serial_driver *search_serial_device( | 659 | static struct usb_serial_driver *search_serial_device( |
660 | struct usb_interface *iface) | 660 | struct usb_interface *iface) |
661 | { | 661 | { |
662 | const struct usb_device_id *id; | 662 | const struct usb_device_id *id = NULL; |
663 | struct usb_serial_driver *drv; | 663 | struct usb_serial_driver *drv; |
664 | struct usb_driver *driver = to_usb_driver(iface->dev.driver); | ||
664 | 665 | ||
665 | /* Check if the usb id matches a known device */ | 666 | /* Check if the usb id matches a known device */ |
666 | list_for_each_entry(drv, &usb_serial_driver_list, driver_list) { | 667 | list_for_each_entry(drv, &usb_serial_driver_list, driver_list) { |
667 | id = get_iface_id(drv, iface); | 668 | if (drv->usb_driver == driver) |
669 | id = get_iface_id(drv, iface); | ||
668 | if (id) | 670 | if (id) |
669 | return drv; | 671 | return drv; |
670 | } | 672 | } |
@@ -755,7 +757,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
755 | 757 | ||
756 | if (retval) { | 758 | if (retval) { |
757 | dbg("sub driver rejected device"); | 759 | dbg("sub driver rejected device"); |
758 | kfree(serial); | 760 | usb_serial_put(serial); |
759 | module_put(type->driver.owner); | 761 | module_put(type->driver.owner); |
760 | return retval; | 762 | return retval; |
761 | } | 763 | } |
@@ -827,7 +829,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
827 | */ | 829 | */ |
828 | if (num_bulk_in == 0 || num_bulk_out == 0) { | 830 | if (num_bulk_in == 0 || num_bulk_out == 0) { |
829 | dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); | 831 | dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); |
830 | kfree(serial); | 832 | usb_serial_put(serial); |
831 | module_put(type->driver.owner); | 833 | module_put(type->driver.owner); |
832 | return -ENODEV; | 834 | return -ENODEV; |
833 | } | 835 | } |
@@ -841,7 +843,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
841 | if (num_ports == 0) { | 843 | if (num_ports == 0) { |
842 | dev_err(&interface->dev, | 844 | dev_err(&interface->dev, |
843 | "Generic device with no bulk out, not allowed.\n"); | 845 | "Generic device with no bulk out, not allowed.\n"); |
844 | kfree(serial); | 846 | usb_serial_put(serial); |
845 | module_put(type->driver.owner); | 847 | module_put(type->driver.owner); |
846 | return -EIO; | 848 | return -EIO; |
847 | } | 849 | } |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 1719886bb9be..caf22bf5f822 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -1107,6 +1107,13 @@ UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999, | |||
1107 | USB_SC_RBC, USB_PR_BULK, NULL, | 1107 | USB_SC_RBC, USB_PR_BULK, NULL, |
1108 | 0 ), | 1108 | 0 ), |
1109 | 1109 | ||
1110 | /* Feiya QDI U2 DISK, reported by Hans de Goede <hdegoede@redhat.com> */ | ||
1111 | UNUSUAL_DEV( 0x090c, 0x1000, 0x0000, 0xffff, | ||
1112 | "Feiya", | ||
1113 | "QDI U2 DISK", | ||
1114 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
1115 | US_FL_NO_READ_CAPACITY_16 ), | ||
1116 | |||
1110 | /* aeb */ | 1117 | /* aeb */ |
1111 | UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, | 1118 | UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, |
1112 | "Feiya", | 1119 | "Feiya", |