diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-09 15:23:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-09 15:23:02 -0400 |
commit | ffb927d1dce051f2c93d4510e446589189c1bf27 (patch) | |
tree | 2f025bc5cb8c3f09232672a72d18f4588bbd4360 | |
parent | c6e6e58cc8a636b9b833a7b4bc00cde1fe20892f (diff) | |
parent | 636c8a8d85d0564222071f0caa4a4e6bf527efe5 (diff) |
Merge tag 'usb-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are some USB fixes and new device ids for 4.6-rc3.
Nothing major, the normal USB gadget fixes and usb-serial driver ids,
along with some other fixes mixed in. All except the USB serial ids
have been tested in linux-next, the id additions should be fine as
they are 'trivial'"
* tag 'usb-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (25 commits)
USB: option: add "D-Link DWM-221 B1" device id
USB: serial: cp210x: Adding GE Healthcare Device ID
USB: serial: ftdi_sio: Add support for ICP DAS I-756xU devices
usb: dwc3: keystone: drop dma_mask configuration
usb: gadget: udc-core: remove manual dma configuration
usb: dwc3: pci: add ID for one more Intel Broxton platform
usb: renesas_usbhs: fix to avoid using a disabled ep in usbhsg_queue_done()
usb: dwc2: do not override forced dr_mode in gadget setup
usb: gadget: f_midi: unlock on error
USB: digi_acceleport: do sanity checking for the number of ports
USB: cypress_m8: add endpoint sanity check
USB: mct_u232: add sanity checking in probe
usb: fix regression in SuperSpeed endpoint descriptor parsing
USB: usbip: fix potential out-of-bounds write
usb: renesas_usbhs: disable TX IRQ before starting TX DMAC transfer
usb: renesas_usbhs: avoid NULL pointer derefernce in usbhsf_pkt_handler()
usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize
usb: phy: qcom-8x16: fix regulator API abuse
usb: ch9: Fix SSP Device Cap wFunctionalitySupport type
usb: gadget: composite: Access SSP Dev Cap fields properly
...
-rw-r--r-- | drivers/usb/core/config.c | 16 | ||||
-rw-r--r-- | drivers/usb/dwc2/gadget.c | 23 | ||||
-rw-r--r-- | drivers/usb/dwc3/core.c | 48 | ||||
-rw-r--r-- | drivers/usb/dwc3/dwc3-keystone.c | 5 | ||||
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 2 | ||||
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 11 | ||||
-rw-r--r-- | drivers/usb/gadget/composite.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/function/f_midi.c | 17 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/atmel_usba_udc.c | 14 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/udc-core.c | 6 | ||||
-rw-r--r-- | drivers/usb/phy/phy-qcom-8x16-usb.c | 72 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 4 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_gadget.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/cp210x.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 11 | ||||
-rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 4 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio_ids.h | 8 | ||||
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 9 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 2 | ||||
-rw-r--r-- | drivers/usb/usbip/usbip_common.c | 11 | ||||
-rw-r--r-- | include/uapi/linux/usb/ch9.h | 2 |
22 files changed, 151 insertions, 148 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 5eb1a87228b4..31ccdccd7a04 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -75,8 +75,6 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | |||
75 | * be the first thing immediately following the endpoint descriptor. | 75 | * be the first thing immediately following the endpoint descriptor. |
76 | */ | 76 | */ |
77 | desc = (struct usb_ss_ep_comp_descriptor *) buffer; | 77 | desc = (struct usb_ss_ep_comp_descriptor *) buffer; |
78 | buffer += desc->bLength; | ||
79 | size -= desc->bLength; | ||
80 | 78 | ||
81 | if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP || | 79 | if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP || |
82 | size < USB_DT_SS_EP_COMP_SIZE) { | 80 | size < USB_DT_SS_EP_COMP_SIZE) { |
@@ -100,7 +98,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | |||
100 | ep->desc.wMaxPacketSize; | 98 | ep->desc.wMaxPacketSize; |
101 | return; | 99 | return; |
102 | } | 100 | } |
103 | 101 | buffer += desc->bLength; | |
102 | size -= desc->bLength; | ||
104 | memcpy(&ep->ss_ep_comp, desc, USB_DT_SS_EP_COMP_SIZE); | 103 | memcpy(&ep->ss_ep_comp, desc, USB_DT_SS_EP_COMP_SIZE); |
105 | 104 | ||
106 | /* Check the various values */ | 105 | /* Check the various values */ |
@@ -146,12 +145,6 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | |||
146 | ep->ss_ep_comp.bmAttributes = 2; | 145 | ep->ss_ep_comp.bmAttributes = 2; |
147 | } | 146 | } |
148 | 147 | ||
149 | /* Parse a possible SuperSpeedPlus isoc ep companion descriptor */ | ||
150 | if (usb_endpoint_xfer_isoc(&ep->desc) && | ||
151 | USB_SS_SSP_ISOC_COMP(desc->bmAttributes)) | ||
152 | usb_parse_ssp_isoc_endpoint_companion(ddev, cfgno, inum, asnum, | ||
153 | ep, buffer, size); | ||
154 | |||
155 | if (usb_endpoint_xfer_isoc(&ep->desc)) | 148 | if (usb_endpoint_xfer_isoc(&ep->desc)) |
156 | max_tx = (desc->bMaxBurst + 1) * | 149 | max_tx = (desc->bMaxBurst + 1) * |
157 | (USB_SS_MULT(desc->bmAttributes)) * | 150 | (USB_SS_MULT(desc->bmAttributes)) * |
@@ -171,6 +164,11 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | |||
171 | max_tx); | 164 | max_tx); |
172 | ep->ss_ep_comp.wBytesPerInterval = cpu_to_le16(max_tx); | 165 | ep->ss_ep_comp.wBytesPerInterval = cpu_to_le16(max_tx); |
173 | } | 166 | } |
167 | /* Parse a possible SuperSpeedPlus isoc ep companion descriptor */ | ||
168 | if (usb_endpoint_xfer_isoc(&ep->desc) && | ||
169 | USB_SS_SSP_ISOC_COMP(desc->bmAttributes)) | ||
170 | usb_parse_ssp_isoc_endpoint_companion(ddev, cfgno, inum, asnum, | ||
171 | ep, buffer, size); | ||
174 | } | 172 | } |
175 | 173 | ||
176 | static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | 174 | static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, |
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index e9940dd004e4..818f158232bb 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
@@ -2254,6 +2254,7 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, | |||
2254 | { | 2254 | { |
2255 | u32 intmsk; | 2255 | u32 intmsk; |
2256 | u32 val; | 2256 | u32 val; |
2257 | u32 usbcfg; | ||
2257 | 2258 | ||
2258 | /* Kill any ep0 requests as controller will be reinitialized */ | 2259 | /* Kill any ep0 requests as controller will be reinitialized */ |
2259 | kill_all_requests(hsotg, hsotg->eps_out[0], -ECONNRESET); | 2260 | kill_all_requests(hsotg, hsotg->eps_out[0], -ECONNRESET); |
@@ -2267,10 +2268,16 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, | |||
2267 | * set configuration. | 2268 | * set configuration. |
2268 | */ | 2269 | */ |
2269 | 2270 | ||
2271 | /* keep other bits untouched (so e.g. forced modes are not lost) */ | ||
2272 | usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); | ||
2273 | usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | | ||
2274 | GUSBCFG_HNPCAP); | ||
2275 | |||
2270 | /* set the PLL on, remove the HNP/SRP and set the PHY */ | 2276 | /* set the PLL on, remove the HNP/SRP and set the PHY */ |
2271 | val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; | 2277 | val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; |
2272 | dwc2_writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | | 2278 | usbcfg |= hsotg->phyif | GUSBCFG_TOUTCAL(7) | |
2273 | (val << GUSBCFG_USBTRDTIM_SHIFT), hsotg->regs + GUSBCFG); | 2279 | (val << GUSBCFG_USBTRDTIM_SHIFT); |
2280 | dwc2_writel(usbcfg, hsotg->regs + GUSBCFG); | ||
2274 | 2281 | ||
2275 | dwc2_hsotg_init_fifo(hsotg); | 2282 | dwc2_hsotg_init_fifo(hsotg); |
2276 | 2283 | ||
@@ -3031,6 +3038,7 @@ static struct usb_ep_ops dwc2_hsotg_ep_ops = { | |||
3031 | static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg) | 3038 | static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg) |
3032 | { | 3039 | { |
3033 | u32 trdtim; | 3040 | u32 trdtim; |
3041 | u32 usbcfg; | ||
3034 | /* unmask subset of endpoint interrupts */ | 3042 | /* unmask subset of endpoint interrupts */ |
3035 | 3043 | ||
3036 | dwc2_writel(DIEPMSK_TIMEOUTMSK | DIEPMSK_AHBERRMSK | | 3044 | dwc2_writel(DIEPMSK_TIMEOUTMSK | DIEPMSK_AHBERRMSK | |
@@ -3054,11 +3062,16 @@ static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg) | |||
3054 | 3062 | ||
3055 | dwc2_hsotg_init_fifo(hsotg); | 3063 | dwc2_hsotg_init_fifo(hsotg); |
3056 | 3064 | ||
3065 | /* keep other bits untouched (so e.g. forced modes are not lost) */ | ||
3066 | usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); | ||
3067 | usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | | ||
3068 | GUSBCFG_HNPCAP); | ||
3069 | |||
3057 | /* set the PLL on, remove the HNP/SRP and set the PHY */ | 3070 | /* set the PLL on, remove the HNP/SRP and set the PHY */ |
3058 | trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; | 3071 | trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; |
3059 | dwc2_writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | | 3072 | usbcfg |= hsotg->phyif | GUSBCFG_TOUTCAL(7) | |
3060 | (trdtim << GUSBCFG_USBTRDTIM_SHIFT), | 3073 | (trdtim << GUSBCFG_USBTRDTIM_SHIFT); |
3061 | hsotg->regs + GUSBCFG); | 3074 | dwc2_writel(usbcfg, hsotg->regs + GUSBCFG); |
3062 | 3075 | ||
3063 | if (using_dma(hsotg)) | 3076 | if (using_dma(hsotg)) |
3064 | __orr32(hsotg->regs + GAHBCFG, GAHBCFG_DMA_EN); | 3077 | __orr32(hsotg->regs + GAHBCFG, GAHBCFG_DMA_EN); |
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 17fd81447c9f..fa20f5a99d12 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
@@ -67,23 +67,9 @@ void dwc3_set_mode(struct dwc3 *dwc, u32 mode) | |||
67 | static int dwc3_core_soft_reset(struct dwc3 *dwc) | 67 | static int dwc3_core_soft_reset(struct dwc3 *dwc) |
68 | { | 68 | { |
69 | u32 reg; | 69 | u32 reg; |
70 | int retries = 1000; | ||
70 | int ret; | 71 | int ret; |
71 | 72 | ||
72 | /* Before Resetting PHY, put Core in Reset */ | ||
73 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); | ||
74 | reg |= DWC3_GCTL_CORESOFTRESET; | ||
75 | dwc3_writel(dwc->regs, DWC3_GCTL, reg); | ||
76 | |||
77 | /* Assert USB3 PHY reset */ | ||
78 | reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); | ||
79 | reg |= DWC3_GUSB3PIPECTL_PHYSOFTRST; | ||
80 | dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); | ||
81 | |||
82 | /* Assert USB2 PHY reset */ | ||
83 | reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); | ||
84 | reg |= DWC3_GUSB2PHYCFG_PHYSOFTRST; | ||
85 | dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); | ||
86 | |||
87 | usb_phy_init(dwc->usb2_phy); | 73 | usb_phy_init(dwc->usb2_phy); |
88 | usb_phy_init(dwc->usb3_phy); | 74 | usb_phy_init(dwc->usb3_phy); |
89 | ret = phy_init(dwc->usb2_generic_phy); | 75 | ret = phy_init(dwc->usb2_generic_phy); |
@@ -95,26 +81,28 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) | |||
95 | phy_exit(dwc->usb2_generic_phy); | 81 | phy_exit(dwc->usb2_generic_phy); |
96 | return ret; | 82 | return ret; |
97 | } | 83 | } |
98 | mdelay(100); | ||
99 | 84 | ||
100 | /* Clear USB3 PHY reset */ | 85 | /* |
101 | reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); | 86 | * We're resetting only the device side because, if we're in host mode, |
102 | reg &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST; | 87 | * XHCI driver will reset the host block. If dwc3 was configured for |
103 | dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); | 88 | * host-only mode, then we can return early. |
89 | */ | ||
90 | if (dwc->dr_mode == USB_DR_MODE_HOST) | ||
91 | return 0; | ||
104 | 92 | ||
105 | /* Clear USB2 PHY reset */ | 93 | reg = dwc3_readl(dwc->regs, DWC3_DCTL); |
106 | reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); | 94 | reg |= DWC3_DCTL_CSFTRST; |
107 | reg &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST; | 95 | dwc3_writel(dwc->regs, DWC3_DCTL, reg); |
108 | dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); | ||
109 | 96 | ||
110 | mdelay(100); | 97 | do { |
98 | reg = dwc3_readl(dwc->regs, DWC3_DCTL); | ||
99 | if (!(reg & DWC3_DCTL_CSFTRST)) | ||
100 | return 0; | ||
111 | 101 | ||
112 | /* After PHYs are stable we can take Core out of reset state */ | 102 | udelay(1); |
113 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); | 103 | } while (--retries); |
114 | reg &= ~DWC3_GCTL_CORESOFTRESET; | ||
115 | dwc3_writel(dwc->regs, DWC3_GCTL, reg); | ||
116 | 104 | ||
117 | return 0; | 105 | return -ETIMEDOUT; |
118 | } | 106 | } |
119 | 107 | ||
120 | /** | 108 | /** |
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c index 2be268d2423d..72664700b8a2 100644 --- a/drivers/usb/dwc3/dwc3-keystone.c +++ b/drivers/usb/dwc3/dwc3-keystone.c | |||
@@ -39,8 +39,6 @@ | |||
39 | #define USBSS_IRQ_COREIRQ_EN BIT(0) | 39 | #define USBSS_IRQ_COREIRQ_EN BIT(0) |
40 | #define USBSS_IRQ_COREIRQ_CLR BIT(0) | 40 | #define USBSS_IRQ_COREIRQ_CLR BIT(0) |
41 | 41 | ||
42 | static u64 kdwc3_dma_mask; | ||
43 | |||
44 | struct dwc3_keystone { | 42 | struct dwc3_keystone { |
45 | struct device *dev; | 43 | struct device *dev; |
46 | struct clk *clk; | 44 | struct clk *clk; |
@@ -108,9 +106,6 @@ static int kdwc3_probe(struct platform_device *pdev) | |||
108 | if (IS_ERR(kdwc->usbss)) | 106 | if (IS_ERR(kdwc->usbss)) |
109 | return PTR_ERR(kdwc->usbss); | 107 | return PTR_ERR(kdwc->usbss); |
110 | 108 | ||
111 | kdwc3_dma_mask = dma_get_mask(dev); | ||
112 | dev->dma_mask = &kdwc3_dma_mask; | ||
113 | |||
114 | kdwc->clk = devm_clk_get(kdwc->dev, "usb"); | 109 | kdwc->clk = devm_clk_get(kdwc->dev, "usb"); |
115 | 110 | ||
116 | error = clk_prepare_enable(kdwc->clk); | 111 | error = clk_prepare_enable(kdwc->clk); |
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 009d83048c8c..adc1e8a624cb 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 | 35 | #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 |
36 | #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 | 36 | #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 |
37 | #define PCI_DEVICE_ID_INTEL_BXT 0x0aaa | 37 | #define PCI_DEVICE_ID_INTEL_BXT 0x0aaa |
38 | #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa | ||
38 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa | 39 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa |
39 | 40 | ||
40 | static const struct acpi_gpio_params reset_gpios = { 0, 0, false }; | 41 | static const struct acpi_gpio_params reset_gpios = { 0, 0, false }; |
@@ -213,6 +214,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = { | |||
213 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), }, | 214 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), }, |
214 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), }, | 215 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), }, |
215 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT), }, | 216 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT), }, |
217 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT_M), }, | ||
216 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), }, | 218 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), }, |
217 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, | 219 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, |
218 | { } /* Terminating Entry */ | 220 | { } /* Terminating Entry */ |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3ac170f9d94d..d54a028cdfeb 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -568,7 +568,7 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, | |||
568 | dwc3_writel(dwc->regs, DWC3_DALEPENA, reg); | 568 | dwc3_writel(dwc->regs, DWC3_DALEPENA, reg); |
569 | 569 | ||
570 | if (!usb_endpoint_xfer_isoc(desc)) | 570 | if (!usb_endpoint_xfer_isoc(desc)) |
571 | return 0; | 571 | goto out; |
572 | 572 | ||
573 | /* Link TRB for ISOC. The HWO bit is never reset */ | 573 | /* Link TRB for ISOC. The HWO bit is never reset */ |
574 | trb_st_hw = &dep->trb_pool[0]; | 574 | trb_st_hw = &dep->trb_pool[0]; |
@@ -582,9 +582,10 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, | |||
582 | trb_link->ctrl |= DWC3_TRB_CTRL_HWO; | 582 | trb_link->ctrl |= DWC3_TRB_CTRL_HWO; |
583 | } | 583 | } |
584 | 584 | ||
585 | out: | ||
585 | switch (usb_endpoint_type(desc)) { | 586 | switch (usb_endpoint_type(desc)) { |
586 | case USB_ENDPOINT_XFER_CONTROL: | 587 | case USB_ENDPOINT_XFER_CONTROL: |
587 | strlcat(dep->name, "-control", sizeof(dep->name)); | 588 | /* don't change name */ |
588 | break; | 589 | break; |
589 | case USB_ENDPOINT_XFER_ISOC: | 590 | case USB_ENDPOINT_XFER_ISOC: |
590 | strlcat(dep->name, "-isoc", sizeof(dep->name)); | 591 | strlcat(dep->name, "-isoc", sizeof(dep->name)); |
@@ -2487,7 +2488,11 @@ static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc) | |||
2487 | * implemented. | 2488 | * implemented. |
2488 | */ | 2489 | */ |
2489 | 2490 | ||
2490 | dwc->gadget_driver->resume(&dwc->gadget); | 2491 | if (dwc->gadget_driver && dwc->gadget_driver->resume) { |
2492 | spin_unlock(&dwc->lock); | ||
2493 | dwc->gadget_driver->resume(&dwc->gadget); | ||
2494 | spin_lock(&dwc->lock); | ||
2495 | } | ||
2491 | } | 2496 | } |
2492 | 2497 | ||
2493 | static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc, | 2498 | static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc, |
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index a5c62093c26c..de9ffd60fcfa 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
@@ -656,7 +656,8 @@ static int bos_desc(struct usb_composite_dev *cdev) | |||
656 | ssp_cap->bmAttributes = cpu_to_le32(1); | 656 | ssp_cap->bmAttributes = cpu_to_le32(1); |
657 | 657 | ||
658 | /* Min RX/TX Lane Count = 1 */ | 658 | /* Min RX/TX Lane Count = 1 */ |
659 | ssp_cap->wFunctionalitySupport = (1 << 8) | (1 << 12); | 659 | ssp_cap->wFunctionalitySupport = |
660 | cpu_to_le16((1 << 8) | (1 << 12)); | ||
660 | 661 | ||
661 | /* | 662 | /* |
662 | * bmSublinkSpeedAttr[0]: | 663 | * bmSublinkSpeedAttr[0]: |
@@ -666,7 +667,7 @@ static int bos_desc(struct usb_composite_dev *cdev) | |||
666 | * LSM = 10 (10 Gbps) | 667 | * LSM = 10 (10 Gbps) |
667 | */ | 668 | */ |
668 | ssp_cap->bmSublinkSpeedAttr[0] = | 669 | ssp_cap->bmSublinkSpeedAttr[0] = |
669 | (3 << 4) | (1 << 14) | (0xa << 16); | 670 | cpu_to_le32((3 << 4) | (1 << 14) | (0xa << 16)); |
670 | /* | 671 | /* |
671 | * bmSublinkSpeedAttr[1] = | 672 | * bmSublinkSpeedAttr[1] = |
672 | * ST = Symmetric, TX | 673 | * ST = Symmetric, TX |
@@ -675,7 +676,8 @@ static int bos_desc(struct usb_composite_dev *cdev) | |||
675 | * LSM = 10 (10 Gbps) | 676 | * LSM = 10 (10 Gbps) |
676 | */ | 677 | */ |
677 | ssp_cap->bmSublinkSpeedAttr[1] = | 678 | ssp_cap->bmSublinkSpeedAttr[1] = |
678 | (3 << 4) | (1 << 14) | (0xa << 16) | (1 << 7); | 679 | cpu_to_le32((3 << 4) | (1 << 14) | |
680 | (0xa << 16) | (1 << 7)); | ||
679 | } | 681 | } |
680 | 682 | ||
681 | return le16_to_cpu(bos->wTotalLength); | 683 | return le16_to_cpu(bos->wTotalLength); |
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 84c0ee5ebd1e..58fc199a18ec 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/kfifo.h> | 26 | #include <linux/kfifo.h> |
27 | #include <linux/spinlock.h> | ||
27 | 28 | ||
28 | #include <sound/core.h> | 29 | #include <sound/core.h> |
29 | #include <sound/initval.h> | 30 | #include <sound/initval.h> |
@@ -89,6 +90,7 @@ struct f_midi { | |||
89 | unsigned int buflen, qlen; | 90 | unsigned int buflen, qlen; |
90 | /* This fifo is used as a buffer ring for pre-allocated IN usb_requests */ | 91 | /* This fifo is used as a buffer ring for pre-allocated IN usb_requests */ |
91 | DECLARE_KFIFO_PTR(in_req_fifo, struct usb_request *); | 92 | DECLARE_KFIFO_PTR(in_req_fifo, struct usb_request *); |
93 | spinlock_t transmit_lock; | ||
92 | unsigned int in_last_port; | 94 | unsigned int in_last_port; |
93 | 95 | ||
94 | struct gmidi_in_port in_ports_array[/* in_ports */]; | 96 | struct gmidi_in_port in_ports_array[/* in_ports */]; |
@@ -358,7 +360,9 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | |||
358 | /* allocate a bunch of read buffers and queue them all at once. */ | 360 | /* allocate a bunch of read buffers and queue them all at once. */ |
359 | for (i = 0; i < midi->qlen && err == 0; i++) { | 361 | for (i = 0; i < midi->qlen && err == 0; i++) { |
360 | struct usb_request *req = | 362 | struct usb_request *req = |
361 | midi_alloc_ep_req(midi->out_ep, midi->buflen); | 363 | midi_alloc_ep_req(midi->out_ep, |
364 | max_t(unsigned, midi->buflen, | ||
365 | bulk_out_desc.wMaxPacketSize)); | ||
362 | if (req == NULL) | 366 | if (req == NULL) |
363 | return -ENOMEM; | 367 | return -ENOMEM; |
364 | 368 | ||
@@ -597,17 +601,24 @@ static void f_midi_transmit(struct f_midi *midi) | |||
597 | { | 601 | { |
598 | struct usb_ep *ep = midi->in_ep; | 602 | struct usb_ep *ep = midi->in_ep; |
599 | int ret; | 603 | int ret; |
604 | unsigned long flags; | ||
600 | 605 | ||
601 | /* We only care about USB requests if IN endpoint is enabled */ | 606 | /* We only care about USB requests if IN endpoint is enabled */ |
602 | if (!ep || !ep->enabled) | 607 | if (!ep || !ep->enabled) |
603 | goto drop_out; | 608 | goto drop_out; |
604 | 609 | ||
610 | spin_lock_irqsave(&midi->transmit_lock, flags); | ||
611 | |||
605 | do { | 612 | do { |
606 | ret = f_midi_do_transmit(midi, ep); | 613 | ret = f_midi_do_transmit(midi, ep); |
607 | if (ret < 0) | 614 | if (ret < 0) { |
615 | spin_unlock_irqrestore(&midi->transmit_lock, flags); | ||
608 | goto drop_out; | 616 | goto drop_out; |
617 | } | ||
609 | } while (ret); | 618 | } while (ret); |
610 | 619 | ||
620 | spin_unlock_irqrestore(&midi->transmit_lock, flags); | ||
621 | |||
611 | return; | 622 | return; |
612 | 623 | ||
613 | drop_out: | 624 | drop_out: |
@@ -1201,6 +1212,8 @@ static struct usb_function *f_midi_alloc(struct usb_function_instance *fi) | |||
1201 | if (status) | 1212 | if (status) |
1202 | goto setup_fail; | 1213 | goto setup_fail; |
1203 | 1214 | ||
1215 | spin_lock_init(&midi->transmit_lock); | ||
1216 | |||
1204 | ++opts->refcnt; | 1217 | ++opts->refcnt; |
1205 | mutex_unlock(&opts->lock); | 1218 | mutex_unlock(&opts->lock); |
1206 | 1219 | ||
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 81d42cce885a..18569de06b04 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c | |||
@@ -1045,20 +1045,6 @@ static void reset_all_endpoints(struct usba_udc *udc) | |||
1045 | list_del_init(&req->queue); | 1045 | list_del_init(&req->queue); |
1046 | request_complete(ep, req, -ECONNRESET); | 1046 | request_complete(ep, req, -ECONNRESET); |
1047 | } | 1047 | } |
1048 | |||
1049 | /* NOTE: normally, the next call to the gadget driver is in | ||
1050 | * charge of disabling endpoints... usually disconnect(). | ||
1051 | * The exception would be entering a high speed test mode. | ||
1052 | * | ||
1053 | * FIXME remove this code ... and retest thoroughly. | ||
1054 | */ | ||
1055 | list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) { | ||
1056 | if (ep->ep.desc) { | ||
1057 | spin_unlock(&udc->lock); | ||
1058 | usba_ep_disable(&ep->ep); | ||
1059 | spin_lock(&udc->lock); | ||
1060 | } | ||
1061 | } | ||
1062 | } | 1048 | } |
1063 | 1049 | ||
1064 | static struct usba_ep *get_ep_by_addr(struct usba_udc *udc, u16 wIndex) | 1050 | static struct usba_ep *get_ep_by_addr(struct usba_udc *udc, u16 wIndex) |
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c index 4151597e9d28..e4e70e11d0f6 100644 --- a/drivers/usb/gadget/udc/udc-core.c +++ b/drivers/usb/gadget/udc/udc-core.c | |||
@@ -371,12 +371,6 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget, | |||
371 | INIT_WORK(&gadget->work, usb_gadget_state_work); | 371 | INIT_WORK(&gadget->work, usb_gadget_state_work); |
372 | gadget->dev.parent = parent; | 372 | gadget->dev.parent = parent; |
373 | 373 | ||
374 | #ifdef CONFIG_HAS_DMA | ||
375 | dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask); | ||
376 | gadget->dev.dma_parms = parent->dma_parms; | ||
377 | gadget->dev.dma_mask = parent->dma_mask; | ||
378 | #endif | ||
379 | |||
380 | if (release) | 374 | if (release) |
381 | gadget->dev.release = release; | 375 | gadget->dev.release = release; |
382 | else | 376 | else |
diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c index 579587d97217..3d7af85aecb9 100644 --- a/drivers/usb/phy/phy-qcom-8x16-usb.c +++ b/drivers/usb/phy/phy-qcom-8x16-usb.c | |||
@@ -65,9 +65,7 @@ struct phy_8x16 { | |||
65 | void __iomem *regs; | 65 | void __iomem *regs; |
66 | struct clk *core_clk; | 66 | struct clk *core_clk; |
67 | struct clk *iface_clk; | 67 | struct clk *iface_clk; |
68 | struct regulator *v3p3; | 68 | struct regulator_bulk_data regulator[3]; |
69 | struct regulator *v1p8; | ||
70 | struct regulator *vdd; | ||
71 | 69 | ||
72 | struct reset_control *phy_reset; | 70 | struct reset_control *phy_reset; |
73 | 71 | ||
@@ -78,51 +76,6 @@ struct phy_8x16 { | |||
78 | struct notifier_block reboot_notify; | 76 | struct notifier_block reboot_notify; |
79 | }; | 77 | }; |
80 | 78 | ||
81 | static int phy_8x16_regulators_enable(struct phy_8x16 *qphy) | ||
82 | { | ||
83 | int ret; | ||
84 | |||
85 | ret = regulator_set_voltage(qphy->vdd, HSPHY_VDD_MIN, HSPHY_VDD_MAX); | ||
86 | if (ret) | ||
87 | return ret; | ||
88 | |||
89 | ret = regulator_enable(qphy->vdd); | ||
90 | if (ret) | ||
91 | return ret; | ||
92 | |||
93 | ret = regulator_set_voltage(qphy->v3p3, HSPHY_3P3_MIN, HSPHY_3P3_MAX); | ||
94 | if (ret) | ||
95 | goto off_vdd; | ||
96 | |||
97 | ret = regulator_enable(qphy->v3p3); | ||
98 | if (ret) | ||
99 | goto off_vdd; | ||
100 | |||
101 | ret = regulator_set_voltage(qphy->v1p8, HSPHY_1P8_MIN, HSPHY_1P8_MAX); | ||
102 | if (ret) | ||
103 | goto off_3p3; | ||
104 | |||
105 | ret = regulator_enable(qphy->v1p8); | ||
106 | if (ret) | ||
107 | goto off_3p3; | ||
108 | |||
109 | return 0; | ||
110 | |||
111 | off_3p3: | ||
112 | regulator_disable(qphy->v3p3); | ||
113 | off_vdd: | ||
114 | regulator_disable(qphy->vdd); | ||
115 | |||
116 | return ret; | ||
117 | } | ||
118 | |||
119 | static void phy_8x16_regulators_disable(struct phy_8x16 *qphy) | ||
120 | { | ||
121 | regulator_disable(qphy->v1p8); | ||
122 | regulator_disable(qphy->v3p3); | ||
123 | regulator_disable(qphy->vdd); | ||
124 | } | ||
125 | |||
126 | static int phy_8x16_notify_connect(struct usb_phy *phy, | 79 | static int phy_8x16_notify_connect(struct usb_phy *phy, |
127 | enum usb_device_speed speed) | 80 | enum usb_device_speed speed) |
128 | { | 81 | { |
@@ -261,7 +214,6 @@ static void phy_8x16_shutdown(struct usb_phy *phy) | |||
261 | 214 | ||
262 | static int phy_8x16_read_devicetree(struct phy_8x16 *qphy) | 215 | static int phy_8x16_read_devicetree(struct phy_8x16 *qphy) |
263 | { | 216 | { |
264 | struct regulator_bulk_data regs[3]; | ||
265 | struct device *dev = qphy->phy.dev; | 217 | struct device *dev = qphy->phy.dev; |
266 | int ret; | 218 | int ret; |
267 | 219 | ||
@@ -273,18 +225,15 @@ static int phy_8x16_read_devicetree(struct phy_8x16 *qphy) | |||
273 | if (IS_ERR(qphy->iface_clk)) | 225 | if (IS_ERR(qphy->iface_clk)) |
274 | return PTR_ERR(qphy->iface_clk); | 226 | return PTR_ERR(qphy->iface_clk); |
275 | 227 | ||
276 | regs[0].supply = "v3p3"; | 228 | qphy->regulator[0].supply = "v3p3"; |
277 | regs[1].supply = "v1p8"; | 229 | qphy->regulator[1].supply = "v1p8"; |
278 | regs[2].supply = "vddcx"; | 230 | qphy->regulator[2].supply = "vddcx"; |
279 | 231 | ||
280 | ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(regs), regs); | 232 | ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(qphy->regulator), |
233 | qphy->regulator); | ||
281 | if (ret) | 234 | if (ret) |
282 | return ret; | 235 | return ret; |
283 | 236 | ||
284 | qphy->v3p3 = regs[0].consumer; | ||
285 | qphy->v1p8 = regs[1].consumer; | ||
286 | qphy->vdd = regs[2].consumer; | ||
287 | |||
288 | qphy->phy_reset = devm_reset_control_get(dev, "phy"); | 237 | qphy->phy_reset = devm_reset_control_get(dev, "phy"); |
289 | if (IS_ERR(qphy->phy_reset)) | 238 | if (IS_ERR(qphy->phy_reset)) |
290 | return PTR_ERR(qphy->phy_reset); | 239 | return PTR_ERR(qphy->phy_reset); |
@@ -364,8 +313,9 @@ static int phy_8x16_probe(struct platform_device *pdev) | |||
364 | if (ret < 0) | 313 | if (ret < 0) |
365 | goto off_core; | 314 | goto off_core; |
366 | 315 | ||
367 | ret = phy_8x16_regulators_enable(qphy); | 316 | ret = regulator_bulk_enable(ARRAY_SIZE(qphy->regulator), |
368 | if (0 && ret) | 317 | qphy->regulator); |
318 | if (WARN_ON(ret)) | ||
369 | goto off_clks; | 319 | goto off_clks; |
370 | 320 | ||
371 | qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify; | 321 | qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify; |
@@ -387,7 +337,7 @@ off_extcon: | |||
387 | extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB, | 337 | extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB, |
388 | &qphy->vbus_notify); | 338 | &qphy->vbus_notify); |
389 | off_power: | 339 | off_power: |
390 | phy_8x16_regulators_disable(qphy); | 340 | regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); |
391 | off_clks: | 341 | off_clks: |
392 | clk_disable_unprepare(qphy->iface_clk); | 342 | clk_disable_unprepare(qphy->iface_clk); |
393 | off_core: | 343 | off_core: |
@@ -413,7 +363,7 @@ static int phy_8x16_remove(struct platform_device *pdev) | |||
413 | 363 | ||
414 | clk_disable_unprepare(qphy->iface_clk); | 364 | clk_disable_unprepare(qphy->iface_clk); |
415 | clk_disable_unprepare(qphy->core_clk); | 365 | clk_disable_unprepare(qphy->core_clk); |
416 | phy_8x16_regulators_disable(qphy); | 366 | regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); |
417 | return 0; | 367 | return 0; |
418 | } | 368 | } |
419 | 369 | ||
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index b4de70ee16d3..000f9750149f 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -190,7 +190,8 @@ static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type) | |||
190 | goto __usbhs_pkt_handler_end; | 190 | goto __usbhs_pkt_handler_end; |
191 | } | 191 | } |
192 | 192 | ||
193 | ret = func(pkt, &is_done); | 193 | if (likely(func)) |
194 | ret = func(pkt, &is_done); | ||
194 | 195 | ||
195 | if (is_done) | 196 | if (is_done) |
196 | __usbhsf_pkt_del(pkt); | 197 | __usbhsf_pkt_del(pkt); |
@@ -889,6 +890,7 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done) | |||
889 | 890 | ||
890 | pkt->trans = len; | 891 | pkt->trans = len; |
891 | 892 | ||
893 | usbhsf_tx_irq_ctrl(pipe, 0); | ||
892 | INIT_WORK(&pkt->work, xfer_work); | 894 | INIT_WORK(&pkt->work, xfer_work); |
893 | schedule_work(&pkt->work); | 895 | schedule_work(&pkt->work); |
894 | 896 | ||
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 664b263e4b20..53d104b56ef1 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
@@ -158,10 +158,14 @@ static void usbhsg_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt) | |||
158 | struct usbhs_pipe *pipe = pkt->pipe; | 158 | struct usbhs_pipe *pipe = pkt->pipe; |
159 | struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe); | 159 | struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe); |
160 | struct usbhsg_request *ureq = usbhsg_pkt_to_ureq(pkt); | 160 | struct usbhsg_request *ureq = usbhsg_pkt_to_ureq(pkt); |
161 | unsigned long flags; | ||
161 | 162 | ||
162 | ureq->req.actual = pkt->actual; | 163 | ureq->req.actual = pkt->actual; |
163 | 164 | ||
164 | usbhsg_queue_pop(uep, ureq, 0); | 165 | usbhs_lock(priv, flags); |
166 | if (uep) | ||
167 | __usbhsg_queue_pop(uep, ureq, 0); | ||
168 | usbhs_unlock(priv, flags); | ||
165 | } | 169 | } |
166 | 170 | ||
167 | static void usbhsg_queue_push(struct usbhsg_uep *uep, | 171 | static void usbhsg_queue_push(struct usbhsg_uep *uep, |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index fbfe761c7fba..dd47823bb014 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -165,6 +165,7 @@ static const struct usb_device_id id_table[] = { | |||
165 | { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ | 165 | { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ |
166 | { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ | 166 | { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ |
167 | { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ | 167 | { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ |
168 | { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ | ||
168 | { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ | 169 | { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ |
169 | { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ | 170 | { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ |
170 | { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ | 171 | { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ |
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index b283eb8b86d6..bbeeb2bd55a8 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -447,6 +447,11 @@ static int cypress_generic_port_probe(struct usb_serial_port *port) | |||
447 | struct usb_serial *serial = port->serial; | 447 | struct usb_serial *serial = port->serial; |
448 | struct cypress_private *priv; | 448 | struct cypress_private *priv; |
449 | 449 | ||
450 | if (!port->interrupt_out_urb || !port->interrupt_in_urb) { | ||
451 | dev_err(&port->dev, "required endpoint is missing\n"); | ||
452 | return -ENODEV; | ||
453 | } | ||
454 | |||
450 | priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL); | 455 | priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL); |
451 | if (!priv) | 456 | if (!priv) |
452 | return -ENOMEM; | 457 | return -ENOMEM; |
@@ -606,12 +611,6 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
606 | cypress_set_termios(tty, port, &priv->tmp_termios); | 611 | cypress_set_termios(tty, port, &priv->tmp_termios); |
607 | 612 | ||
608 | /* setup the port and start reading from the device */ | 613 | /* setup the port and start reading from the device */ |
609 | if (!port->interrupt_in_urb) { | ||
610 | dev_err(&port->dev, "%s - interrupt_in_urb is empty!\n", | ||
611 | __func__); | ||
612 | return -1; | ||
613 | } | ||
614 | |||
615 | usb_fill_int_urb(port->interrupt_in_urb, serial->dev, | 614 | usb_fill_int_urb(port->interrupt_in_urb, serial->dev, |
616 | usb_rcvintpipe(serial->dev, port->interrupt_in_endpointAddress), | 615 | usb_rcvintpipe(serial->dev, port->interrupt_in_endpointAddress), |
617 | port->interrupt_in_urb->transfer_buffer, | 616 | port->interrupt_in_urb->transfer_buffer, |
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 010a42a92688..16e8e37b3b36 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c | |||
@@ -1251,8 +1251,27 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num) | |||
1251 | 1251 | ||
1252 | static int digi_startup(struct usb_serial *serial) | 1252 | static int digi_startup(struct usb_serial *serial) |
1253 | { | 1253 | { |
1254 | struct device *dev = &serial->interface->dev; | ||
1254 | struct digi_serial *serial_priv; | 1255 | struct digi_serial *serial_priv; |
1255 | int ret; | 1256 | int ret; |
1257 | int i; | ||
1258 | |||
1259 | /* check whether the device has the expected number of endpoints */ | ||
1260 | if (serial->num_port_pointers < serial->type->num_ports + 1) { | ||
1261 | dev_err(dev, "OOB endpoints missing\n"); | ||
1262 | return -ENODEV; | ||
1263 | } | ||
1264 | |||
1265 | for (i = 0; i < serial->type->num_ports + 1 ; i++) { | ||
1266 | if (!serial->port[i]->read_urb) { | ||
1267 | dev_err(dev, "bulk-in endpoint missing\n"); | ||
1268 | return -ENODEV; | ||
1269 | } | ||
1270 | if (!serial->port[i]->write_urb) { | ||
1271 | dev_err(dev, "bulk-out endpoint missing\n"); | ||
1272 | return -ENODEV; | ||
1273 | } | ||
1274 | } | ||
1256 | 1275 | ||
1257 | serial_priv = kzalloc(sizeof(*serial_priv), GFP_KERNEL); | 1276 | serial_priv = kzalloc(sizeof(*serial_priv), GFP_KERNEL); |
1258 | if (!serial_priv) | 1277 | if (!serial_priv) |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 427ae43ee898..3a814e802dee 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -1004,6 +1004,10 @@ static const struct usb_device_id id_table_combined[] = { | |||
1004 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, | 1004 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, |
1005 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, | 1005 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, |
1006 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, | 1006 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, |
1007 | /* ICP DAS I-756xU devices */ | ||
1008 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, | ||
1009 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, | ||
1010 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, | ||
1007 | { } /* Terminating entry */ | 1011 | { } /* Terminating entry */ |
1008 | }; | 1012 | }; |
1009 | 1013 | ||
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index a84df2513994..c5d6c1e73e8e 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -872,6 +872,14 @@ | |||
872 | #define NOVITUS_BONO_E_PID 0x6010 | 872 | #define NOVITUS_BONO_E_PID 0x6010 |
873 | 873 | ||
874 | /* | 874 | /* |
875 | * ICPDAS I-756*U devices | ||
876 | */ | ||
877 | #define ICPDAS_VID 0x1b5c | ||
878 | #define ICPDAS_I7560U_PID 0x0103 | ||
879 | #define ICPDAS_I7561U_PID 0x0104 | ||
880 | #define ICPDAS_I7563U_PID 0x0105 | ||
881 | |||
882 | /* | ||
875 | * RT Systems programming cables for various ham radios | 883 | * RT Systems programming cables for various ham radios |
876 | */ | 884 | */ |
877 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | 885 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 4446b8d70ac2..885655315de1 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -376,14 +376,21 @@ static void mct_u232_msr_to_state(struct usb_serial_port *port, | |||
376 | 376 | ||
377 | static int mct_u232_port_probe(struct usb_serial_port *port) | 377 | static int mct_u232_port_probe(struct usb_serial_port *port) |
378 | { | 378 | { |
379 | struct usb_serial *serial = port->serial; | ||
379 | struct mct_u232_private *priv; | 380 | struct mct_u232_private *priv; |
380 | 381 | ||
382 | /* check first to simplify error handling */ | ||
383 | if (!serial->port[1] || !serial->port[1]->interrupt_in_urb) { | ||
384 | dev_err(&port->dev, "expected endpoint missing\n"); | ||
385 | return -ENODEV; | ||
386 | } | ||
387 | |||
381 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 388 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
382 | if (!priv) | 389 | if (!priv) |
383 | return -ENOMEM; | 390 | return -ENOMEM; |
384 | 391 | ||
385 | /* Use second interrupt-in endpoint for reading. */ | 392 | /* Use second interrupt-in endpoint for reading. */ |
386 | priv->read_urb = port->serial->port[1]->interrupt_in_urb; | 393 | priv->read_urb = serial->port[1]->interrupt_in_urb; |
387 | priv->read_urb->context = port; | 394 | priv->read_urb->context = port; |
388 | 395 | ||
389 | spin_lock_init(&priv->lock); | 396 | spin_lock_init(&priv->lock); |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 348e19834b83..c6f497f16526 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -1818,6 +1818,8 @@ static const struct usb_device_id option_ids[] = { | |||
1818 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, | 1818 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, |
1819 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, | 1819 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, |
1820 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, | 1820 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, |
1821 | { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ | ||
1822 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
1821 | { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ | 1823 | { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ |
1822 | { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ | 1824 | { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ |
1823 | { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */ | 1825 | { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */ |
diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c index facaaf003f19..e40da7759a0e 100644 --- a/drivers/usb/usbip/usbip_common.c +++ b/drivers/usb/usbip/usbip_common.c | |||
@@ -741,6 +741,17 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb) | |||
741 | if (!(size > 0)) | 741 | if (!(size > 0)) |
742 | return 0; | 742 | return 0; |
743 | 743 | ||
744 | if (size > urb->transfer_buffer_length) { | ||
745 | /* should not happen, probably malicious packet */ | ||
746 | if (ud->side == USBIP_STUB) { | ||
747 | usbip_event_add(ud, SDEV_EVENT_ERROR_TCP); | ||
748 | return 0; | ||
749 | } else { | ||
750 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | ||
751 | return -EPIPE; | ||
752 | } | ||
753 | } | ||
754 | |||
744 | ret = usbip_recv(ud->tcp_socket, urb->transfer_buffer, size); | 755 | ret = usbip_recv(ud->tcp_socket, urb->transfer_buffer, size); |
745 | if (ret != size) { | 756 | if (ret != size) { |
746 | dev_err(&urb->dev->dev, "recv xbuf, %d\n", ret); | 757 | dev_err(&urb->dev->dev, "recv xbuf, %d\n", ret); |
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h index 06d6c6228a7a..d5ce71607972 100644 --- a/include/uapi/linux/usb/ch9.h +++ b/include/uapi/linux/usb/ch9.h | |||
@@ -899,7 +899,7 @@ struct usb_ssp_cap_descriptor { | |||
899 | __le32 bmAttributes; | 899 | __le32 bmAttributes; |
900 | #define USB_SSP_SUBLINK_SPEED_ATTRIBS (0x1f << 0) /* sublink speed entries */ | 900 | #define USB_SSP_SUBLINK_SPEED_ATTRIBS (0x1f << 0) /* sublink speed entries */ |
901 | #define USB_SSP_SUBLINK_SPEED_IDS (0xf << 5) /* speed ID entries */ | 901 | #define USB_SSP_SUBLINK_SPEED_IDS (0xf << 5) /* speed ID entries */ |
902 | __u16 wFunctionalitySupport; | 902 | __le16 wFunctionalitySupport; |
903 | #define USB_SSP_MIN_SUBLINK_SPEED_ATTRIBUTE_ID (0xf) | 903 | #define USB_SSP_MIN_SUBLINK_SPEED_ATTRIBUTE_ID (0xf) |
904 | #define USB_SSP_MIN_RX_LANE_COUNT (0xf << 8) | 904 | #define USB_SSP_MIN_RX_LANE_COUNT (0xf << 8) |
905 | #define USB_SSP_MIN_TX_LANE_COUNT (0xf << 12) | 905 | #define USB_SSP_MIN_TX_LANE_COUNT (0xf << 12) |