diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-13 18:03:48 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-13 18:03:48 -0400 |
| commit | ad8395e149e86ca3a76b6ae300c0d0a92b7f7e17 (patch) | |
| tree | 4179afaeb0bd079467fb614fe9ad66f50aa17f9a | |
| parent | cad9d5664a74702d3df7a1bf4ab1221428c3ff87 (diff) | |
| parent | 27b351c5546008c640b3e65152f60ca74b3706f1 (diff) | |
Merge tag 'usb-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg Kroah-Hartman:
"Here are a number of tiny USB fixes and new USB device ids for your
3.9 tree.
The "largest" one here is a revert of a usb-storage patch that turned
out to be incorrect, breaking existing users, which is never a good
thing. Everything else is pretty simple and small"
* tag 'usb-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (43 commits)
USB: quatech2: only write to the tty if the port is open.
qcserial: bind to DM/DIAG port on Gobi 1K devices
USB: cdc-wdm: fix buffer overflow
usb: serial: Add Rigblaster Advantage to device table
qcaux: add Franklin U600
usb: musb: core: fix possible build error with randconfig
usb: cp210x new Vendor/Device IDs
usb: gadget: pxa25x: fix disconnect reporting
usb: dwc3: ep0: fix sparc64 build
usb: c67x00 RetryCnt value in c67x00 TD should be 3
usb: Correction to c67x00 TD data length mask
usb: Makefile: fix drivers/usb/phy/ Makefile entry
USB: added support for Cinterion's products AH6 and PLS8
usb: gadget: fix omap_udc build errors
USB: storage: fix Huawei mode switching regression
USB: storage: in-kernel modeswitching is deprecated
tools: usb: ffs-test: Fix build failure
USB: option: add Huawei E5331
usb: musb: omap2430: fix sparse warning
usb: musb: omap2430: fix omap_musb_mailbox glue check again
...
38 files changed, 531 insertions, 218 deletions
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index f5ed3d75fa5a..8f5ebced5df0 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile | |||
| @@ -46,7 +46,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/ | |||
| 46 | obj-$(CONFIG_USB_SERIAL) += serial/ | 46 | obj-$(CONFIG_USB_SERIAL) += serial/ |
| 47 | 47 | ||
| 48 | obj-$(CONFIG_USB) += misc/ | 48 | obj-$(CONFIG_USB) += misc/ |
| 49 | obj-$(CONFIG_USB_COMMON) += phy/ | 49 | obj-$(CONFIG_USB_OTG_UTILS) += phy/ |
| 50 | obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/ | 50 | obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/ |
| 51 | 51 | ||
| 52 | obj-$(CONFIG_USB_ATM) += atm/ | 52 | obj-$(CONFIG_USB_ATM) += atm/ |
diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c index a03fbc15fa9c..aa491627a45b 100644 --- a/drivers/usb/c67x00/c67x00-sched.c +++ b/drivers/usb/c67x00/c67x00-sched.c | |||
| @@ -100,7 +100,7 @@ struct c67x00_urb_priv { | |||
| 100 | #define TD_PIDEP_OFFSET 0x04 | 100 | #define TD_PIDEP_OFFSET 0x04 |
| 101 | #define TD_PIDEPMASK_PID 0xF0 | 101 | #define TD_PIDEPMASK_PID 0xF0 |
| 102 | #define TD_PIDEPMASK_EP 0x0F | 102 | #define TD_PIDEPMASK_EP 0x0F |
| 103 | #define TD_PORTLENMASK_DL 0x02FF | 103 | #define TD_PORTLENMASK_DL 0x03FF |
| 104 | #define TD_PORTLENMASK_PN 0xC000 | 104 | #define TD_PORTLENMASK_PN 0xC000 |
| 105 | 105 | ||
| 106 | #define TD_STATUS_OFFSET 0x07 | 106 | #define TD_STATUS_OFFSET 0x07 |
| @@ -590,7 +590,7 @@ static int c67x00_create_td(struct c67x00_hcd *c67x00, struct urb *urb, | |||
| 590 | { | 590 | { |
| 591 | struct c67x00_td *td; | 591 | struct c67x00_td *td; |
| 592 | struct c67x00_urb_priv *urbp = urb->hcpriv; | 592 | struct c67x00_urb_priv *urbp = urb->hcpriv; |
| 593 | const __u8 active_flag = 1, retry_cnt = 1; | 593 | const __u8 active_flag = 1, retry_cnt = 3; |
| 594 | __u8 cmd = 0; | 594 | __u8 cmd = 0; |
| 595 | int tt = 0; | 595 | int tt = 0; |
| 596 | 596 | ||
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 2f45bba8561d..f64fbea1cf20 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
| @@ -1767,7 +1767,7 @@ static int udc_start(struct ci13xxx *ci) | |||
| 1767 | goto put_transceiver; | 1767 | goto put_transceiver; |
| 1768 | } | 1768 | } |
| 1769 | 1769 | ||
| 1770 | retval = dbg_create_files(&ci->gadget.dev); | 1770 | retval = dbg_create_files(ci->dev); |
| 1771 | if (retval) | 1771 | if (retval) |
| 1772 | goto unreg_device; | 1772 | goto unreg_device; |
| 1773 | 1773 | ||
| @@ -1796,7 +1796,7 @@ remove_trans: | |||
| 1796 | 1796 | ||
| 1797 | dev_err(dev, "error = %i\n", retval); | 1797 | dev_err(dev, "error = %i\n", retval); |
| 1798 | remove_dbg: | 1798 | remove_dbg: |
| 1799 | dbg_remove_files(&ci->gadget.dev); | 1799 | dbg_remove_files(ci->dev); |
| 1800 | unreg_device: | 1800 | unreg_device: |
| 1801 | device_unregister(&ci->gadget.dev); | 1801 | device_unregister(&ci->gadget.dev); |
| 1802 | put_transceiver: | 1802 | put_transceiver: |
| @@ -1836,7 +1836,7 @@ static void udc_stop(struct ci13xxx *ci) | |||
| 1836 | if (ci->global_phy) | 1836 | if (ci->global_phy) |
| 1837 | usb_put_phy(ci->transceiver); | 1837 | usb_put_phy(ci->transceiver); |
| 1838 | } | 1838 | } |
| 1839 | dbg_remove_files(&ci->gadget.dev); | 1839 | dbg_remove_files(ci->dev); |
| 1840 | device_unregister(&ci->gadget.dev); | 1840 | device_unregister(&ci->gadget.dev); |
| 1841 | /* my kobject is dynamic, I swear! */ | 1841 | /* my kobject is dynamic, I swear! */ |
| 1842 | memset(&ci->gadget, 0, sizeof(ci->gadget)); | 1842 | memset(&ci->gadget, 0, sizeof(ci->gadget)); |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 5f0cb417b736..122d056d96d5 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
| @@ -56,6 +56,7 @@ MODULE_DEVICE_TABLE (usb, wdm_ids); | |||
| 56 | #define WDM_RESPONDING 7 | 56 | #define WDM_RESPONDING 7 |
| 57 | #define WDM_SUSPENDING 8 | 57 | #define WDM_SUSPENDING 8 |
| 58 | #define WDM_RESETTING 9 | 58 | #define WDM_RESETTING 9 |
| 59 | #define WDM_OVERFLOW 10 | ||
| 59 | 60 | ||
| 60 | #define WDM_MAX 16 | 61 | #define WDM_MAX 16 |
| 61 | 62 | ||
| @@ -155,6 +156,7 @@ static void wdm_in_callback(struct urb *urb) | |||
| 155 | { | 156 | { |
| 156 | struct wdm_device *desc = urb->context; | 157 | struct wdm_device *desc = urb->context; |
| 157 | int status = urb->status; | 158 | int status = urb->status; |
| 159 | int length = urb->actual_length; | ||
| 158 | 160 | ||
| 159 | spin_lock(&desc->iuspin); | 161 | spin_lock(&desc->iuspin); |
| 160 | clear_bit(WDM_RESPONDING, &desc->flags); | 162 | clear_bit(WDM_RESPONDING, &desc->flags); |
| @@ -185,9 +187,17 @@ static void wdm_in_callback(struct urb *urb) | |||
| 185 | } | 187 | } |
| 186 | 188 | ||
| 187 | desc->rerr = status; | 189 | desc->rerr = status; |
| 188 | desc->reslength = urb->actual_length; | 190 | if (length + desc->length > desc->wMaxCommand) { |
| 189 | memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength); | 191 | /* The buffer would overflow */ |
| 190 | desc->length += desc->reslength; | 192 | set_bit(WDM_OVERFLOW, &desc->flags); |
| 193 | } else { | ||
| 194 | /* we may already be in overflow */ | ||
| 195 | if (!test_bit(WDM_OVERFLOW, &desc->flags)) { | ||
| 196 | memmove(desc->ubuf + desc->length, desc->inbuf, length); | ||
| 197 | desc->length += length; | ||
| 198 | desc->reslength = length; | ||
| 199 | } | ||
| 200 | } | ||
| 191 | skip_error: | 201 | skip_error: |
| 192 | wake_up(&desc->wait); | 202 | wake_up(&desc->wait); |
| 193 | 203 | ||
| @@ -435,6 +445,11 @@ retry: | |||
| 435 | rv = -ENODEV; | 445 | rv = -ENODEV; |
| 436 | goto err; | 446 | goto err; |
| 437 | } | 447 | } |
| 448 | if (test_bit(WDM_OVERFLOW, &desc->flags)) { | ||
| 449 | clear_bit(WDM_OVERFLOW, &desc->flags); | ||
| 450 | rv = -ENOBUFS; | ||
| 451 | goto err; | ||
