aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-08 17:27:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-08 17:27:48 -0400
commit4c1f683a4a343808536a5617ede85dfc34430472 (patch)
treee20afa21e13892338bcfb39ebfaf7277f5734c7d
parent365a13a582e6a80c639c54dc2a83b03b9ff0169a (diff)
parentd6d0f665ad869c8ad8b8a42c4393e02dfe227e12 (diff)
Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (28 commits) MAINTAINERS: add a maintainer to Gadget Framework USB: serial: add another 4N-GALAXY.DE PID to ftdi_sio driver Revert "USB: option: add ID for ZTE MF 330" drivers/usb/host/ohci-pxa27x.c: add missing clk_put USB: CONFIG_USB_GADGET_DUALSPEED is not user-configurable USB: dummy-hcd needs the has_tt flag usb-storage: redo incorrect reads usb/renesas_usbhs: free uep on removal usb/s3c-hsudc: fix error path usb/pxa25x_udc: cleanup the LUBBOCK err path usb/mv_udc_core: fix compile usb: gadget: include <linux/prefetch.h> to fix compiling error USB: s3c-hsotg: Tone down debugging usb: remove bad dput after dentry_unhash USB: core: Tolerate protocol stall during hub and port status read musb: fix prefetch build failure USB: cdc-acm: Adding second ACM channel support for Nokia E7 and C7 usb-gadget: unlock data->lock mutex on error path in ep_write() USB: option Add blacklist for ZTE K3765-Z (19d2:2002) option: add Prolink PH300 modem IDs ...
-rw-r--r--Documentation/kernel-parameters.txt2
-rw-r--r--MAINTAINERS4
-rw-r--r--drivers/usb/class/cdc-acm.c2
-rw-r--r--drivers/usb/core/hub.c6
-rw-r--r--drivers/usb/gadget/Kconfig5
-rw-r--r--drivers/usb/gadget/amd5536udc.c1
-rw-r--r--drivers/usb/gadget/at91_udc.c1
-rw-r--r--drivers/usb/gadget/dummy_hcd.c1
-rw-r--r--drivers/usb/gadget/inode.c4
-rw-r--r--drivers/usb/gadget/mv_udc_core.c8
-rw-r--r--drivers/usb/gadget/net2280.c1
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c5
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c22
-rw-r--r--drivers/usb/gadget/s3c-hsudc.c7
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c1
-rw-r--r--drivers/usb/host/ohci-pxa27x.c7
-rw-r--r--drivers/usb/host/xhci-dbg.c8
-rw-r--r--drivers/usb/host/xhci-mem.c14
-rw-r--r--drivers/usb/host/xhci-pci.c14
-rw-r--r--drivers/usb/host/xhci-ring.c2
-rw-r--r--drivers/usb/host/xhci.c18
-rw-r--r--drivers/usb/host/xhci.h6
-rw-r--r--drivers/usb/musb/musb_core.c1
-rw-r--r--drivers/usb/renesas_usbhs/mod_gadget.c1
-rw-r--r--drivers/usb/serial/ftdi_sio.c1
-rw-r--r--drivers/usb/serial/ftdi_sio_ids.h1
-rw-r--r--drivers/usb/serial/option.c34
-rw-r--r--drivers/usb/storage/transport.c29
-rw-r--r--drivers/usb/storage/unusual_devs.h19
-rw-r--r--drivers/usb/storage/usb.c13
-rw-r--r--drivers/usb/storage/usb.h2
-rw-r--r--include/linux/usb_usual.h4
32 files changed, 194 insertions, 50 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index d9a203b058f1..fd248a318211 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2598,6 +2598,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2598 unlock ejectable media); 2598 unlock ejectable media);
2599 m = MAX_SECTORS_64 (don't transfer more 2599 m = MAX_SECTORS_64 (don't transfer more
2600 than 64 sectors = 32 KB at a time); 2600 than 64 sectors = 32 KB at a time);
2601 n = INITIAL_READ10 (force a retry of the
2602 initial READ(10) command);
2601 o = CAPACITY_OK (accept the capacity 2603 o = CAPACITY_OK (accept the capacity
2602 reported by the device); 2604 reported by the device);
2603 r = IGNORE_RESIDUE (the device reports 2605 r = IGNORE_RESIDUE (the device reports
diff --git a/MAINTAINERS b/MAINTAINERS
index fb0294919adc..b5ea4d033730 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6444,9 +6444,11 @@ S: Maintained
6444F: drivers/media/video/et61x251/ 6444F: drivers/media/video/et61x251/
6445 6445
6446USB GADGET/PERIPHERAL SUBSYSTEM 6446USB GADGET/PERIPHERAL SUBSYSTEM
6447M: Felipe Balbi <balbi@ti.com>
6447L: linux-usb@vger.kernel.org 6448L: linux-usb@vger.kernel.org
6448W: http://www.linux-usb.org/gadget 6449W: http://www.linux-usb.org/gadget
6449S: Orphan 6450T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
6451S: Maintained
6450F: drivers/usb/gadget/ 6452F: drivers/usb/gadget/
6451F: include/linux/usb/gadget* 6453F: include/linux/usb/gadget*
6452 6454
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 395a347f2ebb..dac7676ce21b 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1530,6 +1530,8 @@ static const struct usb_device_id acm_ids[] = {
1530 { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */ 1530 { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */
1531 { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */ 1531 { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */
1532 { NOKIA_PCSUITE_ACM_INFO(0x0302), }, /* Nokia N8 */ 1532 { NOKIA_PCSUITE_ACM_INFO(0x0302), }, /* Nokia N8 */
1533 { NOKIA_PCSUITE_ACM_INFO(0x0335), }, /* Nokia E7 */
1534 { NOKIA_PCSUITE_ACM_INFO(0x03cd), }, /* Nokia C7 */
1533 { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */ 1535 { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */
1534 1536
1535 /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ 1537 /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 79a58c3a2e2a..90ae1753dda1 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -339,7 +339,8 @@ static int get_hub_status(struct usb_device *hdev,
339{ 339{
340 int i, status = -ETIMEDOUT; 340 int i, status = -ETIMEDOUT;
341 341
342 for (i = 0; i < USB_STS_RETRIES && status == -ETIMEDOUT; i++) { 342 for (i = 0; i < USB_STS_RETRIES &&
343 (status == -ETIMEDOUT || status == -EPIPE); i++) {
343 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), 344 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
344 USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_HUB, 0, 0, 345 USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_HUB, 0, 0,
345 data, sizeof(*data), USB_STS_TIMEOUT); 346 data, sizeof(*data), USB_STS_TIMEOUT);
@@ -355,7 +356,8 @@ static int get_port_status(struct usb_device *hdev, int port1,
355{ 356{
356 int i, status = -ETIMEDOUT; 357 int i, status = -ETIMEDOUT;
357 358
358 for (i = 0; i < USB_STS_RETRIES && status == -ETIMEDOUT; i++) { 359 for (i = 0; i < USB_STS_RETRIES &&
360 (status == -ETIMEDOUT || status == -EPIPE); i++) {
359 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), 361 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
360 USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port1, 362 USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port1,
361 data, sizeof(*data), USB_STS_TIMEOUT); 363 data, sizeof(*data), USB_STS_TIMEOUT);
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 58456d1aec21..029e288805b6 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -632,13 +632,10 @@ config USB_DUMMY_HCD
632 632
633endchoice 633endchoice
634 634
635# Selected by UDC drivers that support high-speed operation.
635config USB_GADGET_DUALSPEED 636config USB_GADGET_DUALSPEED
636 bool 637 bool
637 depends on USB_GADGET 638 depends on USB_GADGET
638 default n
639 help
640 Means that gadget drivers should include extra descriptors
641 and code to handle dual-speed controllers.
642 639
643# 640#
644# USB Gadget Drivers 641# USB Gadget Drivers
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 6e42aab75806..95e8138cd48f 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -60,6 +60,7 @@
60#include <linux/device.h> 60#include <linux/device.h>
61#include <linux/io.h> 61#include <linux/io.h>
62#include <linux/irq.h> 62#include <linux/irq.h>
63#include <linux/prefetch.h>
63 64
64#include <asm/byteorder.h> 65#include <asm/byteorder.h>
65#include <asm/system.h> 66#include <asm/system.h>
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 41dc093c0a1b..f4690ffcb489 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -38,6 +38,7 @@
38#include <linux/clk.h> 38#include <linux/clk.h>
39#include <linux/usb/ch9.h> 39#include <linux/usb/ch9.h>
40#include <linux/usb/gadget.h> 40#include <linux/usb/gadget.h>
41#include <linux/prefetch.h>
41 42
42#include <asm/byteorder.h> 43#include <asm/byteorder.h>
43#include <mach/hardware.h> 44#include <mach/hardware.h>
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 61ff927928ab..d3dcabc1a5fc 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1906,6 +1906,7 @@ static int dummy_hcd_probe(struct platform_device *pdev)
1906 if (!hcd) 1906 if (!hcd)
1907 return -ENOMEM; 1907 return -ENOMEM;
1908 the_controller = hcd_to_dummy (hcd); 1908 the_controller = hcd_to_dummy (hcd);
1909 hcd->has_tt = 1;
1909 1910
1910 retval = usb_add_hcd(hcd, 0, 0); 1911 retval = usb_add_hcd(hcd, 0, 0);
1911 if (retval != 0) { 1912 if (retval != 0) {
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index a01383f71f38..a56876aaf76c 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -431,8 +431,10 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
431 431
432 /* halt any endpoint by doing a "wrong direction" i/o call */ 432 /* halt any endpoint by doing a "wrong direction" i/o call */
433 if (!usb_endpoint_dir_in(&data->desc)) { 433 if (!usb_endpoint_dir_in(&data->desc)) {
434 if (usb_endpoint_xfer_isoc(&data->desc)) 434 if (usb_endpoint_xfer_isoc(&data->desc)) {
435 mutex_unlock(&data->lock);
435 return -EINVAL; 436 return -EINVAL;
437 }
436 DBG (data->dev, "%s halt\n", data->name); 438 DBG (data->dev, "%s halt\n", data->name);
437 spin_lock_irq (&data->dev->lock); 439 spin_lock_irq (&data->dev->lock);
438 if (likely (data->ep != NULL)) 440 if (likely (data->ep != NULL))
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index b62b2640deb0..b1a8146b9d50 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -2083,7 +2083,7 @@ out:
2083} 2083}
2084 2084
2085#ifdef CONFIG_PM 2085#ifdef CONFIG_PM
2086static int mv_udc_suspend(struct platform_device *_dev, pm_message_t state) 2086static int mv_udc_suspend(struct device *_dev)
2087{ 2087{
2088 struct mv_udc *udc = the_controller; 2088 struct mv_udc *udc = the_controller;
2089 2089
@@ -2092,7 +2092,7 @@ static int mv_udc_suspend(struct platform_device *_dev, pm_message_t state)
2092 return 0; 2092 return 0;
2093} 2093}
2094 2094
2095static int mv_udc_resume(struct platform_device *_dev) 2095static int mv_udc_resume(struct device *_dev)
2096{ 2096{
2097 struct mv_udc *udc = the_controller; 2097 struct mv_udc *udc = the_controller;
2098 int retval; 2098 int retval;
@@ -2100,7 +2100,7 @@ static int mv_udc_resume(struct platform_device *_dev)
2100 retval = mv_udc_phy_init(udc->phy_regs); 2100 retval = mv_udc_phy_init(udc->phy_regs);
2101 if (retval) { 2101 if (retval) {
2102 dev_err(_dev, "phy initialization error %d\n", retval); 2102 dev_err(_dev, "phy initialization error %d\n", retval);
2103 goto error; 2103 return retval;
2104 } 2104 }
2105 udc_reset(udc); 2105 udc_reset(udc);
2106 ep0_reset(udc); 2106 ep0_reset(udc);
@@ -2122,7 +2122,7 @@ static struct platform_driver udc_driver = {
2122 .owner = THIS_MODULE, 2122 .owner = THIS_MODULE,
2123 .name = "pxa-u2o", 2123 .name = "pxa-u2o",
2124#ifdef CONFIG_PM 2124#ifdef CONFIG_PM
2125 .pm = mv_udc_pm_ops, 2125 .pm = &mv_udc_pm_ops,
2126#endif 2126#endif
2127 }, 2127 },
2128}; 2128};
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 24696f7fa6a9..476d88e1ae97 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -63,6 +63,7 @@
63#include <linux/device.h> 63#include <linux/device.h>
64#include <linux/usb/ch9.h> 64#include <linux/usb/ch9.h>
65#include <linux/usb/gadget.h> 65#include <linux/usb/gadget.h>
66#include <linux/prefetch.h>
66 67
67#include <asm/byteorder.h> 68#include <asm/byteorder.h>
68#include <asm/io.h> 69#include <asm/io.h>
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 365c02fc25fc..774545494cf2 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -2216,7 +2216,6 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
2216 if (retval != 0) { 2216 if (retval != 0) {
2217 pr_err("%s: can't get irq %i, err %d\n", 2217 pr_err("%s: can't get irq %i, err %d\n",
2218 driver_name, LUBBOCK_USB_DISC_IRQ, retval); 2218 driver_name, LUBBOCK_USB_DISC_IRQ, retval);
2219lubbock_fail0:
2220 goto err_irq_lub; 2219 goto err_irq_lub;
2221 } 2220 }
2222 retval = request_irq(LUBBOCK_USB_IRQ, 2221 retval = request_irq(LUBBOCK_USB_IRQ,
@@ -2226,7 +2225,6 @@ lubbock_fail0:
2226 if (retval != 0) { 2225 if (retval != 0) {
2227 pr_err("%s: can't get irq %i, err %d\n", 2226 pr_err("%s: can't get irq %i, err %d\n",
2228 driver_name, LUBBOCK_USB_IRQ, retval); 2227 driver_name, LUBBOCK_USB_IRQ, retval);
2229 free_irq(LUBBOCK_USB_DISC_IRQ, dev);
2230 goto lubbock_fail0; 2228 goto lubbock_fail0;
2231 } 2229 }
2232 } else 2230 } else
@@ -2236,10 +2234,11 @@ lubbock_fail0:
2236 return 0; 2234 return 0;
2237 2235
2238#ifdef CONFIG_ARCH_LUBBOCK 2236#ifdef CONFIG_ARCH_LUBBOCK
2237lubbock_fail0:
2239 free_irq(LUBBOCK_USB_DISC_IRQ, dev); 2238 free_irq(LUBBOCK_USB_DISC_IRQ, dev);
2240 err_irq_lub: 2239 err_irq_lub:
2241#endif
2242 free_irq(irq, dev); 2240 free_irq(irq, dev);
2241#endif
2243 err_irq1: 2242 err_irq1:
2244 if (gpio_is_valid(dev->mach->gpio_pullup)) 2243 if (gpio_is_valid(dev->mach->gpio_pullup))
2245 gpio_free(dev->mach->gpio_pullup); 2244 gpio_free(dev->mach->gpio_pullup);
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index acb9cc418df9..0dfee282878a 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2680,9 +2680,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
2680 2680
2681 writel(0, hsotg->regs + S3C_DAINTMSK); 2681 writel(0, hsotg->regs + S3C_DAINTMSK);
2682 2682
2683 dev_info(hsotg->dev, "EP0: DIEPCTL0=0x%08x, DOEPCTL0=0x%08x\n", 2683 dev_dbg(hsotg->dev, "EP0: DIEPCTL0=0x%08x, DOEPCTL0=0x%08x\n",
2684 readl(hsotg->regs + S3C_DIEPCTL0), 2684 readl(hsotg->regs + S3C_DIEPCTL0),
2685 readl(hsotg->regs + S3C_DOEPCTL0)); 2685 readl(hsotg->regs + S3C_DOEPCTL0));
2686 2686
2687 /* enable in and out endpoint interrupts */ 2687 /* enable in and out endpoint interrupts */
2688 s3c_hsotg_en_gsint(hsotg, S3C_GINTSTS_OEPInt | S3C_GINTSTS_IEPInt); 2688 s3c_hsotg_en_gsint(hsotg, S3C_GINTSTS_OEPInt | S3C_GINTSTS_IEPInt);
@@ -2701,7 +2701,7 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
2701 udelay(10); /* see openiboot */ 2701 udelay(10); /* see openiboot */
2702 __bic32(hsotg->regs + S3C_DCTL, S3C_DCTL_PWROnPrgDone); 2702 __bic32(hsotg->regs + S3C_DCTL, S3C_DCTL_PWROnPrgDone);
2703 2703
2704 dev_info(hsotg->dev, "DCTL=0x%08x\n", readl(hsotg->regs + S3C_DCTL)); 2704 dev_dbg(hsotg->dev, "DCTL=0x%08x\n", readl(hsotg->regs + S3C_DCTL));
2705 2705
2706 /* S3C_DxEPCTL_USBActEp says RO in manual, but seems to be set by 2706 /* S3C_DxEPCTL_USBActEp says RO in manual, but seems to be set by
2707 writing to the EPCTL register.. */ 2707 writing to the EPCTL register.. */
@@ -2721,9 +2721,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
2721 2721
2722 s3c_hsotg_enqueue_setup(hsotg); 2722 s3c_hsotg_enqueue_setup(hsotg);
2723 2723
2724 dev_info(hsotg->dev, "EP0: DIEPCTL0=0x%08x, DOEPCTL0=0x%08x\n", 2724 dev_dbg(hsotg->dev, "EP0: DIEPCTL0=0x%08x, DOEPCTL0=0x%08x\n",
2725 readl(hsotg->regs + S3C_DIEPCTL0), 2725 readl(hsotg->regs + S3C_DIEPCTL0),
2726 readl(hsotg->regs + S3C_DOEPCTL0)); 2726 readl(hsotg->regs + S3C_DOEPCTL0));
2727 2727
2728 /* clear global NAKs */ 2728 /* clear global NAKs */
2729 writel(S3C_DCTL_CGOUTNak | S3C_DCTL_CGNPInNAK, 2729 writel(S3C_DCTL_CGOUTNak | S3C_DCTL_CGNPInNAK,
@@ -2921,9 +2921,9 @@ static void s3c_hsotg_init(struct s3c_hsotg *hsotg)
2921 2921
2922 /* setup fifos */ 2922 /* setup fifos */
2923 2923
2924 dev_info(hsotg->dev, "GRXFSIZ=0x%08x, GNPTXFSIZ=0x%08x\n", 2924 dev_dbg(hsotg->dev, "GRXFSIZ=0x%08x, GNPTXFSIZ=0x%08x\n",
2925 readl(hsotg->regs + S3C_GRXFSIZ), 2925 readl(hsotg->regs + S3C_GRXFSIZ),
2926 readl(hsotg->regs + S3C_GNPTXFSIZ)); 2926 readl(hsotg->regs + S3C_GNPTXFSIZ));
2927 2927
2928 s3c_hsotg_init_fifo(hsotg); 2928 s3c_hsotg_init_fifo(hsotg);
2929 2929
@@ -2945,6 +2945,7 @@ static void s3c_hsotg_init(struct s3c_hsotg *hsotg)
2945 2945
2946static void s3c_hsotg_dump(struct s3c_hsotg *hsotg) 2946static void s3c_hsotg_dump(struct s3c_hsotg *hsotg)
2947{ 2947{
2948#ifdef DEBUG
2948 struct device *dev = hsotg->dev; 2949 struct device *dev = hsotg->dev;
2949 void __iomem *regs = hsotg->regs; 2950 void __iomem *regs = hsotg->regs;
2950 u32 val; 2951 u32 val;
@@ -2987,6 +2988,7 @@ static void s3c_hsotg_dump(struct s3c_hsotg *hsotg)
2987 2988
2988 dev_info(dev, "DVBUSDIS=0x%08x, DVBUSPULSE=%08x\n", 2989 dev_info(dev, "DVBUSDIS=0x%08x, DVBUSPULSE=%08x\n",
2989 readl(regs + S3C_DVBUSDIS), readl(regs + S3C_DVBUSPULSE)); 2990 readl(regs + S3C_DVBUSDIS), readl(regs + S3C_DVBUSPULSE));
2991#endif
2990} 2992}
2991 2993
2992 2994
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index cfe3cf56d6bd..d5e3e1e58626 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -26,6 +26,7 @@
26#include <linux/clk.h> 26#include <linux/clk.h>
27#include <linux/usb/ch9.h> 27#include <linux/usb/ch9.h>
28#include <linux/usb/gadget.h> 28#include <linux/usb/gadget.h>
29#include <linux/prefetch.h>
29 30
30#include <mach/regs-s3c2443-clock.h> 31#include <mach/regs-s3c2443-clock.h>
31#include <plat/udc.h> 32#include <plat/udc.h>
@@ -1301,7 +1302,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
1301 hsudc->uclk = clk_get(&pdev->dev, "usb-device"); 1302 hsudc->uclk = clk_get(&pdev->dev, "usb-device");
1302 if (IS_ERR(hsudc->uclk)) { 1303 if (IS_ERR(hsudc->uclk)) {
1303 dev_err(dev, "failed to find usb-device clock source\n"); 1304 dev_err(dev, "failed to find usb-device clock source\n");
1304 return PTR_ERR(hsudc->uclk); 1305 ret = PTR_ERR(hsudc->uclk);
1306 goto err_clk;
1305 } 1307 }
1306 clk_enable(hsudc->uclk); 1308 clk_enable(hsudc->uclk);
1307 1309
@@ -1310,7 +1312,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
1310 disable_irq(hsudc->irq); 1312 disable_irq(hsudc->irq);
1311 local_irq_enable(); 1313 local_irq_enable();
1312 return 0; 1314 return 0;
1313 1315err_clk:
1316 free_irq(hsudc->irq, hsudc);
1314err_irq: 1317err_irq:
1315 iounmap(hsudc->regs); 1318 iounmap(hsudc->regs);
1316 1319
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index 6d8b04061d5d..100f2635cf0a 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -36,6 +36,7 @@
36#include <linux/platform_device.h> 36#include <linux/platform_device.h>
37#include <linux/clk.h> 37#include <linux/clk.h>
38#include <linux/gpio.h> 38#include <linux/gpio.h>
39#include <linux/prefetch.h>
39 40
40#include <linux/debugfs.h> 41#include <linux/debugfs.h>
41#include <linux/seq_file.h> 42#include <linux/seq_file.h>
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index afef7b0a4195..80be5472783a 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -312,8 +312,10 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
312 return PTR_ERR(usb_clk); 312 return PTR_ERR(usb_clk);
313 313
314 hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x"); 314 hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x");
315 if (!hcd) 315 if (!hcd) {
316 return -ENOMEM; 316 retval = -ENOMEM;
317 goto err0;
318 }
317 319
318 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 320 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
319 if (!r) { 321 if (!r) {
@@ -368,6 +370,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
368 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 370 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
369 err1: 371 err1:
370 usb_put_hcd(hcd); 372 usb_put_hcd(hcd);
373 err0:
371 clk_put(usb_clk); 374 clk_put(usb_clk);
372 return retval; 375 return retval;
373} 376}
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index 2e0486178dbe..1f50b4468e87 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -438,13 +438,13 @@ char *xhci_get_slot_state(struct xhci_hcd *xhci,
438 struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx); 438 struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
439 439
440 switch (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state))) { 440 switch (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state))) {
441 case 0: 441 case SLOT_STATE_ENABLED:
442 return "enabled/disabled"; 442 return "enabled/disabled";
443 case 1: 443 case SLOT_STATE_DEFAULT:
444 return "default"; 444 return "default";
445 case 2: 445 case SLOT_STATE_ADDRESSED:
446 return "addressed"; 446 return "addressed";
447 case 3: 447 case SLOT_STATE_CONFIGURED:
448 return "configured"; 448 return "configured";
449 default: 449 default:
450 return "reserved"; 450 return "reserved";
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 26caba4c1950..0f8e1d29a858 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -985,9 +985,19 @@ static unsigned int xhci_parse_exponent_interval(struct usb_device *udev,
985 interval = clamp_val(ep->desc.bInterval, 1, 16) - 1; 985 interval = clamp_val(ep->desc.bInterval, 1, 16) - 1;
986 if (interval != ep->desc.bInterval - 1) 986 if (interval != ep->desc.bInterval - 1)
987 dev_warn(&udev->dev, 987 dev_warn(&udev->dev,
988 "ep %#x - rounding interval to %d microframes\n", 988 "ep %#x - rounding interval to %d %sframes\n",
989 ep->desc.bEndpointAddress, 989 ep->desc.bEndpointAddress,
990 1 << interval); 990 1 << interval,
991 udev->speed == USB_SPEED_FULL ? "" : "micro");
992
993 if (udev->speed == USB_SPEED_FULL) {
994 /*
995 * Full speed isoc endpoints specify interval in frames,
996 * not microframes. We are using microframes everywhere,
997 * so adjust accordingly.
998 */
999 interval += 3; /* 1 frame = 2^3 uframes */
1000 }
991 1001
992 return interval; 1002 return interval;
993} 1003}
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index c408e9f6a707..17541d09eabb 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -106,12 +106,22 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
106 106
107 /* Look for vendor-specific quirks */ 107 /* Look for vendor-specific quirks */
108 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && 108 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
109 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK && 109 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) {
110 pdev->revision == 0x0) { 110 if (pdev->revision == 0x0) {
111 xhci->quirks |= XHCI_RESET_EP_QUIRK; 111 xhci->quirks |= XHCI_RESET_EP_QUIRK;
112 xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure" 112 xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure"
113 " endpoint cmd after reset endpoint\n"); 113 " endpoint cmd after reset endpoint\n");
114 }
115 /* Fresco Logic confirms: all revisions of this chip do not
116 * support MSI, even though some of them claim to in their PCI
117 * capabilities.
118 */
119 xhci->quirks |= XHCI_BROKEN_MSI;
120 xhci_dbg(xhci, "QUIRK: Fresco Logic revision %u "
121 "has broken MSI implementation\n",
122 pdev->revision);
114 } 123 }
124
115 if (pdev->vendor == PCI_VENDOR_ID_NEC) 125 if (pdev->vendor == PCI_VENDOR_ID_NEC)
116 xhci->quirks |= XHCI_NEC_HOST; 126 xhci->quirks |= XHCI_NEC_HOST;
117 127
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index cc1485bfed38..800f417c7309 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1782,7 +1782,7 @@ static int skip_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
1782 struct usb_iso_packet_descriptor *frame; 1782 struct usb_iso_packet_descriptor *frame;
1783 int idx; 1783 int idx;
1784 1784
1785 ep_ring = xhci_dma_to_transfer_ring(ep, event->buffer); 1785 ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer));
1786 urb_priv = td->urb->hcpriv; 1786 urb_priv = td->urb->hcpriv;
1787 idx = urb_priv->td_cnt; 1787 idx = urb_priv->td_cnt;
1788 frame = &td->urb->iso_frame_desc[idx]; 1788 frame = &td->urb->iso_frame_desc[idx];
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index d9660eb97eb9..06e7023258d0 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -430,12 +430,19 @@ int xhci_run(struct usb_hcd *hcd)
430 free_irq(hcd->irq, hcd); 430 free_irq(hcd->irq, hcd);
431 hcd->irq = -1; 431 hcd->irq = -1;
432 432
433 /* Some Fresco Logic host controllers advertise MSI, but fail to
434 * generate interrupts. Don't even try to enable MSI.
435 */
436 if (xhci->quirks & XHCI_BROKEN_MSI)
437 goto legacy_irq;
438
433 ret = xhci_setup_msix(xhci); 439 ret = xhci_setup_msix(xhci);
434 if (ret) 440 if (ret)
435 /* fall back to msi*/ 441 /* fall back to msi*/
436 ret = xhci_setup_msi(xhci); 442 ret = xhci_setup_msi(xhci);
437 443
438 if (ret) { 444 if (ret) {
445legacy_irq:
439 /* fall back to legacy interrupt*/ 446 /* fall back to legacy interrupt*/
440 ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, 447 ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
441 hcd->irq_descr, hcd); 448 hcd->irq_descr, hcd);
@@ -1849,8 +1856,8 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
1849 1856
1850 /* Free any rings that were dropped, but not changed. */ 1857 /* Free any rings that were dropped, but not changed. */
1851 for (i = 1; i < 31; ++i) { 1858 for (i = 1; i < 31; ++i) {
1852 if ((ctrl_ctx->drop_flags & (1 << (i + 1))) && 1859 if ((le32_to_cpu(ctrl_ctx->drop_flags) & (1 << (i + 1))) &&
1853 !(ctrl_ctx->add_flags & (1 << (i + 1)))) 1860 !(le32_to_cpu(ctrl_ctx->add_flags) & (1 << (i + 1))))
1854 xhci_free_or_cache_endpoint_ring(xhci, virt_dev, i); 1861 xhci_free_or_cache_endpoint_ring(xhci, virt_dev, i);
1855 } 1862 }
1856 xhci_zero_in_ctx(xhci, virt_dev); 1863 xhci_zero_in_ctx(xhci, virt_dev);
@@ -2467,6 +2474,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev)
2467 struct xhci_command *reset_device_cmd; 2474 struct xhci_command *reset_device_cmd;
2468 int timeleft; 2475 int timeleft;
2469 int last_freed_endpoint; 2476 int last_freed_endpoint;
2477 struct xhci_slot_ctx *slot_ctx;
2470 2478
2471 ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__); 2479 ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__);
2472 if (ret <= 0) 2480 if (ret <= 0)
@@ -2499,6 +2507,12 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev)
2499 return -EINVAL; 2507 return -EINVAL;
2500 } 2508 }
2501 2509
2510 /* If device is not setup, there is no point in resetting it */
2511 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx);
2512 if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) ==
2513 SLOT_STATE_DISABLED)
2514 return 0;
2515
2502 xhci_dbg(xhci, "Resetting device with slot ID %u\n", slot_id); 2516 xhci_dbg(xhci, "Resetting device with slot ID %u\n", slot_id);
2503 /* Allocate the command structure that holds the struct completion. 2517 /* Allocate the command structure that holds the struct completion.
2504 * Assume we're in process context, since the normal device reset 2518 * Assume we're in process context, since the normal device reset
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index ac0196e7fcf1..7d1ea3bf5e1f 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -560,6 +560,11 @@ struct xhci_slot_ctx {
560#define SLOT_STATE (0x1f << 27) 560#define SLOT_STATE (0x1f << 27)
561#define GET_SLOT_STATE(p) (((p) & (0x1f << 27)) >> 27) 561#define GET_SLOT_STATE(p) (((p) & (0x1f << 27)) >> 27)
562 562
563#define SLOT_STATE_DISABLED 0
564#define SLOT_STATE_ENABLED SLOT_STATE_DISABLED
565#define SLOT_STATE_DEFAULT 1
566#define SLOT_STATE_ADDRESSED 2
567#define SLOT_STATE_CONFIGURED 3
563 568
564/** 569/**
565 * struct xhci_ep_ctx 570 * struct xhci_ep_ctx
@@ -1302,6 +1307,7 @@ struct xhci_hcd {
1302 * commands. 1307 * commands.
1303 */ 1308 */
1304#define XHCI_EP_LIMIT_QUIRK (1 << 5) 1309#define XHCI_EP_LIMIT_QUIRK (1 << 5)
1310#define XHCI_BROKEN_MSI (1 << 6)
1305 unsigned int num_active_eps; 1311 unsigned int num_active_eps;
1306 unsigned int limit_active_eps; 1312 unsigned int limit_active_eps;
1307 /* There are two roothubs to keep track of bus suspend info for */ 1313 /* There are two roothubs to keep track of bus suspend info for */
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index ab8e1001e5e2..c71b0372786e 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -96,6 +96,7 @@
96#include <linux/init.h> 96#include <linux/init.h>
97#include <linux/list.h> 97#include <linux/list.h>
98#include <linux/kobject.h> 98#include <linux/kobject.h>
99#include <linux/prefetch.h>
99#include <linux/platform_device.h> 100#include <linux/platform_device.h>
100#include <linux/io.h> 101#include <linux/io.h>
101 102
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 206cfabc9286..547486ccd059 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -1380,5 +1380,6 @@ void __devexit usbhs_mod_gadget_remove(struct usbhs_priv *priv)
1380{ 1380{
1381 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); 1381 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv);
1382 1382
1383 kfree(gpriv->uep);
1383 kfree(gpriv); 1384 kfree(gpriv);
1384} 1385}
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index e8dbde55f6c5..162728977553 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -647,6 +647,7 @@ static struct usb_device_id id_table_combined [] = {
647 { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) }, 647 { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) },
648 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, 648 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) },
649 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, 649 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) },
650 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_3_PID) },
650 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) }, 651 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) },
651 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) }, 652 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) },
652 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) }, 653 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 1d946cd238ba..ab1fcdf3c378 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -351,6 +351,7 @@
351 */ 351 */
352#define FTDI_4N_GALAXY_DE_1_PID 0xF3C0 352#define FTDI_4N_GALAXY_DE_1_PID 0xF3C0
353#define FTDI_4N_GALAXY_DE_2_PID 0xF3C1 353#define FTDI_4N_GALAXY_DE_2_PID 0xF3C1
354#define FTDI_4N_GALAXY_DE_3_PID 0xF3C2
354 355
355/* 356/*
356 * Linx Technologies product ids 357 * Linx Technologies product ids
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 318dd00040a3..60b25d8ea0e2 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -311,10 +311,6 @@ static void option_instat_callback(struct urb *urb);
311#define ZTE_PRODUCT_AC2726 0xfff5 311#define ZTE_PRODUCT_AC2726 0xfff5
312#define ZTE_PRODUCT_AC8710T 0xffff 312#define ZTE_PRODUCT_AC8710T 0xffff
313 313
314/* ZTE PRODUCTS -- alternate vendor ID */
315#define ZTE_VENDOR_ID2 0x1d6b
316#define ZTE_PRODUCT_MF_330 0x0002
317
318#define BENQ_VENDOR_ID 0x04a5 314#define BENQ_VENDOR_ID 0x04a5
319#define BENQ_PRODUCT_H10 0x4068 315#define BENQ_PRODUCT_H10 0x4068
320 316
@@ -340,11 +336,12 @@ static void option_instat_callback(struct urb *urb);
340#define TOSHIBA_PRODUCT_G450 0x0d45 336#define TOSHIBA_PRODUCT_G450 0x0d45
341 337
342#define ALINK_VENDOR_ID 0x1e0e 338#define ALINK_VENDOR_ID 0x1e0e
339#define ALINK_PRODUCT_PH300 0x9100
343#define ALINK_PRODUCT_3GU 0x9200 340#define ALINK_PRODUCT_3GU 0x9200
344 341
345/* ALCATEL PRODUCTS */ 342/* ALCATEL PRODUCTS */
346#define ALCATEL_VENDOR_ID 0x1bbb 343#define ALCATEL_VENDOR_ID 0x1bbb
347#define ALCATEL_PRODUCT_X060S 0x0000 344#define ALCATEL_PRODUCT_X060S_X200 0x0000
348 345
349#define PIRELLI_VENDOR_ID 0x1266 346#define PIRELLI_VENDOR_ID 0x1266
350#define PIRELLI_PRODUCT_C100_1 0x1002 347#define PIRELLI_PRODUCT_C100_1 0x1002
@@ -379,6 +376,9 @@ static void option_instat_callback(struct urb *urb);
379 * It seems to contain a Qualcomm QSC6240/6290 chipset */ 376 * It seems to contain a Qualcomm QSC6240/6290 chipset */
380#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 377#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
381 378
379/* Zoom */
380#define ZOOM_PRODUCT_4597 0x9607
381
382/* Haier products */ 382/* Haier products */
383#define HAIER_VENDOR_ID 0x201e 383#define HAIER_VENDOR_ID 0x201e
384#define HAIER_PRODUCT_CE100 0x2009 384#define HAIER_PRODUCT_CE100 0x2009
@@ -432,6 +432,20 @@ static const struct option_blacklist_info four_g_w14_blacklist = {
432 .reason = OPTION_BLACKLIST_SENDSETUP 432 .reason = OPTION_BLACKLIST_SENDSETUP
433}; 433};
434 434
435static const u8 alcatel_x200_no_sendsetup[] = { 0, 1 };
436static const struct option_blacklist_info alcatel_x200_blacklist = {
437 .infolen = ARRAY_SIZE(alcatel_x200_no_sendsetup),
438 .ifaceinfo = alcatel_x200_no_sendsetup,
439 .reason = OPTION_BLACKLIST_SENDSETUP
440};
441
442static const u8 zte_k3765_z_no_sendsetup[] = { 0, 1, 2 };
443static const struct option_blacklist_info zte_k3765_z_blacklist = {
444 .infolen = ARRAY_SIZE(zte_k3765_z_no_sendsetup),
445 .ifaceinfo = zte_k3765_z_no_sendsetup,
446 .reason = OPTION_BLACKLIST_SENDSETUP
447};
448
435static const struct usb_device_id option_ids[] = { 449static const struct usb_device_id option_ids[] = {
436 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 450 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
437 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 451 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -916,13 +930,13 @@ static const struct usb_device_id option_ids[] = {
916 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) }, 930 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
917 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) }, 931 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
918 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) }, 932 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
919 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) }, 933 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
934 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
920 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, 935 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
921 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, 936 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
922 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, 937 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
923 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, 938 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
924 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, 939 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) },
925 { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) },
926 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, 940 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
927 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, 941 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
928 { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ 942 { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */
@@ -935,13 +949,17 @@ static const struct usb_device_id option_ids[] = {
935 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, 949 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) },
936 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ 950 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */
937 { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, 951 { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) },
952 { USB_DEVICE(ALINK_VENDOR_ID, ALINK_PRODUCT_PH300) },
938 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, 953 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) },
939 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, 954 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),
955 .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist
956 },
940 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 957 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
941 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 958 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
942 { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), 959 { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
943 .driver_info = (kernel_ulong_t)&four_g_w14_blacklist 960 .driver_info = (kernel_ulong_t)&four_g_w14_blacklist
944 }, 961 },
962 { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
945 { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, 963 { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
946 /* Pirelli */ 964 /* Pirelli */
947 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)}, 965 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)},
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 00418995d8e9..e8ae21b2d387 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -819,6 +819,35 @@ Retry_Sense:
819 } 819 }
820 } 820 }
821 821
822 /*
823 * Some devices don't work or return incorrect data the first
824 * time they get a READ(10) command, or for the first READ(10)
825 * after a media change. If the INITIAL_READ10 flag is set,
826 * keep track of whether READ(10) commands succeed. If the
827 * previous one succeeded and this one failed, set the REDO_READ10
828 * flag to force a retry.
829 */
830 if (unlikely((us->fflags & US_FL_INITIAL_READ10) &&
831 srb->cmnd[0] == READ_10)) {
832 if (srb->result == SAM_STAT_GOOD) {
833 set_bit(US_FLIDX_READ10_WORKED, &us->dflags);
834 } else if (test_bit(US_FLIDX_READ10_WORKED, &us->dflags)) {
835 clear_bit(US_FLIDX_READ10_WORKED, &us->dflags);
836 set_bit(US_FLIDX_REDO_READ10, &us->dflags);
837 }
838
839 /*
840 * Next, if the REDO_READ10 flag is set, return a result
841 * code that will cause the SCSI core to retry the READ(10)
842 * command immediately.
843 */
844 if (test_bit(US_FLIDX_REDO_READ10, &us->dflags)) {
845 clear_bit(US_FLIDX_REDO_READ10, &us->dflags);
846 srb->result = DID_IMM_RETRY << 16;
847 srb->sense_buffer[0] = 0;
848 }
849 }
850
822 /* Did we transfer less than the minimum amount required? */ 851 /* Did we transfer less than the minimum amount required? */
823 if ((srb->result == SAM_STAT_GOOD || srb->sense_buffer[2] == 0) && 852 if ((srb->result == SAM_STAT_GOOD || srb->sense_buffer[2] == 0) &&
824 scsi_bufflen(srb) - scsi_get_resid(srb) < srb->underflow) 853 scsi_bufflen(srb) - scsi_get_resid(srb) < srb->underflow)
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index c1602b8c5594..ccff3483eebc 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1114,6 +1114,16 @@ UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff,
1114 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1114 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1115 US_FL_FIX_CAPACITY ), 1115 US_FL_FIX_CAPACITY ),
1116 1116
1117/* Reported by Paul Hartman <paul.hartman+linux@gmail.com>
1118 * This card reader returns "Illegal Request, Logical Block Address
1119 * Out of Range" for the first READ(10) after a new card is inserted.
1120 */
1121UNUSUAL_DEV( 0x090c, 0x6000, 0x0100, 0x0100,
1122 "Feiya",
1123 "SD/SDHC Card Reader",
1124 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1125 US_FL_INITIAL_READ10 ),
1126
1117/* This Pentax still camera is not conformant 1127/* This Pentax still camera is not conformant
1118 * to the USB storage specification: - 1128 * to the USB storage specification: -
1119 * - It does not like the INQUIRY command. So we must handle this command 1129 * - It does not like the INQUIRY command. So we must handle this command
@@ -1888,6 +1898,15 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200,
1888 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1898 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1889 US_FL_NO_READ_DISC_INFO ), 1899 US_FL_NO_READ_DISC_INFO ),
1890 1900
1901/* Reported by Sven Geggus <sven-usbst@geggus.net>
1902 * This encrypted pen drive returns bogus data for the initial READ(10).
1903 */
1904UNUSUAL_DEV( 0x1b1c, 0x1ab5, 0x0200, 0x0200,
1905 "Corsair",
1906 "Padlock v2",
1907 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1908 US_FL_INITIAL_READ10 ),
1909
1891/* Patch by Richard Schütz <r.schtz@t-online.de> 1910/* Patch by Richard Schütz <r.schtz@t-online.de>
1892 * This external hard drive enclosure uses a JMicron chip which 1911 * This external hard drive enclosure uses a JMicron chip which
1893 * needs the US_FL_IGNORE_RESIDUE flag to work properly. */ 1912 * needs the US_FL_IGNORE_RESIDUE flag to work properly. */
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 5ee7ac42e08f..0ca095820f3e 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -440,7 +440,8 @@ static void adjust_quirks(struct us_data *us)
440 US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 | 440 US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 |
441 US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE | 441 US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE |
442 US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT | 442 US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT |
443 US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16); 443 US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 |
444 US_FL_INITIAL_READ10);
444 445
445 p = quirks; 446 p = quirks;
446 while (*p) { 447 while (*p) {
@@ -490,6 +491,9 @@ static void adjust_quirks(struct us_data *us)
490 case 'm': 491 case 'm':
491 f |= US_FL_MAX_SECTORS_64; 492 f |= US_FL_MAX_SECTORS_64;
492 break; 493 break;
494 case 'n':
495 f |= US_FL_INITIAL_READ10;
496 break;
493 case 'o': 497 case 'o':
494 f |= US_FL_CAPACITY_OK; 498 f |= US_FL_CAPACITY_OK;
495 break; 499 break;
@@ -953,6 +957,13 @@ int usb_stor_probe2(struct us_data *us)
953 if (result) 957 if (result)
954 goto BadDevice; 958 goto BadDevice;
955 959
960 /*
961 * If the device returns invalid data for the first READ(10)
962 * command, indicate the command should be retried.
963 */
964 if (us->fflags & US_FL_INITIAL_READ10)
965 set_bit(US_FLIDX_REDO_READ10, &us->dflags);
966
956 /* Acquire all the other resources and add the host */ 967 /* Acquire all the other resources and add the host */
957 result = usb_stor_acquire_resources(us); 968 result = usb_stor_acquire_resources(us);
958 if (result) 969 if (result)
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 89d3bfff98df..7b0f2113632e 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -73,6 +73,8 @@ struct us_unusual_dev {
73#define US_FLIDX_RESETTING 4 /* device reset in progress */ 73#define US_FLIDX_RESETTING 4 /* device reset in progress */
74#define US_FLIDX_TIMED_OUT 5 /* SCSI midlayer timed out */ 74#define US_FLIDX_TIMED_OUT 5 /* SCSI midlayer timed out */
75#define US_FLIDX_DONT_SCAN 6 /* don't scan (disconnect) */ 75#define US_FLIDX_DONT_SCAN 6 /* don't scan (disconnect) */
76#define US_FLIDX_REDO_READ10 7 /* redo READ(10) command */
77#define US_FLIDX_READ10_WORKED 8 /* previous READ(10) succeeded */
76 78
77#define USB_STOR_STRING_LEN 32 79#define USB_STOR_STRING_LEN 32
78 80
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 71693d4a4fe1..17df3600bcef 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -62,7 +62,9 @@
62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \ 62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
63 /* cannot handle READ_DISC_INFO */ \ 63 /* cannot handle READ_DISC_INFO */ \
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \ 64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 /* cannot handle READ_CAPACITY_16 */ 65 /* cannot handle READ_CAPACITY_16 */ \
66 US_FLAG(INITIAL_READ10, 0x00100000) \
67 /* Initial READ(10) (and others) must be retried */
66 68
67#define US_FLAG(name, value) US_FL_##name = value , 69#define US_FLAG(name, value) US_FL_##name = value ,
68enum { US_DO_ALL_FLAGS }; 70enum { US_DO_ALL_FLAGS };