Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
"Here are a number of tiny USB fixes for 3.4-rc4.

Most of them are in the USB gadget area, but a few other minor USB
driver and core fixes are here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'usb-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits)
USB: serial: cp210x: Fixed usb_control_msg timeout values
USB: ehci-tegra: don't call set_irq_flags(IRQF_VALID)
USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb
USB: yurex: Remove allocation of coherent buffer for setup-packet buffer
drivers/usb/misc/usbtest.c: add kfrees
USB: ehci-fsl: Fix kernel crash on mpc5121e
uwb: fix error handling
uwb: fix use of del_timer_sync() in interrupt
EHCI: always clear the STS_FLR status bit
EHCI: fix criterion for resuming the root hub
USB: sierra: avoid QMI/wwan interface on MC77xx
usb: usbtest: avoid integer overflow in alloc_sglist()
usb: usbtest: avoid integer overflow in test_ctrl_queue()
USB: fix deadlock in bConfigurationValue attribute method
usb: gadget: eliminate NULL pointer dereference (bugfix)
usb: gadget: uvc: Remove non-required locking from 'uvc_queue_next_buffer' routine
usb: gadget: rndis: fix Missing req->context assignment
usb: musb: omap: fix the error check for pm_runtime_get_sync
usb: gadget: udc-core: fix asymmetric calls in remove_driver
usb: musb: omap: fix crash when musb glue (omap) gets initialized
...

+151 -76
-3
drivers/usb/core/hub.c
··· 1667 1667 { 1668 1668 struct usb_device *udev = *pdev; 1669 1669 int i; 1670 - struct usb_hcd *hcd = bus_to_hcd(udev->bus); 1671 1670 1672 1671 /* mark the device as inactive, so any further urb submissions for 1673 1672 * this device (and any of its children) will fail immediately. ··· 1689 1690 * so that the hardware is now fully quiesced. 1690 1691 */ 1691 1692 dev_dbg (&udev->dev, "unregistering device\n"); 1692 - mutex_lock(hcd->bandwidth_mutex); 1693 1693 usb_disable_device(udev, 0); 1694 - mutex_unlock(hcd->bandwidth_mutex); 1695 1694 usb_hcd_synchronize_unlinks(udev); 1696 1695 1697 1696 usb_remove_ep_devs(&udev->ep0);
+3 -3
drivers/usb/core/message.c
··· 1136 1136 * Deallocates hcd/hardware state for the endpoints (nuking all or most 1137 1137 * pending urbs) and usbcore state for the interfaces, so that usbcore 1138 1138 * must usb_set_configuration() before any interfaces could be used. 1139 - * 1140 - * Must be called with hcd->bandwidth_mutex held. 1141 1139 */ 1142 1140 void usb_disable_device(struct usb_device *dev, int skip_ep0) 1143 1141 { ··· 1188 1190 usb_disable_endpoint(dev, i + USB_DIR_IN, false); 1189 1191 } 1190 1192 /* Remove endpoints from the host controller internal state */ 1193 + mutex_lock(hcd->bandwidth_mutex); 1191 1194 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); 1195 + mutex_unlock(hcd->bandwidth_mutex); 1192 1196 /* Second pass: remove endpoint pointers */ 1193 1197 } 1194 1198 for (i = skip_ep0; i < 16; ++i) { ··· 1750 1750 /* if it's already configured, clear out old state first. 1751 1751 * getting rid of old interfaces means unbinding their drivers. 1752 1752 */ 1753 - mutex_lock(hcd->bandwidth_mutex); 1754 1753 if (dev->state != USB_STATE_ADDRESS) 1755 1754 usb_disable_device(dev, 1); /* Skip ep0 */ 1756 1755 ··· 1762 1763 * host controller will not allow submissions to dropped endpoints. If 1763 1764 * this call fails, the device state is unchanged. 1764 1765 */ 1766 + mutex_lock(hcd->bandwidth_mutex); 1765 1767 ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); 1766 1768 if (ret < 0) { 1767 1769 mutex_unlock(hcd->bandwidth_mutex);
+3 -3
drivers/usb/dwc3/core.c
··· 206 206 207 207 for (i = 0; i < dwc->num_event_buffers; i++) { 208 208 evt = dwc->ev_buffs[i]; 209 - if (evt) { 209 + if (evt) 210 210 dwc3_free_one_event_buffer(dwc, evt); 211 - dwc->ev_buffs[i] = NULL; 212 - } 213 211 } 212 + 213 + kfree(dwc->ev_buffs); 214 214 } 215 215 216 216 /**
+10 -2
drivers/usb/dwc3/ep0.c
··· 353 353 354 354 dwc->test_mode_nr = wIndex >> 8; 355 355 dwc->test_mode = true; 356 + break; 357 + default: 358 + return -EINVAL; 356 359 } 357 360 break; 358 361 ··· 562 559 length = trb->size & DWC3_TRB_SIZE_MASK; 563 560 564 561 if (dwc->ep0_bounced) { 562 + unsigned transfer_size = ur->length; 563 + unsigned maxp = ep0->endpoint.maxpacket; 564 + 565 + transfer_size += (maxp - (transfer_size % maxp)); 565 566 transferred = min_t(u32, ur->length, 566 - ep0->endpoint.maxpacket - length); 567 + transfer_size - length); 567 568 memcpy(ur->buf, dwc->ep0_bounce, transferred); 568 569 dwc->ep0_bounced = false; 569 570 } else { 570 571 transferred = ur->length - length; 571 - ur->actual += transferred; 572 572 } 573 + 574 + ur->actual += transferred; 573 575 574 576 if ((epnum & 1) && ur->actual < ur->length) { 575 577 /* for some reason we did not get everything out */
+2 -1
drivers/usb/gadget/f_fs.c
··· 712 712 if (code == FUNCTIONFS_INTERFACE_REVMAP) { 713 713 struct ffs_function *func = ffs->func; 714 714 ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV; 715 - } else if (gadget->ops->ioctl) { 715 + } else if (gadget && gadget->ops->ioctl) { 716 716 ret = gadget->ops->ioctl(gadget, code, value); 717 717 } else { 718 718 ret = -ENOTTY; ··· 1382 1382 ffs->ep0req = NULL; 1383 1383 ffs->gadget = NULL; 1384 1384 ffs_data_put(ffs); 1385 + clear_bit(FFS_FL_BOUND, &ffs->flags); 1385 1386 } 1386 1387 } 1387 1388
+1
drivers/usb/gadget/f_rndis.c
··· 500 500 if (buf) { 501 501 memcpy(req->buf, buf, n); 502 502 req->complete = rndis_response_complete; 503 + req->context = rndis; 503 504 rndis_free_response(rndis->config, buf); 504 505 value = n; 505 506 }
+16 -9
drivers/usb/gadget/fsl_udc_core.c
··· 730 730 : (1 << (ep_index(ep))); 731 731 732 732 /* check if the pipe is empty */ 733 - if (!(list_empty(&ep->queue))) { 733 + if (!(list_empty(&ep->queue)) && !(ep_index(ep) == 0)) { 734 734 /* Add td to the end */ 735 735 struct fsl_req *lastreq; 736 736 lastreq = list_entry(ep->queue.prev, struct fsl_req, queue); ··· 917 917 } else { 918 918 return -ENOMEM; 919 919 } 920 - 921 - /* Update ep0 state */ 922 - if ((ep_index(ep) == 0)) 923 - udc->ep0_state = DATA_STATE_XMIT; 924 920 925 921 /* irq handler advances the queue */ 926 922 if (req != NULL) ··· 1275 1279 udc->ep0_dir = USB_DIR_OUT; 1276 1280 1277 1281 ep = &udc->eps[0]; 1278 - udc->ep0_state = WAIT_FOR_OUT_STATUS; 1282 + if (udc->ep0_state != DATA_STATE_XMIT) 1283 + udc->ep0_state = WAIT_FOR_OUT_STATUS; 1279 1284 1280 1285 req->ep = ep; 1281 1286 req->req.length = 0; ··· 1381 1384 1382 1385 list_add_tail(&req->queue, &ep->queue); 1383 1386 udc->ep0_state = DATA_STATE_XMIT; 1387 + if (ep0_prime_status(udc, EP_DIR_OUT)) 1388 + ep0stall(udc); 1389 + 1384 1390 return; 1385 1391 stall: 1386 1392 ep0stall(udc); ··· 1492 1492 spin_lock(&udc->lock); 1493 1493 udc->ep0_state = (setup->bRequestType & USB_DIR_IN) 1494 1494 ? DATA_STATE_XMIT : DATA_STATE_RECV; 1495 + /* 1496 + * If the data stage is IN, send status prime immediately. 1497 + * See 2.0 Spec chapter 8.5.3.3 for detail. 1498 + */ 1499 + if (udc->ep0_state == DATA_STATE_XMIT) 1500 + if (ep0_prime_status(udc, EP_DIR_OUT)) 1501 + ep0stall(udc); 1502 + 1495 1503 } else { 1496 1504 /* No data phase, IN status from gadget */ 1497 1505 udc->ep0_dir = USB_DIR_IN; ··· 1528 1520 1529 1521 switch (udc->ep0_state) { 1530 1522 case DATA_STATE_XMIT: 1531 - /* receive status phase */ 1532 - if (ep0_prime_status(udc, EP_DIR_OUT)) 1533 - ep0stall(udc); 1523 + /* already primed at setup_received_irq */ 1524 + udc->ep0_state = WAIT_FOR_OUT_STATUS; 1534 1525 break; 1535 1526 case DATA_STATE_RECV: 1536 1527 /* send status phase */
+2 -2
drivers/usb/gadget/g_ffs.c
··· 161 161 static struct ffs_data *gfs_ffs_data; 162 162 static unsigned long gfs_registered; 163 163 164 - static int gfs_init(void) 164 + static int __init gfs_init(void) 165 165 { 166 166 ENTER(); 167 167 ··· 169 169 } 170 170 module_init(gfs_init); 171 171 172 - static void gfs_exit(void) 172 + static void __exit gfs_exit(void) 173 173 { 174 174 ENTER(); 175 175
+10 -7
drivers/usb/gadget/s3c-hsotg.c
··· 340 340 /* currently we allocate TX FIFOs for all possible endpoints, 341 341 * and assume that they are all the same size. */ 342 342 343 - for (ep = 0; ep <= 15; ep++) { 343 + for (ep = 1; ep <= 15; ep++) { 344 344 val = addr; 345 345 val |= size << S3C_DPTXFSIZn_DPTxFSize_SHIFT; 346 346 addr += size; ··· 741 741 /* write size / packets */ 742 742 writel(epsize, hsotg->regs + epsize_reg); 743 743 744 - if (using_dma(hsotg)) { 744 + if (using_dma(hsotg) && !continuing) { 745 745 unsigned int dma_reg; 746 746 747 747 /* write DMA address to control register, buffer already ··· 1696 1696 reg |= mpsval; 1697 1697 writel(reg, regs + S3C_DIEPCTL(ep)); 1698 1698 1699 - reg = readl(regs + S3C_DOEPCTL(ep)); 1700 - reg &= ~S3C_DxEPCTL_MPS_MASK; 1701 - reg |= mpsval; 1702 - writel(reg, regs + S3C_DOEPCTL(ep)); 1699 + if (ep) { 1700 + reg = readl(regs + S3C_DOEPCTL(ep)); 1701 + reg &= ~S3C_DxEPCTL_MPS_MASK; 1702 + reg |= mpsval; 1703 + writel(reg, regs + S3C_DOEPCTL(ep)); 1704 + } 1703 1705 1704 1706 return; 1705 1707 ··· 1921 1919 ints & S3C_DIEPMSK_TxFIFOEmpty) { 1922 1920 dev_dbg(hsotg->dev, "%s: ep%d: TxFIFOEmpty\n", 1923 1921 __func__, idx); 1924 - s3c_hsotg_trytx(hsotg, hs_ep); 1922 + if (!using_dma(hsotg)) 1923 + s3c_hsotg_trytx(hsotg, hs_ep); 1925 1924 } 1926 1925 } 1927 1926 }
+5 -1
drivers/usb/gadget/udc-core.c
··· 264 264 if (udc_is_newstyle(udc)) { 265 265 udc->driver->disconnect(udc->gadget); 266 266 udc->driver->unbind(udc->gadget); 267 - usb_gadget_udc_stop(udc->gadget, udc->driver); 268 267 usb_gadget_disconnect(udc->gadget); 268 + usb_gadget_udc_stop(udc->gadget, udc->driver); 269 269 } else { 270 270 usb_gadget_stop(udc->gadget, udc->driver); 271 271 } ··· 411 411 struct usb_udc *udc = container_of(dev, struct usb_udc, dev); 412 412 413 413 if (sysfs_streq(buf, "connect")) { 414 + if (udc_is_newstyle(udc)) 415 + usb_gadget_udc_start(udc->gadget, udc->driver); 414 416 usb_gadget_connect(udc->gadget); 415 417 } else if (sysfs_streq(buf, "disconnect")) { 418 + if (udc_is_newstyle(udc)) 419 + usb_gadget_udc_stop(udc->gadget, udc->driver); 416 420 usb_gadget_disconnect(udc->gadget); 417 421 } else { 418 422 dev_err(dev, "unsupported command '%s'\n", buf);
+1 -3
drivers/usb/gadget/uvc_queue.c
··· 543 543 return ret; 544 544 } 545 545 546 + /* called with queue->irqlock held.. */ 546 547 static struct uvc_buffer * 547 548 uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf) 548 549 { 549 550 struct uvc_buffer *nextbuf; 550 - unsigned long flags; 551 551 552 552 if ((queue->flags & UVC_QUEUE_DROP_INCOMPLETE) && 553 553 buf->buf.length != buf->buf.bytesused) { ··· 556 556 return buf; 557 557 } 558 558 559 - spin_lock_irqsave(&queue->irqlock, flags); 560 559 list_del(&buf->queue); 561 560 if (!list_empty(&queue->irqqueue)) 562 561 nextbuf = list_first_entry(&queue->irqqueue, struct uvc_buffer, 563 562 queue); 564 563 else 565 564 nextbuf = NULL; 566 - spin_unlock_irqrestore(&queue->irqlock, flags); 567 565 568 566 buf->buf.sequence = queue->sequence++; 569 567 do_gettimeofday(&buf->buf.timestamp);
+6 -1
drivers/usb/host/ehci-fsl.c
··· 218 218 u32 portsc; 219 219 struct usb_hcd *hcd = ehci_to_hcd(ehci); 220 220 void __iomem *non_ehci = hcd->regs; 221 + struct fsl_usb2_platform_data *pdata; 222 + 223 + pdata = hcd->self.controller->platform_data; 221 224 222 225 portsc = ehci_readl(ehci, &ehci->regs->port_status[port_offset]); 223 226 portsc &= ~(PORT_PTS_MSK | PORT_PTS_PTW); ··· 237 234 /* fall through */ 238 235 case FSL_USB2_PHY_UTMI: 239 236 /* enable UTMI PHY */ 240 - setbits32(non_ehci + FSL_SOC_USB_CTRL, CTRL_UTMI_PHY_EN); 237 + if (pdata->have_sysif_regs) 238 + setbits32(non_ehci + FSL_SOC_USB_CTRL, 239 + CTRL_UTMI_PHY_EN); 241 240 portsc |= PORT_PTS_UTMI; 242 241 break; 243 242 case FSL_USB2_PHY_NONE:
+7 -2
drivers/usb/host/ehci-hcd.c
··· 858 858 goto dead; 859 859 } 860 860 861 + /* 862 + * We don't use STS_FLR, but some controllers don't like it to 863 + * remain on, so mask it out along with the other status bits. 864 + */ 865 + masked_status = status & (INTR_MASK | STS_FLR); 866 + 861 867 /* Shared IRQ? */ 862 - masked_status = status & INTR_MASK; 863 868 if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) { 864 869 spin_unlock(&ehci->lock); 865 870 return IRQ_NONE; ··· 915 910 pcd_status = status; 916 911 917 912 /* resume root hub? */ 918 - if (!(cmd & CMD_RUN)) 913 + if (ehci->rh_state == EHCI_RH_SUSPENDED) 919 914 usb_hcd_resume_root_hub(hcd); 920 915 921 916 /* get per-port change detect bits */
-1
drivers/usb/host/ehci-tegra.c
··· 731 731 err = -ENODEV; 732 732 goto fail; 733 733 } 734 - set_irq_flags(irq, IRQF_VALID); 735 734 736 735 #ifdef CONFIG_USB_OTG_UTILS 737 736 if (pdata->operating_mode == TEGRA_USB_OTG) {
+6 -3
drivers/usb/misc/usbtest.c
··· 423 423 unsigned i; 424 424 unsigned size = max; 425 425 426 - sg = kmalloc(nents * sizeof *sg, GFP_KERNEL); 426 + sg = kmalloc_array(nents, sizeof *sg, GFP_KERNEL); 427 427 if (!sg) 428 428 return NULL; 429 429 sg_init_table(sg, nents); ··· 903 903 struct urb **urb; 904 904 struct ctrl_ctx context; 905 905 int i; 906 + 907 + if (param->sglen == 0 || param->iterations > UINT_MAX / param->sglen) 908 + return -EOPNOTSUPP; 906 909 907 910 spin_lock_init(&context.lock); 908 911 context.dev = dev; ··· 1984 1981 1985 1982 /* queued control messaging */ 1986 1983 case 10: 1987 - if (param->sglen == 0) 1988 - break; 1989 1984 retval = 0; 1990 1985 dev_info(&intf->dev, 1991 1986 "TEST 10: queue %d control calls, %d times\n", ··· 2277 2276 if (status < 0) { 2278 2277 WARNING(dev, "couldn't get endpoints, %d\n", 2279 2278 status); 2279 + kfree(dev->buf); 2280 + kfree(dev); 2280 2281 return status; 2281 2282 } 2282 2283 /* may find bulk or ISO pipes */
+3 -7
drivers/usb/misc/yurex.c
··· 99 99 usb_put_dev(dev->udev); 100 100 if (dev->cntl_urb) { 101 101 usb_kill_urb(dev->cntl_urb); 102 - if (dev->cntl_req) 103 - usb_free_coherent(dev->udev, YUREX_BUF_SIZE, 104 - dev->cntl_req, dev->cntl_urb->setup_dma); 102 + kfree(dev->cntl_req); 105 103 if (dev->cntl_buffer) 106 104 usb_free_coherent(dev->udev, YUREX_BUF_SIZE, 107 105 dev->cntl_buffer, dev->cntl_urb->transfer_dma); ··· 232 234 } 233 235 234 236 /* allocate buffer for control req */ 235 - dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, 236 - GFP_KERNEL, 237 - &dev->cntl_urb->setup_dma); 237 + dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL); 238 238 if (!dev->cntl_req) { 239 239 err("Could not allocate cntl_req"); 240 240 goto error; ··· 282 286 usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr), 283 287 dev->int_buffer, YUREX_BUF_SIZE, yurex_interrupt, 284 288 dev, 1); 285 - dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 289 + dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 286 290 if (usb_submit_urb(dev->urb, GFP_KERNEL)) { 287 291 retval = -EIO; 288 292 err("Could not submitting URB");
+33 -7
drivers/usb/musb/musb_core.c
··· 137 137 int i = 0; 138 138 u8 r; 139 139 u8 power; 140 + int ret; 141 + 142 + pm_runtime_get_sync(phy->io_dev); 140 143 141 144 /* Make sure the transceiver is not in low power mode */ 142 145 power = musb_readb(addr, MUSB_POWER); ··· 157 154 while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL) 158 155 & MUSB_ULPI_REG_CMPLT)) { 159 156 i++; 160 - if (i == 10000) 161 - return -ETIMEDOUT; 157 + if (i == 10000) { 158 + ret = -ETIMEDOUT; 159 + goto out; 160 + } 162 161 163 162 } 164 163 r = musb_readb(addr, MUSB_ULPI_REG_CONTROL); 165 164 r &= ~MUSB_ULPI_REG_CMPLT; 166 165 musb_writeb(addr, MUSB_ULPI_REG_CONTROL, r); 167 166 168 - return musb_readb(addr, MUSB_ULPI_REG_DATA); 167 + ret = musb_readb(addr, MUSB_ULPI_REG_DATA); 168 + 169 + out: 170 + pm_runtime_put(phy->io_dev); 171 + 172 + return ret; 169 173 } 170 174 171 175 static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) ··· 181 171 int i = 0; 182 172 u8 r = 0; 183 173 u8 power; 174 + int ret = 0; 175 + 176 + pm_runtime_get_sync(phy->io_dev); 184 177 185 178 /* Make sure the transceiver is not in low power mode */ 186 179 power = musb_readb(addr, MUSB_POWER); ··· 197 184 while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL) 198 185 & MUSB_ULPI_REG_CMPLT)) { 199 186 i++; 200 - if (i == 10000) 201 - return -ETIMEDOUT; 187 + if (i == 10000) { 188 + ret = -ETIMEDOUT; 189 + goto out; 190 + } 202 191 } 203 192 204 193 r = musb_readb(addr, MUSB_ULPI_REG_CONTROL); 205 194 r &= ~MUSB_ULPI_REG_CMPLT; 206 195 musb_writeb(addr, MUSB_ULPI_REG_CONTROL, r); 207 196 208 - return 0; 197 + out: 198 + pm_runtime_put(phy->io_dev); 199 + 200 + return ret; 209 201 } 210 202 #else 211 203 #define musb_ulpi_read NULL ··· 1922 1904 1923 1905 if (!musb->isr) { 1924 1906 status = -ENODEV; 1925 - goto fail3; 1907 + goto fail2; 1926 1908 } 1927 1909 1928 1910 if (!musb->xceiv->io_ops) { 1911 + musb->xceiv->io_dev = musb->controller; 1929 1912 musb->xceiv->io_priv = musb->mregs; 1930 1913 musb->xceiv->io_ops = &musb_ulpi_access; 1931 1914 } 1915 + 1916 + pm_runtime_get_sync(musb->controller); 1932 1917 1933 1918 #ifndef CONFIG_MUSB_PIO_ONLY 1934 1919 if (use_dma && dev->dma_mask) { ··· 2044 2023 goto fail5; 2045 2024 #endif 2046 2025 2026 + pm_runtime_put(musb->controller); 2027 + 2047 2028 dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", 2048 2029 ({char *s; 2049 2030 switch (musb->board_mode) { ··· 2070 2047 musb_gadget_cleanup(musb); 2071 2048 2072 2049 fail3: 2050 + pm_runtime_put_sync(musb->controller); 2051 + 2052 + fail2: 2073 2053 if (musb->irq_wake) 2074 2054 device_init_wakeup(dev, 0); 2075 2055 musb_platform_exit(musb);
+1 -1
drivers/usb/musb/musb_host.c
··· 2098 2098 } 2099 2099 2100 2100 /* turn off DMA requests, discard state, stop polling ... */ 2101 - if (is_in) { 2101 + if (ep->epnum && is_in) { 2102 2102 /* giveback saves bulk toggle */ 2103 2103 csr = musb_h_flush_rxfifo(ep, 0); 2104 2104
+18 -13
drivers/usb/musb/omap2430.c
··· 282 282 283 283 static int omap2430_musb_init(struct musb *musb) 284 284 { 285 - u32 l, status = 0; 285 + u32 l; 286 + int status = 0; 286 287 struct device *dev = musb->controller; 287 288 struct musb_hdrc_platform_data *plat = dev->platform_data; 288 289 struct omap_musb_board_data *data = plat->board_data; ··· 302 301 303 302 status = pm_runtime_get_sync(dev); 304 303 if (status < 0) { 305 - dev_err(dev, "pm_runtime_get_sync FAILED"); 304 + dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status); 306 305 goto err1; 307 306 } 308 307 ··· 334 333 335 334 setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb); 336 335 336 + pm_runtime_put_noidle(musb->controller); 337 337 return 0; 338 338 339 339 err1: ··· 454 452 goto err2; 455 453 } 456 454 455 + pm_runtime_enable(&pdev->dev); 456 + 457 457 ret = platform_device_add(musb); 458 458 if (ret) { 459 459 dev_err(&pdev->dev, "failed to register musb device\n"); 460 460 goto err2; 461 461 } 462 - 463 - pm_runtime_enable(&pdev->dev); 464 462 465 463 return 0; 466 464 ··· 480 478 481 479 platform_device_del(glue->musb); 482 480 platform_device_put(glue->musb); 483 - pm_runtime_put(&pdev->dev); 484 481 kfree(glue); 485 482 486 483 return 0; ··· 492 491 struct omap2430_glue *glue = dev_get_drvdata(dev); 493 492 struct musb *musb = glue_to_musb(glue); 494 493 495 - musb->context.otg_interfsel = musb_readl(musb->mregs, 496 - OTG_INTERFSEL); 494 + if (musb) { 495 + musb->context.otg_interfsel = musb_readl(musb->mregs, 496 + OTG_INTERFSEL); 497 497 498 - omap2430_low_level_exit(musb); 499 - usb_phy_set_suspend(musb->xceiv, 1); 498 + omap2430_low_level_exit(musb); 499 + usb_phy_set_suspend(musb->xceiv, 1); 500 + } 500 501 501 502 return 0; 502 503 } ··· 508 505 struct omap2430_glue *glue = dev_get_drvdata(dev); 509 506 struct musb *musb = glue_to_musb(glue); 510 507 511 - omap2430_low_level_init(musb); 512 - musb_writel(musb->mregs, OTG_INTERFSEL, 513 - musb->context.otg_interfsel); 508 + if (musb) { 509 + omap2430_low_level_init(musb); 510 + musb_writel(musb->mregs, OTG_INTERFSEL, 511 + musb->context.otg_interfsel); 514 512 515 - usb_phy_set_suspend(musb->xceiv, 0); 513 + usb_phy_set_suspend(musb->xceiv, 0); 514 + } 516 515 517 516 return 0; 518 517 }
+6 -3
drivers/usb/serial/cp210x.c
··· 287 287 /* Issue the request, attempting to read 'size' bytes */ 288 288 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 289 289 request, REQTYPE_DEVICE_TO_HOST, 0x0000, 290 - port_priv->bInterfaceNumber, buf, size, 300); 290 + port_priv->bInterfaceNumber, buf, size, 291 + USB_CTRL_GET_TIMEOUT); 291 292 292 293 /* Convert data into an array of integers */ 293 294 for (i = 0; i < length; i++) ··· 341 340 result = usb_control_msg(serial->dev, 342 341 usb_sndctrlpipe(serial->dev, 0), 343 342 request, REQTYPE_HOST_TO_DEVICE, 0x0000, 344 - port_priv->bInterfaceNumber, buf, size, 300); 343 + port_priv->bInterfaceNumber, buf, size, 344 + USB_CTRL_SET_TIMEOUT); 345 345 } else { 346 346 result = usb_control_msg(serial->dev, 347 347 usb_sndctrlpipe(serial->dev, 0), 348 348 request, REQTYPE_HOST_TO_DEVICE, data[0], 349 - port_priv->bInterfaceNumber, NULL, 0, 300); 349 + port_priv->bInterfaceNumber, NULL, 0, 350 + USB_CTRL_SET_TIMEOUT); 350 351 } 351 352 352 353 kfree(buf);
+4 -2
drivers/usb/serial/sierra.c
··· 221 221 }; 222 222 223 223 /* 'blacklist' of interfaces not served by this driver */ 224 - static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11 }; 224 + static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11, 19, 20 }; 225 225 static const struct sierra_iface_info direct_ip_interface_blacklist = { 226 226 .infolen = ARRAY_SIZE(direct_ip_non_serial_ifaces), 227 227 .ifaceinfo = direct_ip_non_serial_ifaces, ··· 289 289 { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */ 290 290 { USB_DEVICE(0x1199, 0x6859) }, /* Sierra Wireless AirCard 885 E */ 291 291 { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */ 292 - { USB_DEVICE(0x1199, 0x68A2) }, /* Sierra Wireless MC7710 */ 293 292 /* Sierra Wireless C885 */ 294 293 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)}, 295 294 /* Sierra Wireless C888, Air Card 501, USB 303, USB 304 */ ··· 298 299 /* Sierra Wireless HSPA Non-Composite Device */ 299 300 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)}, 300 301 { USB_DEVICE(0x1199, 0x6893) }, /* Sierra Wireless Device */ 302 + { USB_DEVICE(0x1199, 0x68A2), /* Sierra Wireless MC77xx in QMI mode */ 303 + .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist 304 + }, 301 305 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ 302 306 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist 303 307 },
+2 -1
drivers/uwb/hwa-rc.c
··· 645 645 dev_err(dev, "NEEP: URB error %d\n", urb->status); 646 646 } 647 647 result = usb_submit_urb(urb, GFP_ATOMIC); 648 - if (result < 0) { 648 + if (result < 0 && result != -ENODEV && result != -EPERM) { 649 + /* ignoring unrecoverable errors */ 649 650 dev_err(dev, "NEEP: Can't resubmit URB (%d) resetting device\n", 650 651 result); 651 652 goto error;
+11 -1
drivers/uwb/neh.c
··· 107 107 u8 evt_type; 108 108 __le16 evt; 109 109 u8 context; 110 + u8 completed; 110 111 uwb_rc_cmd_cb_f cb; 111 112 void *arg; 112 113 ··· 410 409 struct device *dev = &rc->uwb_dev.dev; 411 410 struct uwb_rc_neh *neh; 412 411 struct uwb_rceb *notif; 412 + unsigned long flags; 413 413 414 414 if (rceb->bEventContext == 0) { 415 415 notif = kmalloc(size, GFP_ATOMIC); ··· 424 422 } else { 425 423 neh = uwb_rc_neh_lookup(rc, rceb); 426 424 if (neh) { 427 - del_timer_sync(&neh->timer); 425 + spin_lock_irqsave(&rc->neh_lock, flags); 426 + /* to guard against a timeout */ 427 + neh->completed = 1; 428 + del_timer(&neh->timer); 429 + spin_unlock_irqrestore(&rc->neh_lock, flags); 428 430 uwb_rc_neh_cb(neh, rceb, size); 429 431 } else 430 432 dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n", ··· 574 568 unsigned long flags; 575 569 576 570 spin_lock_irqsave(&rc->neh_lock, flags); 571 + if (neh->completed) { 572 + spin_unlock_irqrestore(&rc->neh_lock, flags); 573 + return; 574 + } 577 575 if (neh->context) 578 576 __uwb_rc_neh_rm(rc, neh); 579 577 else
+1
include/linux/usb/otg.h
··· 94 94 95 95 struct usb_otg *otg; 96 96 97 + struct device *io_dev; 97 98 struct usb_phy_io_ops *io_ops; 98 99 void __iomem *io_priv; 99 100