aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-01-16 14:02:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-16 14:02:44 -0500
commit79600d4bba783147758cdb0e636010fbe02a843f (patch)
tree39d0d7bc074d9ba3d732062e96e3de855c3fd0b9
parentfa818dc4884afb21ba48de773807413bcc0092b8 (diff)
parentf8359dae68bd29ed7b3f91971e361801442c7b9b (diff)
Merge tag 'usb-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here is a bunch of USB fixes for 3.19-rc5. Most of these are gadget driver fixes, along with the xhci driver fix that we both reported having problems with, as well as some new device ids and other tiny fixes. All have been in linux-next with no problems" * tag 'usb-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (43 commits) usb: dwc3: gadget: Stop TRB preparation after limit is reached usb: dwc3: gadget: Fix TRB preparation during SG usb: phy: mv-usb: fix usb_phy build errors usb: serial: handle -ENODEV quietly in generic_submit_read_urb usb: serial: silence all non-critical read errors USB: console: fix potential use after free USB: console: fix uninitialised ldisc semaphore usb: gadget: udc: atmel: fix possible oops when unloading module usb: gadget: gadgetfs: fix an oops in ep_write() usb: phy: Fix deferred probing OHCI: add a quirk for ULi M5237 blocking on reset uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures uas: Do not blacklist ASM1153 disk enclosures usb: gadget: udc: avoid dereference before NULL check in ep_queue usb: host: ehci-tegra: request deferred probe when failing to get phy uas: disable UAS on Apricorn SATA dongles uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 with usb-id 0bc2:a013 uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013 xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers USB: EHCI: adjust error return code ...
-rw-r--r--drivers/phy/phy-miphy28lp.c3
-rw-r--r--drivers/phy/phy-omap-control.c7
-rw-r--r--drivers/phy/phy-sun4i-usb.c3
-rw-r--r--drivers/phy/phy-ti-pipe3.c10
-rw-r--r--drivers/usb/chipidea/core.c2
-rw-r--r--drivers/usb/chipidea/host.c1
-rw-r--r--drivers/usb/dwc2/gadget.c10
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c4
-rw-r--r--drivers/usb/dwc3/gadget.c6
-rw-r--r--drivers/usb/gadget/function/f_hid.c5
-rw-r--r--drivers/usb/gadget/function/f_midi.c2
-rw-r--r--drivers/usb/gadget/function/f_uac1.c2
-rw-r--r--drivers/usb/gadget/legacy/inode.c2
-rw-r--r--drivers/usb/gadget/udc/atmel_usba_udc.c19
-rw-r--r--drivers/usb/gadget/udc/bdc/bdc_ep.c3
-rw-r--r--drivers/usb/host/ehci-sched.c14
-rw-r--r--drivers/usb/host/ehci-tegra.c2
-rw-r--r--drivers/usb/host/pci-quirks.c18
-rw-r--r--drivers/usb/host/xhci-pci.c2
-rw-r--r--drivers/usb/host/xhci.c9
-rw-r--r--drivers/usb/musb/Kconfig4
-rw-r--r--drivers/usb/musb/blackfin.c2
-rw-r--r--drivers/usb/musb/musb_cppi41.c4
-rw-r--r--drivers/usb/musb/musb_debugfs.c34
-rw-r--r--drivers/usb/musb/musb_host.c1
-rw-r--r--drivers/usb/phy/phy-mv-usb.c5
-rw-r--r--drivers/usb/phy/phy.c16
-rw-r--r--drivers/usb/serial/console.c16
-rw-r--r--drivers/usb/serial/cp210x.c4
-rw-r--r--drivers/usb/serial/generic.c4
-rw-r--r--drivers/usb/serial/keyspan.c20
-rw-r--r--drivers/usb/serial/option.c11
-rw-r--r--drivers/usb/serial/qcserial.c1
-rw-r--r--drivers/usb/storage/uas-detect.h33
-rw-r--r--drivers/usb/storage/unusual_uas.h46
-rw-r--r--include/linux/phy/omap_control_phy.h6
36 files changed, 235 insertions, 96 deletions
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c
index e34da13885e8..27fa62ce6136 100644
--- a/drivers/phy/phy-miphy28lp.c
+++ b/drivers/phy/phy-miphy28lp.c
@@ -1050,7 +1050,8 @@ static int miphy28lp_init(struct phy *phy)
1050 ret = miphy28lp_init_usb3(miphy_phy); 1050 ret = miphy28lp_init_usb3(miphy_phy);
1051 break; 1051 break;
1052 default: 1052 default:
1053 return -EINVAL; 1053 ret = -EINVAL;
1054 break;
1054 } 1055 }
1055 1056
1056 mutex_unlock(&miphy_dev->miphy_mutex); 1057 mutex_unlock(&miphy_dev->miphy_mutex);
diff --git a/drivers/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c
index c96e8183a8ff..efe724f97e02 100644
--- a/drivers/phy/phy-omap-control.c
+++ b/drivers/phy/phy-omap-control.c
@@ -29,10 +29,9 @@
29/** 29/**
30 * omap_control_pcie_pcs - set the PCS delay count 30 * omap_control_pcie_pcs - set the PCS delay count
31 * @dev: the control module device 31 * @dev: the control module device
32 * @id: index of the pcie PHY (should be 1 or 2)
33 * @delay: 8 bit delay value 32 * @delay: 8 bit delay value
34 */ 33 */
35void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) 34void omap_control_pcie_pcs(struct device *dev, u8 delay)
36{ 35{
37 u32 val; 36 u32 val;
38 struct omap_control_phy *control_phy; 37 struct omap_control_phy *control_phy;
@@ -55,8 +54,8 @@ void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay)
55 54
56 val = readl(control_phy->pcie_pcs); 55 val = readl(control_phy->pcie_pcs);
57 val &= ~(OMAP_CTRL_PCIE_PCS_MASK << 56 val &= ~(OMAP_CTRL_PCIE_PCS_MASK <<
58 (id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT)); 57 OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT);
59 val |= delay << (id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT); 58 val |= (delay << OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT);
60 writel(val, control_phy->pcie_pcs); 59 writel(val, control_phy->pcie_pcs);
61} 60}
62EXPORT_SYMBOL_GPL(omap_control_pcie_pcs); 61EXPORT_SYMBOL_GPL(omap_control_pcie_pcs);
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index fb02a67c9181..a2b08f3ccb03 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -244,7 +244,8 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
244 else 244 else
245 data->num_phys = 3; 245 data->num_phys = 3;
246 246
247 if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy")) 247 if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy") ||
248 of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy"))
248 data->disc_thresh = 3; 249 data->disc_thresh = 3;
249 else 250 else
250 data->disc_thresh = 2; 251 data->disc_thresh = 2;
diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c
index 1387b4d4afe3..465de2c800f2 100644
--- a/drivers/phy/phy-ti-pipe3.c
+++ b/drivers/phy/phy-ti-pipe3.c
@@ -82,7 +82,6 @@ struct ti_pipe3 {
82 struct clk *refclk; 82 struct clk *refclk;
83 struct clk *div_clk; 83 struct clk *div_clk;
84 struct pipe3_dpll_map *dpll_map; 84 struct pipe3_dpll_map *dpll_map;
85 u8 id;
86}; 85};
87 86
88static struct pipe3_dpll_map dpll_map_usb[] = { 87static struct pipe3_dpll_map dpll_map_usb[] = {
@@ -217,8 +216,13 @@ static int ti_pipe3_init(struct phy *x)
217 u32 val; 216 u32 val;
218 int ret = 0; 217 int ret = 0;
219 218
219 /*
220 * Set pcie_pcs register to 0x96 for proper functioning of phy
221 * as recommended in AM572x TRM SPRUHZ6, section 18.5.2.2, table
222 * 18-1804.
223 */
220 if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) { 224 if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) {
221 omap_control_pcie_pcs(phy->control_dev, phy->id, 0xF1); 225 omap_control_pcie_pcs(phy->control_dev, 0x96);
222 return 0; 226 return 0;
223 } 227 }
224 228
@@ -347,8 +351,6 @@ static int ti_pipe3_probe(struct platform_device *pdev)
347 } 351 }
348 352
349 if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) { 353 if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) {
350 if (of_property_read_u8(node, "id", &phy->id) < 0)
351 phy->id = 1;
352 354
353 clk = devm_clk_get(phy->dev, "dpll_ref"); 355 clk = devm_clk_get(phy->dev, "dpll_ref");
354 if (IS_ERR(clk)) { 356 if (IS_ERR(clk)) {
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 5b9825a4538a..a57dc8866fc5 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -669,7 +669,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
669 if (!ci) 669 if (!ci)
670 return -ENOMEM; 670 return -ENOMEM;
671 671
672 platform_set_drvdata(pdev, ci);
673 ci->dev = dev; 672 ci->dev = dev;
674 ci->platdata = dev_get_platdata(dev); 673 ci->platdata = dev_get_platdata(dev);
675 ci->imx28_write_fix = !!(ci->platdata->flags & 674 ci->imx28_write_fix = !!(ci->platdata->flags &
@@ -783,6 +782,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
783 } 782 }
784 } 783 }
785 784
785 platform_set_drvdata(pdev, ci);
786 ret = devm_request_irq(dev, ci->irq, ci_irq, IRQF_SHARED, 786 ret = devm_request_irq(dev, ci->irq, ci_irq, IRQF_SHARED,
787 ci->platdata->name, ci); 787 ci->platdata->name, ci);
788 if (ret) 788 if (ret)
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index c1694cff1eaf..48731d0bab35 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -91,6 +91,7 @@ static int host_start(struct ci_hdrc *ci)
91 if (!hcd) 91 if (!hcd)
92 return -ENOMEM; 92 return -ENOMEM;
93 93
94 dev_set_drvdata(ci->dev, ci);
94 hcd->rsrc_start = ci->hw_bank.phys; 95 hcd->rsrc_start = ci->hw_bank.phys;
95 hcd->rsrc_len = ci->hw_bank.size; 96 hcd->rsrc_len = ci->hw_bank.size;
96 hcd->regs = ci->hw_bank.abs; 97 hcd->regs = ci->hw_bank.abs;
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 200168ec2d75..79242008085b 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2567,7 +2567,7 @@ error:
2567 * s3c_hsotg_ep_disable - disable given endpoint 2567 * s3c_hsotg_ep_disable - disable given endpoint
2568 * @ep: The endpoint to disable. 2568 * @ep: The endpoint to disable.
2569 */ 2569 */
2570static int s3c_hsotg_ep_disable(struct usb_ep *ep) 2570static int s3c_hsotg_ep_disable_force(struct usb_ep *ep, bool force)
2571{ 2571{
2572 struct s3c_hsotg_ep *hs_ep = our_ep(ep); 2572 struct s3c_hsotg_ep *hs_ep = our_ep(ep);
2573 struct dwc2_hsotg *hsotg = hs_ep->parent; 2573 struct dwc2_hsotg *hsotg = hs_ep->parent;
@@ -2588,7 +2588,7 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep)
2588 2588
2589 spin_lock_irqsave(&hsotg->lock, flags); 2589 spin_lock_irqsave(&hsotg->lock, flags);
2590 /* terminate all requests with shutdown */ 2590 /* terminate all requests with shutdown */
2591 kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, false); 2591 kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, force);
2592 2592
2593 hsotg->fifo_map &= ~(1<<hs_ep->fifo_index); 2593 hsotg->fifo_map &= ~(1<<hs_ep->fifo_index);
2594 hs_ep->fifo_index = 0; 2594 hs_ep->fifo_index = 0;
@@ -2609,6 +2609,10 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep)
2609 return 0; 2609 return 0;
2610} 2610}
2611 2611
2612static int s3c_hsotg_ep_disable(struct usb_ep *ep)
2613{
2614 return s3c_hsotg_ep_disable_force(ep, false);
2615}
2612/** 2616/**
2613 * on_list - check request is on the given endpoint 2617 * on_list - check request is on the given endpoint
2614 * @ep: The endpoint to check. 2618 * @ep: The endpoint to check.
@@ -2924,7 +2928,7 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget)
2924 2928
2925 /* all endpoints should be shutdown */ 2929 /* all endpoints should be shutdown */
2926 for (ep = 1; ep < hsotg->num_of_eps; ep++) 2930 for (ep = 1; ep < hsotg->num_of_eps; ep++)
2927 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep); 2931 s3c_hsotg_ep_disable_force(&hsotg->eps[ep].ep, true);
2928 2932
2929 spin_lock_irqsave(&hsotg->lock, flags); 2933 spin_lock_irqsave(&hsotg->lock, flags);
2930 2934
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 7c4faf738747..b642a2f998f9 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -33,6 +33,8 @@
33#define PCI_DEVICE_ID_INTEL_BYT 0x0f37 33#define PCI_DEVICE_ID_INTEL_BYT 0x0f37
34#define PCI_DEVICE_ID_INTEL_MRFLD 0x119e 34#define PCI_DEVICE_ID_INTEL_MRFLD 0x119e
35#define PCI_DEVICE_ID_INTEL_BSW 0x22B7 35#define PCI_DEVICE_ID_INTEL_BSW 0x22B7
36#define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30
37#define PCI_DEVICE_ID_INTEL_SPTH 0xa130
36 38
37struct dwc3_pci { 39struct dwc3_pci {
38 struct device *dev; 40 struct device *dev;
@@ -219,6 +221,8 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
219 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BSW), }, 221 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BSW), },
220 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), }, 222 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), },
221 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), }, 223 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), },
224 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), },
225 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), },
222 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, 226 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), },
223 { } /* Terminating Entry */ 227 { } /* Terminating Entry */
224}; 228};
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index f03b136ecfce..8f65ab3a3b92 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -882,8 +882,7 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
882 882
883 if (i == (request->num_mapped_sgs - 1) || 883 if (i == (request->num_mapped_sgs - 1) ||
884 sg_is_last(s)) { 884 sg_is_last(s)) {
885 if (list_is_last(&req->list, 885 if (list_empty(&dep->request_list))
886 &dep->request_list))
887 last_one = true; 886 last_one = true;
888 chain = false; 887 chain = false;
889 } 888 }
@@ -901,6 +900,9 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
901 if (last_one) 900 if (last_one)
902 break; 901 break;
903 } 902 }
903
904 if (last_one)
905 break;
904 } else { 906 } else {
905 dma = req->request.dma; 907 dma = req->request.dma;
906 length = req->request.length; 908 length = req->request.length;
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index 6e04e302dc3a..a1bc3e3a0b09 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -399,8 +399,9 @@ static int hidg_setup(struct usb_function *f,
399 value = __le16_to_cpu(ctrl->wValue); 399 value = __le16_to_cpu(ctrl->wValue);
400 length = __le16_to_cpu(ctrl->wLength); 400 length = __le16_to_cpu(ctrl->wLength);
401 401
402 VDBG(cdev, "hid_setup crtl_request : bRequestType:0x%x bRequest:0x%x " 402 VDBG(cdev,
403 "Value:0x%x\n", ctrl->bRequestType, ctrl->bRequest, value); 403 "%s crtl_request : bRequestType:0x%x bRequest:0x%x Value:0x%x\n",
404 __func__, ctrl->bRequestType, ctrl->bRequest, value);
404 405
405 switch ((ctrl->bRequestType << 8) | ctrl->bRequest) { 406 switch ((ctrl->bRequestType << 8) | ctrl->bRequest) {
406 case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8 407 case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index a90440300735..259b656c0b3e 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -520,7 +520,7 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
520 req = midi_alloc_ep_req(ep, midi->buflen); 520 req = midi_alloc_ep_req(ep, midi->buflen);
521 521
522 if (!req) { 522 if (!req) {
523 ERROR(midi, "gmidi_transmit: alloc_ep_request failed\n"); 523 ERROR(midi, "%s: alloc_ep_request failed\n", __func__);
524 return; 524 return;
525 } 525 }
526 req->length = 0; 526 req->length = 0;
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index f7b203293205..e9715845f82e 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -897,7 +897,6 @@ static void f_audio_free_inst(struct usb_function_instance *f)
897 struct f_uac1_opts *opts; 897 struct f_uac1_opts *opts;
898 898
899 opts = container_of(f, struct f_uac1_opts, func_inst); 899 opts = container_of(f, struct f_uac1_opts, func_inst);
900 gaudio_cleanup(opts->card);
901 if (opts->fn_play_alloc) 900 if (opts->fn_play_alloc)
902 kfree(opts->fn_play); 901 kfree(opts->fn_play);
903 if (opts->fn_cap_alloc) 902 if (opts->fn_cap_alloc)
@@ -935,6 +934,7 @@ static void f_audio_free(struct usb_function *f)
935 struct f_audio *audio = func_to_audio(f); 934 struct f_audio *audio = func_to_audio(f);
936 struct f_uac1_opts *opts; 935 struct f_uac1_opts *opts;
937 936
937 gaudio_cleanup(&audio->card);
938 opts = container_of(f->fi, struct f_uac1_opts, func_inst); 938 opts = container_of(f->fi, struct f_uac1_opts, func_inst);
939 kfree(audio); 939 kfree(audio);
940 mutex_lock(&opts->lock); 940 mutex_lock(&opts->lock);
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index c744e4975d74..db49ec4c748e 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -441,6 +441,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
441 kbuf = memdup_user(buf, len); 441 kbuf = memdup_user(buf, len);
442 if (IS_ERR(kbuf)) { 442 if (IS_ERR(kbuf)) {
443 value = PTR_ERR(kbuf); 443 value = PTR_ERR(kbuf);
444 kbuf = NULL;
444 goto free1; 445 goto free1;
445 } 446 }
446 447
@@ -449,6 +450,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
449 data->name, len, (int) value); 450 data->name, len, (int) value);
450free1: 451free1:
451 mutex_unlock(&data->lock); 452 mutex_unlock(&data->lock);
453 kfree (kbuf);
452 return value; 454 return value;
453} 455}
454 456
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index ce882371786b..9f93bed42052 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -716,10 +716,10 @@ static int queue_dma(struct usba_udc *udc, struct usba_ep *ep,
716 req->using_dma = 1; 716 req->using_dma = 1;
717 req->ctrl = USBA_BF(DMA_BUF_LEN, req->req.length) 717 req->ctrl = USBA_BF(DMA_BUF_LEN, req->req.length)
718 | USBA_DMA_CH_EN | USBA_DMA_END_BUF_IE 718 | USBA_DMA_CH_EN | USBA_DMA_END_BUF_IE
719 | USBA_DMA_END_TR_EN | USBA_DMA_END_TR_IE; 719 | USBA_DMA_END_BUF_EN;
720 720
721 if (ep->is_in) 721 if (!ep->is_in)
722 req->ctrl |= USBA_DMA_END_BUF_EN; 722 req->ctrl |= USBA_DMA_END_TR_EN | USBA_DMA_END_TR_IE;
723 723
724 /* 724 /*
725 * Add this request to the queue and submit for DMA if 725 * Add this request to the queue and submit for DMA if
@@ -828,7 +828,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
828{ 828{
829 struct usba_ep *ep = to_usba_ep(_ep); 829 struct usba_ep *ep = to_usba_ep(_ep);
830 struct usba_udc *udc = ep->udc; 830 struct usba_udc *udc = ep->udc;
831 struct usba_request *req = to_usba_req(_req); 831 struct usba_request *req;
832 unsigned long flags; 832 unsigned long flags;
833 u32 status; 833 u32 status;
834 834
@@ -837,6 +837,16 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
837 837
838 spin_lock_irqsave(&udc->lock, flags); 838 spin_lock_irqsave(&udc->lock, flags);
839 839
840 list_for_each_entry(req, &ep->queue, queue) {
841 if (&req->req == _req)
842 break;
843 }
844
845 if (&req->req != _req) {
846 spin_unlock_irqrestore(&udc->lock, flags);
847 return -EINVAL;
848 }
849
840 if (req->using_dma) { 850 if (req->using_dma) {
841 /* 851 /*
842 * If this request is currently being transferred, 852 * If this request is currently being transferred,
@@ -1563,7 +1573,6 @@ static void usba_ep_irq(struct usba_udc *udc, struct usba_ep *ep)
1563 if ((epstatus & epctrl) & USBA_RX_BK_RDY) { 1573 if ((epstatus & epctrl) & USBA_RX_BK_RDY) {
1564 DBG(DBG_BUS, "%s: RX data ready\n", ep->ep.name); 1574 DBG(DBG_BUS, "%s: RX data ready\n", ep->ep.name);
1565 receive_data(ep); 1575 receive_data(ep);
1566 usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY);
1567 } 1576 }
1568} 1577}
1569 1578
diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c
index ff67ceac77c4..d4fe8d769bd6 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_ep.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c
@@ -718,10 +718,11 @@ static int ep_queue(struct bdc_ep *ep, struct bdc_req *req)
718 struct bdc *bdc; 718 struct bdc *bdc;
719 int ret = 0; 719 int ret = 0;
720 720
721 bdc = ep->bdc;
722 if (!req || !ep || !ep->usb_ep.desc) 721 if (!req || !ep || !ep->usb_ep.desc)
723 return -EINVAL; 722 return -EINVAL;
724 723
724 bdc = ep->bdc;
725
725 req->usb_req.actual = 0; 726 req->usb_req.actual = 0;
726 req->usb_req.status = -EINPROGRESS; 727 req->usb_req.status = -EINPROGRESS;
727 req->epnum = ep->ep_num; 728 req->epnum = ep->ep_num;
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index e113fd73aeae..f9a332775c47 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1581,6 +1581,10 @@ iso_stream_schedule (
1581 else 1581 else
1582 next = (now + 2 + 7) & ~0x07; /* full frame cache */ 1582 next = (now + 2 + 7) & ~0x07; /* full frame cache */
1583 1583
1584 /* If needed, initialize last_iso_frame so that this URB will be seen */
1585 if (ehci->isoc_count == 0)
1586 ehci->last_iso_frame = now >> 3;
1587
1584 /* 1588 /*
1585 * Use ehci->last_iso_frame as the base. There can't be any 1589 * Use ehci->last_iso_frame as the base. There can't be any
1586 * TDs scheduled for earlier than that. 1590 * TDs scheduled for earlier than that.
@@ -1600,11 +1604,11 @@ iso_stream_schedule (
1600 */ 1604 */
1601 now2 = (now - base) & (mod - 1); 1605 now2 = (now - base) & (mod - 1);
1602 1606
1603 /* Is the schedule already full? */ 1607 /* Is the schedule about to wrap around? */
1604 if (unlikely(!empty && start < period)) { 1608 if (unlikely(!empty && start < period)) {
1605 ehci_dbg(ehci, "iso sched full %p (%u-%u < %u mod %u)\n", 1609 ehci_dbg(ehci, "request %p would overflow (%u-%u < %u mod %u)\n",
1606 urb, stream->next_uframe, base, period, mod); 1610 urb, stream->next_uframe, base, period, mod);
1607 status = -ENOSPC; 1611 status = -EFBIG;
1608 goto fail; 1612 goto fail;
1609 } 1613 }
1610 1614
@@ -1671,10 +1675,6 @@ iso_stream_schedule (
1671 urb->start_frame = start & (mod - 1); 1675 urb->start_frame = start & (mod - 1);
1672 if (!stream->highspeed) 1676 if (!stream->highspeed)
1673 urb->start_frame >>= 3; 1677 urb->start_frame >>= 3;
1674
1675 /* Make sure scan_isoc() sees these */
1676 if (ehci->isoc_count == 0)
1677 ehci->last_iso_frame = now >> 3;
1678 return status; 1678 return status;
1679 1679
1680 fail: 1680 fail:
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 19a9af1b4d74..ff9af29b4e9f 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -451,7 +451,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
451 451
452 u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); 452 u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0);
453 if (IS_ERR(u_phy)) { 453 if (IS_ERR(u_phy)) {
454 err = PTR_ERR(u_phy); 454 err = -EPROBE_DEFER;
455 goto cleanup_clk_en; 455 goto cleanup_clk_en;
456 } 456 }
457 hcd->usb_phy = u_phy; 457 hcd->usb_phy = u_phy;
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index dd483c13565b..ce636466edb7 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -567,7 +567,8 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
567{ 567{
568 void __iomem *base; 568 void __iomem *base;
569 u32 control; 569 u32 control;
570 u32 fminterval; 570 u32 fminterval = 0;
571 bool no_fminterval = false;
571 int cnt; 572 int cnt;
572 573
573 if (!mmio_resource_enabled(pdev, 0)) 574 if (!mmio_resource_enabled(pdev, 0))
@@ -577,6 +578,13 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
577 if (base == NULL) 578 if (base == NULL)
578 return; 579 return;
579 580
581 /*
582 * ULi M5237 OHCI controller locks the whole system when accessing
583 * the OHCI_FMINTERVAL offset.
584 */
585 if (pdev->vendor == PCI_VENDOR_ID_AL && pdev->device == 0x5237)
586 no_fminterval = true;
587
580 control = readl(base + OHCI_CONTROL); 588 control = readl(base + OHCI_CONTROL);
581 589
582/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ 590/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
@@ -615,7 +623,9 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
615 } 623 }
616 624
617 /* software reset of the controller, preserving HcFmInterval */ 625 /* software reset of the controller, preserving HcFmInterval */
618 fminterval = readl(base + OHCI_FMINTERVAL); 626 if (!no_fminterval)
627 fminterval = readl(base + OHCI_FMINTERVAL);
628
619 writel(OHCI_HCR, base + OHCI_CMDSTATUS); 629 writel(OHCI_HCR, base + OHCI_CMDSTATUS);
620 630
621 /* reset requires max 10 us delay */ 631 /* reset requires max 10 us delay */
@@ -624,7 +634,9 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
624 break; 634 break;
625 udelay(1); 635 udelay(1);
626 } 636 }
627 writel(fminterval, base + OHCI_FMINTERVAL); 637
638 if (!no_fminterval)
639 writel(fminterval, base + OHCI_FMINTERVAL);
628 640
629 /* Now the controller is safely in SUSPEND and nothing can wake it up */ 641 /* Now the controller is safely in SUSPEND and nothing can wake it up */
630 iounmap(base); 642 iounmap(base);
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 142b601f9563..7f76c8a12f89 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -82,6 +82,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
82 "must be suspended extra slowly", 82 "must be suspended extra slowly",
83 pdev->revision); 83 pdev->revision);
84 } 84 }
85 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK)
86 xhci->quirks |= XHCI_BROKEN_STREAMS;
85 /* Fresco Logic confirms: all revisions of this chip do not 87 /* Fresco Logic confirms: all revisions of this chip do not
86 * support MSI, even though some of them claim to in their PCI 88 * support MSI, even though some of them claim to in their PCI
87 * capabilities. 89 * capabilities.
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 01fcbb5eb06e..c50d8d202618 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3803,6 +3803,15 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
3803 return -EINVAL; 3803 return -EINVAL;
3804 } 3804 }
3805 3805
3806 if (setup == SETUP_CONTEXT_ONLY) {
3807 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx);
3808 if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) ==
3809 SLOT_STATE_DEFAULT) {
3810 xhci_dbg(xhci, "Slot already in default state\n");
3811 return 0;
3812 }
3813 }
3814
3806 command = xhci_alloc_command(xhci, false, false, GFP_KERNEL); 3815 command = xhci_alloc_command(xhci, false, false, GFP_KERNEL);
3807 if (!command) 3816 if (!command)
3808 return -ENOMEM; 3817 return -ENOMEM;
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 9d68372dd9aa..b005010240e5 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -72,6 +72,8 @@ config USB_MUSB_DA8XX
72 72
73config USB_MUSB_TUSB6010 73config USB_MUSB_TUSB6010
74 tristate "TUSB6010" 74 tristate "TUSB6010"
75 depends on ARCH_OMAP2PLUS || COMPILE_TEST
76 depends on NOP_USB_XCEIV = USB_MUSB_HDRC # both built-in or both modules
75 77
76config USB_MUSB_OMAP2PLUS 78config USB_MUSB_OMAP2PLUS
77 tristate "OMAP2430 and onwards" 79 tristate "OMAP2430 and onwards"
@@ -85,6 +87,7 @@ config USB_MUSB_AM35X
85config USB_MUSB_DSPS 87config USB_MUSB_DSPS
86 tristate "TI DSPS platforms" 88 tristate "TI DSPS platforms"
87 select USB_MUSB_AM335X_CHILD 89 select USB_MUSB_AM335X_CHILD
90 depends on ARCH_OMAP2PLUS || COMPILE_TEST
88 depends on OF_IRQ 91 depends on OF_IRQ
89 92
90config USB_MUSB_BLACKFIN 93config USB_MUSB_BLACKFIN
@@ -93,6 +96,7 @@ config USB_MUSB_BLACKFIN
93 96
94config USB_MUSB_UX500 97config USB_MUSB_UX500
95 tristate "Ux500 platforms" 98 tristate "Ux500 platforms"
99 depends on ARCH_U8500 || COMPILE_TEST
96 100
97config USB_MUSB_JZ4740 101config USB_MUSB_JZ4740
98 tristate "JZ4740" 102 tristate "JZ4740"
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index a441a2de8619..178250145613 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -63,7 +63,7 @@ static void bfin_writew(void __iomem *addr, unsigned offset, u16 data)
63 bfin_write16(addr + offset, data); 63 bfin_write16(addr + offset, data);
64} 64}
65 65
66static void binf_writel(void __iomem *addr, unsigned offset, u32 data) 66static void bfin_writel(void __iomem *addr, unsigned offset, u32 data)
67{ 67{
68 bfin_write16(addr + offset, (u16)data); 68 bfin_write16(addr + offset, (u16)data);
69} 69}
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index f64fd964dc6d..c39a16ad7832 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -628,9 +628,9 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
628 ret = of_property_read_string_index(np, "dma-names", i, &str); 628 ret = of_property_read_string_index(np, "dma-names", i, &str);
629 if (ret) 629 if (ret)
630 goto err; 630 goto err;
631 if (!strncmp(str, "tx", 2)) 631 if (strstarts(str, "tx"))
632 is_tx = 1; 632 is_tx = 1;
633 else if (!strncmp(str, "rx", 2)) 633 else if (strstarts(str, "rx"))
634 is_tx = 0; 634 is_tx = 0;
635 else { 635 else {
636 dev_err(dev, "Wrong dmatype %s\n", str); 636 dev_err(dev, "Wrong dmatype %s\n", str);
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index ad3701a97389..48131aa8472c 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -59,20 +59,12 @@ static const struct musb_register_map musb_regmap[] = {
59 { "RxMaxPp", MUSB_RXMAXP, 16 }, 59 { "RxMaxPp", MUSB_RXMAXP, 16 },
60 { "RxCSR", MUSB_RXCSR, 16 }, 60 { "RxCSR", MUSB_RXCSR, 16 },
61 { "RxCount", MUSB_RXCOUNT, 16 }, 61 { "RxCount", MUSB_RXCOUNT, 16 },
62 { "ConfigData", MUSB_CONFIGDATA,8 },
63 { "IntrRxE", MUSB_INTRRXE, 16 }, 62 { "IntrRxE", MUSB_INTRRXE, 16 },
64 { "IntrTxE", MUSB_INTRTXE, 16 }, 63 { "IntrTxE", MUSB_INTRTXE, 16 },
65 { "IntrUsbE", MUSB_INTRUSBE, 8 }, 64 { "IntrUsbE", MUSB_INTRUSBE, 8 },
66 { "DevCtl", MUSB_DEVCTL, 8 }, 65 { "DevCtl", MUSB_DEVCTL, 8 },
67 { "BabbleCtl", MUSB_BABBLE_CTL,8 },
68 { "TxFIFOsz", MUSB_TXFIFOSZ, 8 },
69 { "RxFIFOsz", MUSB_RXFIFOSZ, 8 },
70 { "TxFIFOadd", MUSB_TXFIFOADD, 16 },
71 { "RxFIFOadd", MUSB_RXFIFOADD, 16 },
72 { "VControl", 0x68, 32 }, 66 { "VControl", 0x68, 32 },
73 { "HWVers", 0x69, 16 }, 67 { "HWVers", 0x69, 16 },
74 { "EPInfo", MUSB_EPINFO, 8 },
75 { "RAMInfo", MUSB_RAMINFO, 8 },
76 { "LinkInfo", MUSB_LINKINFO, 8 }, 68 { "LinkInfo", MUSB_LINKINFO, 8 },
77 { "VPLen", MUSB_VPLEN, 8 }, 69 { "VPLen", MUSB_VPLEN, 8 },
78 { "HS_EOF1", MUSB_HS_EOF1, 8 }, 70 { "HS_EOF1", MUSB_HS_EOF1, 8 },
@@ -103,6 +95,16 @@ static const struct musb_register_map musb_regmap[] = {
103 { "DMA_CNTLch7", 0x274, 16 }, 95 { "DMA_CNTLch7", 0x274, 16 },
104 { "DMA_ADDRch7", 0x278, 32 }, 96 { "DMA_ADDRch7", 0x278, 32 },
105 { "DMA_COUNTch7", 0x27C, 32 }, 97 { "DMA_COUNTch7", 0x27C, 32 },
98#ifndef CONFIG_BLACKFIN
99 { "ConfigData", MUSB_CONFIGDATA,8 },
100 { "BabbleCtl", MUSB_BABBLE_CTL,8 },
101 { "TxFIFOsz", MUSB_TXFIFOSZ, 8 },
102 { "RxFIFOsz", MUSB_RXFIFOSZ, 8 },
103 { "TxFIFOadd", MUSB_TXFIFOADD, 16 },
104 { "RxFIFOadd", MUSB_RXFIFOADD, 16 },
105 { "EPInfo", MUSB_EPINFO, 8 },
106 { "RAMInfo", MUSB_RAMINFO, 8 },
107#endif
106 { } /* Terminating Entry */ 108 { } /* Terminating Entry */
107}; 109};
108 110
@@ -197,30 +199,30 @@ static ssize_t musb_test_mode_write(struct file *file,
197 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) 199 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
198 return -EFAULT; 200 return -EFAULT;
199 201
200 if (!strncmp(buf, "force host", 9)) 202 if (strstarts(buf, "force host"))
201 test = MUSB_TEST_FORCE_HOST; 203 test = MUSB_TEST_FORCE_HOST;
202 204
203 if (!strncmp(buf, "fifo access", 11)) 205 if (strstarts(buf, "fifo access"))
204 test = MUSB_TEST_FIFO_ACCESS; 206 test = MUSB_TEST_FIFO_ACCESS;
205 207
206 if (!strncmp(buf, "force full-speed", 15)) 208 if (strstarts(buf, "force full-speed"))
207 test = MUSB_TEST_FORCE_FS; 209 test = MUSB_TEST_FORCE_FS;
208 210
209 if (!strncmp(buf, "force high-speed", 15)) 211 if (strstarts(buf, "force high-speed"))
210 test = MUSB_TEST_FORCE_HS; 212 test = MUSB_TEST_FORCE_HS;
211 213
212 if (!strncmp(buf, "test packet", 10)) { 214 if (strstarts(buf, "test packet")) {
213 test = MUSB_TEST_PACKET; 215 test = MUSB_TEST_PACKET;
214 musb_load_testpacket(musb); 216 musb_load_testpacket(musb);
215 } 217 }
216 218
217 if (!strncmp(buf, "test K", 6)) 219 if (strstarts(buf, "test K"))
218 test = MUSB_TEST_K; 220 test = MUSB_TEST_K;
219 221
220 if (!strncmp(buf, "test J", 6)) 222 if (strstarts(buf, "test J"))
221 test = MUSB_TEST_J; 223 test = MUSB_TEST_J;
222 224
223 if (!strncmp(buf, "test SE0 NAK", 12)) 225 if (strstarts(buf, "test SE0 NAK"))
224 test = MUSB_TEST_SE0_NAK; 226 test = MUSB_TEST_SE0_NAK;
225 227
226 musb_writeb(musb->mregs, MUSB_TESTMODE, test); 228 musb_writeb(musb->mregs, MUSB_TESTMODE, test);
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 23d474d3d7f4..883a9adfdfff 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -2663,7 +2663,6 @@ void musb_host_cleanup(struct musb *musb)
2663 if (musb->port_mode == MUSB_PORT_MODE_GADGET) 2663 if (musb->port_mode == MUSB_PORT_MODE_GADGET)
2664 return; 2664 return;
2665 usb_remove_hcd(musb->hcd); 2665 usb_remove_hcd(musb->hcd);
2666 musb->hcd = NULL;
2667} 2666}
2668 2667
2669void musb_host_free(struct musb *musb) 2668void musb_host_free(struct musb *musb)
diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
index 699e38c73d82..697a741a0cb1 100644
--- a/drivers/usb/phy/phy-mv-usb.c
+++ b/drivers/usb/phy/phy-mv-usb.c
@@ -338,7 +338,6 @@ static void mv_otg_update_inputs(struct mv_otg *mvotg)
338static void mv_otg_update_state(struct mv_otg *mvotg) 338static void mv_otg_update_state(struct mv_otg *mvotg)
339{ 339{
340 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; 340 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl;
341 struct usb_phy *phy = &mvotg->phy;
342 int old_state = mvotg->phy.otg->state; 341 int old_state = mvotg->phy.otg->state;
343 342
344 switch (old_state) { 343 switch (old_state) {
@@ -858,10 +857,10 @@ static int mv_otg_suspend(struct platform_device *pdev, pm_message_t state)
858{ 857{
859 struct mv_otg *mvotg = platform_get_drvdata(pdev); 858 struct mv_otg *mvotg = platform_get_drvdata(pdev);
860 859
861 if (mvotg->phy.state != OTG_STATE_B_IDLE) { 860 if (mvotg->phy.otg->state != OTG_STATE_B_IDLE) {
862 dev_info(&pdev->dev, 861 dev_info(&pdev->dev,
863 "OTG state is not B_IDLE, it is %d!\n", 862 "OTG state is not B_IDLE, it is %d!\n",
864 mvotg->phy.state); 863 mvotg->phy.otg->state);
865 return -EAGAIN; 864 return -EAGAIN;
866 } 865 }
867 866
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index b4066a001ba0..ccfdfb24b240 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -34,7 +34,7 @@ static struct usb_phy *__usb_find_phy(struct list_head *list,
34 return phy; 34 return phy;
35 } 35 }
36 36
37 return ERR_PTR(-ENODEV); 37 return ERR_PTR(-EPROBE_DEFER);
38} 38}
39 39
40static struct usb_phy *__usb_find_phy_dev(struct device *dev, 40static struct usb_phy *__usb_find_phy_dev(struct device *dev,
@@ -59,6 +59,9 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node)
59{ 59{
60 struct usb_phy *phy; 60 struct usb_phy *phy;
61 61
62 if (!of_device_is_available(node))
63 return ERR_PTR(-ENODEV);
64
62 list_for_each_entry(phy, &phy_list, head) { 65 list_for_each_entry(phy, &phy_list, head) {
63 if (node != phy->dev->of_node) 66 if (node != phy->dev->of_node)
64 continue; 67 continue;
@@ -66,7 +69,7 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node)
66 return phy; 69 return phy;
67 } 70 }
68 71
69 return ERR_PTR(-ENODEV); 72 return ERR_PTR(-EPROBE_DEFER);
70} 73}
71 74
72static void devm_usb_phy_release(struct device *dev, void *res) 75static void devm_usb_phy_release(struct device *dev, void *res)
@@ -190,10 +193,13 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
190 spin_lock_irqsave(&phy_lock, flags); 193 spin_lock_irqsave(&phy_lock, flags);
191 194
192 phy = __of_usb_find_phy(node); 195 phy = __of_usb_find_phy(node);
193 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 196 if (IS_ERR(phy)) {
194 if (!IS_ERR(phy)) 197 devres_free(ptr);
195 phy = ERR_PTR(-EPROBE_DEFER); 198 goto err1;
199 }
196 200
201 if (!try_module_get(phy->dev->driver->owner)) {
202 phy = ERR_PTR(-ENODEV);
197 devres_free(ptr); 203 devres_free(ptr);
198 goto err1; 204 goto err1;
199 } 205 }
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 8d7fc48b1f30..29fa1c3d0089 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -46,6 +46,8 @@ static struct console usbcons;
46 * ------------------------------------------------------------ 46 * ------------------------------------------------------------
47 */ 47 */
48 48
49static const struct tty_operations usb_console_fake_tty_ops = {
50};
49 51
50/* 52/*
51 * The parsing of the command line works exactly like the 53 * The parsing of the command line works exactly like the
@@ -137,13 +139,17 @@ static int usb_console_setup(struct console *co, char *options)
137 goto reset_open_count; 139 goto reset_open_count;
138 } 140 }
139 kref_init(&tty->kref); 141 kref_init(&tty->kref);
140 tty_port_tty_set(&port->port, tty);
141 tty->driver = usb_serial_tty_driver; 142 tty->driver = usb_serial_tty_driver;
142 tty->index = co->index; 143 tty->index = co->index;
144 init_ldsem(&tty->ldisc_sem);
145 INIT_LIST_HEAD(&tty->tty_files);
146 kref_get(&tty->driver->kref);
147 tty->ops = &usb_console_fake_tty_ops;
143 if (tty_init_termios(tty)) { 148 if (tty_init_termios(tty)) {
144 retval = -ENOMEM; 149 retval = -ENOMEM;
145 goto free_tty; 150 goto put_tty;
146 } 151 }
152 tty_port_tty_set(&port->port, tty);
147 } 153 }
148 154
149 /* only call the device specific open if this 155 /* only call the device specific open if this
@@ -161,7 +167,7 @@ static int usb_console_setup(struct console *co, char *options)
161 serial->type->set_termios(tty, port, &dummy); 167 serial->type->set_termios(tty, port, &dummy);
162 168
163 tty_port_tty_set(&port->port, NULL); 169 tty_port_tty_set(&port->port, NULL);
164 kfree(tty); 170 tty_kref_put(tty);
165 } 171 }
166 set_bit(ASYNCB_INITIALIZED, &port->port.flags); 172 set_bit(ASYNCB_INITIALIZED, &port->port.flags);
167 } 173 }
@@ -177,8 +183,8 @@ static int usb_console_setup(struct console *co, char *options)
177 183
178 fail: 184 fail:
179 tty_port_tty_set(&port->port, NULL); 185 tty_port_tty_set(&port->port, NULL);
180 free_tty: 186 put_tty:
181 kfree(tty); 187 tty_kref_put(tty);
182 reset_open_count: 188 reset_open_count:
183 port->port.count = 0; 189 port->port.count = 0;
184 usb_autopm_put_interface(serial->interface); 190 usb_autopm_put_interface(serial->interface);
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 6c4eb3cf5efd..f4c56fc1a9f6 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -120,10 +120,12 @@ static const struct usb_device_id id_table[] = {
120 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ 120 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
121 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ 121 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
122 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ 122 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
123 { USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */ 123 { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */
124 { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */
124 { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ 125 { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
125 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ 126 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
126 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ 127 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
128 { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */
127 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 129 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
128 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 130 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
129 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ 131 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 1bd192290b08..ccf1df7c4b80 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -286,7 +286,7 @@ static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
286 286
287 res = usb_submit_urb(port->read_urbs[index], mem_flags); 287 res = usb_submit_urb(port->read_urbs[index], mem_flags);
288 if (res) { 288 if (res) {
289 if (res != -EPERM) { 289 if (res != -EPERM && res != -ENODEV) {
290 dev_err(&port->dev, 290 dev_err(&port->dev,
291 "%s - usb_submit_urb failed: %d\n", 291 "%s - usb_submit_urb failed: %d\n",
292 __func__, res); 292 __func__, res);
@@ -373,7 +373,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
373 __func__, urb->status); 373 __func__, urb->status);
374 return; 374 return;
375 default: 375 default:
376 dev_err(&port->dev, "%s - nonzero urb status: %d\n", 376 dev_dbg(&port->dev, "%s - nonzero urb status: %d\n",
377 __func__, urb->status); 377 __func__, urb->status);
378 goto resubmit; 378 goto resubmit;
379 } 379 }
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 077c714f1285..e07b15ed5814 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -410,6 +410,8 @@ static void usa26_instat_callback(struct urb *urb)
410 } 410 }
411 port = serial->port[msg->port]; 411 port = serial->port[msg->port];
412 p_priv = usb_get_serial_port_data(port); 412 p_priv = usb_get_serial_port_data(port);
413 if (!p_priv)
414 goto resubmit;
413 415
414 /* Update handshaking pin state information */ 416 /* Update handshaking pin state information */
415 old_dcd_state = p_priv->dcd_state; 417 old_dcd_state = p_priv->dcd_state;
@@ -420,7 +422,7 @@ static void usa26_instat_callback(struct urb *urb)
420 422
421 if (old_dcd_state != p_priv->dcd_state) 423 if (old_dcd_state != p_priv->dcd_state)
422 tty_port_tty_hangup(&port->port, true); 424 tty_port_tty_hangup(&port->port, true);
423 425resubmit:
424 /* Resubmit urb so we continue receiving */ 426 /* Resubmit urb so we continue receiving */
425 err = usb_submit_urb(urb, GFP_ATOMIC); 427 err = usb_submit_urb(urb, GFP_ATOMIC);
426 if (err != 0) 428 if (err != 0)
@@ -527,6 +529,8 @@ static void usa28_instat_callback(struct urb *urb)
527 } 529 }
528 port = serial->port[msg->port]; 530 port = serial->port[msg->port];
529 p_priv = usb_get_serial_port_data(port); 531 p_priv = usb_get_serial_port_data(port);
532 if (!p_priv)
533 goto resubmit;
530 534
531 /* Update handshaking pin state information */ 535 /* Update handshaking pin state information */
532 old_dcd_state = p_priv->dcd_state; 536 old_dcd_state = p_priv->dcd_state;
@@ -537,7 +541,7 @@ static void usa28_instat_callback(struct urb *urb)
537 541
538 if (old_dcd_state != p_priv->dcd_state && old_dcd_state) 542 if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
539 tty_port_tty_hangup(&port->port, true); 543 tty_port_tty_hangup(&port->port, true);
540 544resubmit:
541 /* Resubmit urb so we continue receiving */ 545 /* Resubmit urb so we continue receiving */
542 err = usb_submit_urb(urb, GFP_ATOMIC); 546 err = usb_submit_urb(urb, GFP_ATOMIC);
543 if (err != 0) 547 if (err != 0)
@@ -607,6 +611,8 @@ static void usa49_instat_callback(struct urb *urb)
607 } 611 }
608 port = serial->port[msg->portNumber]; 612 port = serial->port[msg->portNumber];
609 p_priv = usb_get_serial_port_data(port); 613 p_priv = usb_get_serial_port_data(port);
614 if (!p_priv)
615 goto resubmit;
610 616
611 /* Update handshaking pin state information */ 617 /* Update handshaking pin state information */
612 old_dcd_state = p_priv->dcd_state; 618 old_dcd_state = p_priv->dcd_state;
@@ -617,7 +623,7 @@ static void usa49_instat_callback(struct urb *urb)
617 623
618 if (old_dcd_state != p_priv->dcd_state && old_dcd_state) 624 if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
619 tty_port_tty_hangup(&port->port, true); 625 tty_port_tty_hangup(&port->port, true);
620 626resubmit:
621 /* Resubmit urb so we continue receiving */ 627 /* Resubmit urb so we continue receiving */
622 err = usb_submit_urb(urb, GFP_ATOMIC); 628 err = usb_submit_urb(urb, GFP_ATOMIC);
623 if (err != 0) 629 if (err != 0)
@@ -855,6 +861,8 @@ static void usa90_instat_callback(struct urb *urb)
855 861
856 port = serial->port[0]; 862 port = serial->port[0];
857 p_priv = usb_get_serial_port_data(port); 863 p_priv = usb_get_serial_port_data(port);
864 if (!p_priv)
865 goto resubmit;
858 866
859 /* Update handshaking pin state information */ 867 /* Update handshaking pin state information */
860 old_dcd_state = p_priv->dcd_state; 868 old_dcd_state = p_priv->dcd_state;
@@ -865,7 +873,7 @@ static void usa90_instat_callback(struct urb *urb)
865 873
866 if (old_dcd_state != p_priv->dcd_state && old_dcd_state) 874 if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
867 tty_port_tty_hangup(&port->port, true); 875 tty_port_tty_hangup(&port->port, true);
868 876resubmit:
869 /* Resubmit urb so we continue receiving */ 877 /* Resubmit urb so we continue receiving */
870 err = usb_submit_urb(urb, GFP_ATOMIC); 878 err = usb_submit_urb(urb, GFP_ATOMIC);
871 if (err != 0) 879 if (err != 0)
@@ -926,6 +934,8 @@ static void usa67_instat_callback(struct urb *urb)
926 934
927 port = serial->port[msg->port]; 935 port = serial->port[msg->port];
928 p_priv = usb_get_serial_port_data(port); 936 p_priv = usb_get_serial_port_data(port);
937 if (!p_priv)
938 goto resubmit;
929 939
930 /* Update handshaking pin state information */ 940 /* Update handshaking pin state information */
931 old_dcd_state = p_priv->dcd_state; 941 old_dcd_state = p_priv->dcd_state;
@@ -934,7 +944,7 @@ static void usa67_instat_callback(struct urb *urb)
934 944
935 if (old_dcd_state != p_priv->dcd_state && old_dcd_state) 945 if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
936 tty_port_tty_hangup(&port->port, true); 946 tty_port_tty_hangup(&port->port, true);
937 947resubmit:
938 /* Resubmit urb so we continue receiving */ 948 /* Resubmit urb so we continue receiving */
939 err = usb_submit_urb(urb, GFP_ATOMIC); 949 err = usb_submit_urb(urb, GFP_ATOMIC);
940 if (err != 0) 950 if (err != 0)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 7a4c21b4f676..efdcee15b520 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -234,6 +234,8 @@ static void option_instat_callback(struct urb *urb);
234 234
235#define QUALCOMM_VENDOR_ID 0x05C6 235#define QUALCOMM_VENDOR_ID 0x05C6
236 236
237#define SIERRA_VENDOR_ID 0x1199
238
237#define CMOTECH_VENDOR_ID 0x16d8 239#define CMOTECH_VENDOR_ID 0x16d8
238#define CMOTECH_PRODUCT_6001 0x6001 240#define CMOTECH_PRODUCT_6001 0x6001
239#define CMOTECH_PRODUCT_CMU_300 0x6002 241#define CMOTECH_PRODUCT_CMU_300 0x6002
@@ -512,7 +514,7 @@ enum option_blacklist_reason {
512 OPTION_BLACKLIST_RESERVED_IF = 2 514 OPTION_BLACKLIST_RESERVED_IF = 2
513}; 515};
514 516
515#define MAX_BL_NUM 8 517#define MAX_BL_NUM 11
516struct option_blacklist_info { 518struct option_blacklist_info {
517 /* bitfield of interface numbers for OPTION_BLACKLIST_SENDSETUP */ 519 /* bitfield of interface numbers for OPTION_BLACKLIST_SENDSETUP */
518 const unsigned long sendsetup; 520 const unsigned long sendsetup;
@@ -601,6 +603,11 @@ static const struct option_blacklist_info telit_le920_blacklist = {
601 .reserved = BIT(1) | BIT(5), 603 .reserved = BIT(1) | BIT(5),
602}; 604};
603 605
606static const struct option_blacklist_info sierra_mc73xx_blacklist = {
607 .sendsetup = BIT(0) | BIT(2),
608 .reserved = BIT(8) | BIT(10) | BIT(11),
609};
610
604static const struct usb_device_id option_ids[] = { 611static const struct usb_device_id option_ids[] = {
605 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 612 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
606 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 613 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -1098,6 +1105,8 @@ static const struct usb_device_id option_ids[] = {
1098 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 1105 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
1099 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ 1106 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
1100 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ 1107 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
1108 { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x68c0, 0xff),
1109 .driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC73xx */
1101 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 1110 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
1102 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, 1111 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
1103 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), 1112 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index cb3e14780a7e..9c63897b3a56 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -142,7 +142,6 @@ static const struct usb_device_id id_table[] = {
142 {DEVICE_SWI(0x0f3d, 0x68a2)}, /* Sierra Wireless MC7700 */ 142 {DEVICE_SWI(0x0f3d, 0x68a2)}, /* Sierra Wireless MC7700 */
143 {DEVICE_SWI(0x114f, 0x68a2)}, /* Sierra Wireless MC7750 */ 143 {DEVICE_SWI(0x114f, 0x68a2)}, /* Sierra Wireless MC7750 */
144 {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */ 144 {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */
145 {DEVICE_SWI(0x1199, 0x68c0)}, /* Sierra Wireless MC73xx */
146 {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */ 145 {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */
147 {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */ 146 {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */
148 {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */ 147 {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index 8a6f371ed6e7..9893d696fc97 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -69,16 +69,39 @@ static int uas_use_uas_driver(struct usb_interface *intf,
69 return 0; 69 return 0;
70 70
71 /* 71 /*
72 * ASM1051 and older ASM1053 devices have the same usb-id, and UAS is 72 * ASMedia has a number of usb3 to sata bridge chips, at the time of
73 * broken on the ASM1051, use the number of streams to differentiate. 73 * this writing the following versions exist:
74 * New ASM1053-s also support 32 streams, but have a different prod-id. 74 * ASM1051 - no uas support version
75 * ASM1051 - with broken (*) uas support
76 * ASM1053 - with working uas support
77 * ASM1153 - with working uas support
78 *
79 * Devices with these chips re-use a number of device-ids over the
80 * entire line, so the device-id is useless to determine if we're
81 * dealing with an ASM1051 (which we want to avoid).
82 *
83 * The ASM1153 can be identified by config.MaxPower == 0,
84 * where as the ASM105x models have config.MaxPower == 36.
85 *
86 * Differentiating between the ASM1053 and ASM1051 is trickier, when
87 * connected over USB-3 we can look at the number of streams supported,
88 * ASM1051 supports 32 streams, where as early ASM1053 versions support
89 * 16 streams, newer ASM1053-s also support 32 streams, but have a
90 * different prod-id.
91 *
92 * (*) ASM1051 chips do work with UAS with some disks (with the
93 * US_FL_NO_REPORT_OPCODES quirk), but are broken with other disks
75 */ 94 */
76 if (le16_to_cpu(udev->descriptor.idVendor) == 0x174c && 95 if (le16_to_cpu(udev->descriptor.idVendor) == 0x174c &&
77 le16_to_cpu(udev->descriptor.idProduct) == 0x55aa) { 96 (le16_to_cpu(udev->descriptor.idProduct) == 0x5106 ||
78 if (udev->speed < USB_SPEED_SUPER) { 97 le16_to_cpu(udev->descriptor.idProduct) == 0x55aa)) {
98 if (udev->actconfig->desc.bMaxPower == 0) {
99 /* ASM1153, do nothing */
100 } else if (udev->speed < USB_SPEED_SUPER) {
79 /* No streams info, assume ASM1051 */ 101 /* No streams info, assume ASM1051 */
80 flags |= US_FL_IGNORE_UAS; 102 flags |= US_FL_IGNORE_UAS;
81 } else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) { 103 } else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) {
104 /* Possibly an ASM1051, disable uas */
82 flags |= US_FL_IGNORE_UAS; 105 flags |= US_FL_IGNORE_UAS;
83 } 106 }
84 } 107 }
diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
index 18a283d6de1c..6df4357d9ee3 100644
--- a/drivers/usb/storage/unusual_uas.h
+++ b/drivers/usb/storage/unusual_uas.h
@@ -40,6 +40,16 @@
40 * and don't forget to CC: the USB development list <linux-usb@vger.kernel.org> 40 * and don't forget to CC: the USB development list <linux-usb@vger.kernel.org>
41 */ 41 */
42 42
43/*
44 * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
45 * commands in UAS mode. Observed with the 1.28 firmware; are there others?
46 */
47UNUSUAL_DEV(0x0984, 0x0301, 0x0128, 0x0128,
48 "Apricorn",
49 "",
50 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
51 US_FL_IGNORE_UAS),
52
43/* https://bugzilla.kernel.org/show_bug.cgi?id=79511 */ 53/* https://bugzilla.kernel.org/show_bug.cgi?id=79511 */
44UNUSUAL_DEV(0x0bc2, 0x2312, 0x0000, 0x9999, 54UNUSUAL_DEV(0x0bc2, 0x2312, 0x0000, 0x9999,
45 "Seagate", 55 "Seagate",
@@ -68,6 +78,20 @@ UNUSUAL_DEV(0x0bc2, 0xa003, 0x0000, 0x9999,
68 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 78 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
69 US_FL_NO_ATA_1X), 79 US_FL_NO_ATA_1X),
70 80
81/* Reported-by: Marcin ZajÄ…czkowski <mszpak@wp.pl> */
82UNUSUAL_DEV(0x0bc2, 0xa013, 0x0000, 0x9999,
83 "Seagate",
84 "Backup Plus",
85 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
86 US_FL_NO_ATA_1X),
87
88/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
89UNUSUAL_DEV(0x0bc2, 0xa0a4, 0x0000, 0x9999,
90 "Seagate",
91 "Backup Plus Desk",
92 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
93 US_FL_NO_ATA_1X),
94
71/* https://bbs.archlinux.org/viewtopic.php?id=183190 */ 95/* https://bbs.archlinux.org/viewtopic.php?id=183190 */
72UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999, 96UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999,
73 "Seagate", 97 "Seagate",
@@ -82,6 +106,13 @@ UNUSUAL_DEV(0x0bc2, 0xab21, 0x0000, 0x9999,
82 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 106 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
83 US_FL_NO_ATA_1X), 107 US_FL_NO_ATA_1X),
84 108
109/* Reported-by: G. Richard Bellamy <rbellamy@pteradigm.com> */
110UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999,
111 "Seagate",
112 "BUP Fast HDD",
113 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
114 US_FL_NO_ATA_1X),
115
85/* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */ 116/* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */
86UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, 117UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999,
87 "JMicron", 118 "JMicron",
@@ -89,14 +120,6 @@ UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999,
89 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 120 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
90 US_FL_NO_REPORT_OPCODES), 121 US_FL_NO_REPORT_OPCODES),
91 122
92/* Most ASM1051 based devices have issues with uas, blacklist them all */
93/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
94UNUSUAL_DEV(0x174c, 0x5106, 0x0000, 0x9999,
95 "ASMedia",
96 "ASM1051",
97 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
98 US_FL_IGNORE_UAS),
99
100/* Reported-by: Hans de Goede <hdegoede@redhat.com> */ 123/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
101UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, 124UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
102 "VIA", 125 "VIA",
@@ -104,6 +127,13 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
104 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 127 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
105 US_FL_NO_ATA_1X), 128 US_FL_NO_ATA_1X),
106 129
130/* Reported-by: Takeo Nakayama <javhera@gmx.com> */
131UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999,
132 "JMicron",
133 "JMS566",
134 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
135 US_FL_NO_REPORT_OPCODES),
136
107/* Reported-by: Hans de Goede <hdegoede@redhat.com> */ 137/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
108UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999, 138UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
109 "Hitachi", 139 "Hitachi",
diff --git a/include/linux/phy/omap_control_phy.h b/include/linux/phy/omap_control_phy.h
index e9e6cfbfbb58..eb7d4a135a9e 100644
--- a/include/linux/phy/omap_control_phy.h
+++ b/include/linux/phy/omap_control_phy.h
@@ -66,7 +66,7 @@ enum omap_control_usb_mode {
66#define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0 66#define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0
67 67
68#define OMAP_CTRL_PCIE_PCS_MASK 0xff 68#define OMAP_CTRL_PCIE_PCS_MASK 0xff
69#define OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT 0x8 69#define OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT 16
70 70
71#define OMAP_CTRL_USB2_PHY_PD BIT(28) 71#define OMAP_CTRL_USB2_PHY_PD BIT(28)
72 72
@@ -79,7 +79,7 @@ enum omap_control_usb_mode {
79void omap_control_phy_power(struct device *dev, int on); 79void omap_control_phy_power(struct device *dev, int on);
80void omap_control_usb_set_mode(struct device *dev, 80void omap_control_usb_set_mode(struct device *dev,
81 enum omap_control_usb_mode mode); 81 enum omap_control_usb_mode mode);
82void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay); 82void omap_control_pcie_pcs(struct device *dev, u8 delay);
83#else 83#else
84 84
85static inline void omap_control_phy_power(struct device *dev, int on) 85static inline void omap_control_phy_power(struct device *dev, int on)
@@ -91,7 +91,7 @@ static inline void omap_control_usb_set_mode(struct device *dev,
91{ 91{
92} 92}
93 93
94static inline void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) 94static inline void omap_control_pcie_pcs(struct device *dev, u8 delay)
95{ 95{
96} 96}
97#endif 97#endif