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 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
USB: Add support for Mobilcom Debitel USB UMTS Surf-Stick to option driver
USB: work around for EHCI with quirky periodic schedules
USB: musb: Fix CPPI IRQs not being signaled
USB: musb: respect usb_request->zero in control requests
USB: musb: fix ISOC Tx programming for CPPI DMAs
USB: musb: Remove unwanted message in boot log
usb: amd5536udc: fixed shared interrupt bug and warning oops
USB: ftdi_sio: Keep going when write errors are encountered.
USB: musb_gadget: fix STALL handling
USB: EHCI: don't send Clear-TT-Buffer following a STALL

+118 -78
+1 -1
drivers/usb/core/hub.c
··· 444 444 static inline int 445 445 hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) 446 446 { 447 - return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), 447 + return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), 448 448 HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo, 449 449 tt, NULL, 0, 1000); 450 450 }
+30 -19
drivers/usb/gadget/amd5536udc.c
··· 1213 1213 tmp &= AMD_UNMASK_BIT(ep->num); 1214 1214 writel(tmp, &dev->regs->ep_irqmsk); 1215 1215 } 1216 - } 1216 + } else if (ep->in) { 1217 + /* enable ep irq */ 1218 + tmp = readl(&dev->regs->ep_irqmsk); 1219 + tmp &= AMD_UNMASK_BIT(ep->num); 1220 + writel(tmp, &dev->regs->ep_irqmsk); 1221 + } 1217 1222 1218 1223 } else if (ep->dma) { 1219 1224 ··· 2010 2005 { 2011 2006 int tmp; 2012 2007 2013 - /* empty queues and init hardware */ 2014 - udc_basic_init(dev); 2015 - for (tmp = 0; tmp < UDC_EP_NUM; tmp++) { 2016 - empty_req_queue(&dev->ep[tmp]); 2017 - } 2018 - 2019 2008 if (dev->gadget.speed != USB_SPEED_UNKNOWN) { 2020 2009 spin_unlock(&dev->lock); 2021 2010 driver->disconnect(&dev->gadget); 2022 2011 spin_lock(&dev->lock); 2023 2012 } 2024 - /* init */ 2013 + 2014 + /* empty queues and init hardware */ 2015 + udc_basic_init(dev); 2016 + for (tmp = 0; tmp < UDC_EP_NUM; tmp++) 2017 + empty_req_queue(&dev->ep[tmp]); 2018 + 2025 2019 udc_setup_endpoints(dev); 2026 2020 } 2027 2021 ··· 2476 2472 } 2477 2473 } 2478 2474 2475 + } else if (!use_dma && ep->in) { 2476 + /* disable interrupt */ 2477 + tmp = readl( 2478 + &dev->regs->ep_irqmsk); 2479 + tmp |= AMD_BIT(ep->num); 2480 + writel(tmp, 2481 + &dev->regs->ep_irqmsk); 2479 2482 } 2480 2483 } 2481 2484 /* clear status bits */ ··· 3290 3279 goto finished; 3291 3280 } 3292 3281 3282 + spin_lock_init(&dev->lock); 3283 + /* udc csr registers base */ 3284 + dev->csr = dev->virt_addr + UDC_CSR_ADDR; 3285 + /* dev registers base */ 3286 + dev->regs = dev->virt_addr + UDC_DEVCFG_ADDR; 3287 + /* ep registers base */ 3288 + dev->ep_regs = dev->virt_addr + UDC_EPREGS_ADDR; 3289 + /* fifo's base */ 3290 + dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR); 3291 + dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR); 3292 + 3293 3293 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { 3294 3294 dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq); 3295 3295 kfree(dev); ··· 3353 3331 udc_pollstall_timer.data = 0; 3354 3332 3355 3333 /* device struct setup */ 3356 - spin_lock_init(&dev->lock); 3357 3334 dev->gadget.ops = &udc_ops; 3358 3335 3359 3336 dev_set_name(&dev->gadget.dev, "gadget"); ··· 3360 3339 dev->gadget.name = name; 3361 3340 dev->gadget.name = name; 3362 3341 dev->gadget.is_dualspeed = 1; 3363 - 3364 - /* udc csr registers base */ 3365 - dev->csr = dev->virt_addr + UDC_CSR_ADDR; 3366 - /* dev registers base */ 3367 - dev->regs = dev->virt_addr + UDC_DEVCFG_ADDR; 3368 - /* ep registers base */ 3369 - dev->ep_regs = dev->virt_addr + UDC_EPREGS_ADDR; 3370 - /* fifo's base */ 3371 - dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR); 3372 - dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR); 3373 3342 3374 3343 /* init registers, interrupts, ... */ 3375 3344 startup_registers(dev);
+2
drivers/usb/host/ehci-hcd.c
··· 28 28 #include <linux/errno.h> 29 29 #include <linux/init.h> 30 30 #include <linux/timer.h> 31 + #include <linux/ktime.h> 31 32 #include <linux/list.h> 32 33 #include <linux/interrupt.h> 33 34 #include <linux/usb.h> ··· 677 676 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */ 678 677 msleep(5); 679 678 up_write(&ehci_cf_port_reset_rwsem); 679 + ehci->last_periodic_enable = ktime_get_real(); 680 680 681 681 temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase)); 682 682 ehci_info (ehci,
+4
drivers/usb/host/ehci-pci.c
··· 111 111 switch (pdev->vendor) { 112 112 case PCI_VENDOR_ID_INTEL: 113 113 ehci->need_io_watchdog = 0; 114 + if (pdev->device == 0x27cc) { 115 + ehci->broken_periodic = 1; 116 + ehci_info(ehci, "using broken periodic workaround\n"); 117 + } 114 118 break; 115 119 case PCI_VENDOR_ID_TDI: 116 120 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
+14 -2
drivers/usb/host/ehci-q.c
··· 487 487 * we must clear the TT buffer (11.17.5). 488 488 */ 489 489 if (unlikely(last_status != -EINPROGRESS && 490 - last_status != -EREMOTEIO)) 491 - ehci_clear_tt_buffer(ehci, qh, urb, token); 490 + last_status != -EREMOTEIO)) { 491 + /* The TT's in some hubs malfunction when they 492 + * receive this request following a STALL (they 493 + * stop sending isochronous packets). Since a 494 + * STALL can't leave the TT buffer in a busy 495 + * state (if you believe Figures 11-48 - 11-51 496 + * in the USB 2.0 spec), we won't clear the TT 497 + * buffer in this case. Strictly speaking this 498 + * is a violation of the spec. 499 + */ 500 + if (last_status != -EPIPE) 501 + ehci_clear_tt_buffer(ehci, qh, urb, 502 + token); 503 + } 492 504 } 493 505 494 506 /* if we're removing something not at the queue head,
+12
drivers/usb/host/ehci-sched.c
··· 475 475 /* make sure ehci_work scans these */ 476 476 ehci->next_uframe = ehci_readl(ehci, &ehci->regs->frame_index) 477 477 % (ehci->periodic_size << 3); 478 + if (unlikely(ehci->broken_periodic)) 479 + ehci->last_periodic_enable = ktime_get_real(); 478 480 return 0; 479 481 } 480 482 ··· 487 485 488 486 if (--ehci->periodic_sched) 489 487 return 0; 488 + 489 + if (unlikely(ehci->broken_periodic)) { 490 + /* delay experimentally determined */ 491 + ktime_t safe = ktime_add_us(ehci->last_periodic_enable, 1000); 492 + ktime_t now = ktime_get_real(); 493 + s64 delay = ktime_us_delta(safe, now); 494 + 495 + if (unlikely(delay > 0)) 496 + udelay(delay); 497 + } 490 498 491 499 /* did setting PSE not take effect yet? 492 500 * takes effect only at frame boundaries...
+2
drivers/usb/host/ehci.h
··· 118 118 unsigned stamp; 119 119 unsigned random_frame; 120 120 unsigned long next_statechange; 121 + ktime_t last_periodic_enable; 121 122 u32 command; 122 123 123 124 /* SILICON QUIRKS */ ··· 128 127 unsigned big_endian_desc:1; 129 128 unsigned has_amcc_usb23:1; 130 129 unsigned need_io_watchdog:1; 130 + unsigned broken_periodic:1; 131 131 132 132 /* required for usb32 quirk */ 133 133 #define OHCI_CTRL_HCFS (3 << 6)
+5 -5
drivers/usb/musb/cppi_dma.c
··· 1442 1442 musb_writew(regs, MUSB_TXCSR, value); 1443 1443 musb_writew(regs, MUSB_TXCSR, value); 1444 1444 1445 - /* re-enable interrupt */ 1446 - if (enabled) 1447 - musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG, 1448 - (1 << cppi_ch->index)); 1449 - 1450 1445 /* While we scrub the TX state RAM, ensure that we clean 1451 1446 * up any interrupt that's currently asserted: 1452 1447 * 1. Write to completion Ptr value 0x1(bit 0 set) ··· 1453 1458 */ 1454 1459 cppi_reset_tx(tx_ram, 1); 1455 1460 musb_writel(&tx_ram->tx_complete, 0, 0); 1461 + 1462 + /* re-enable interrupt */ 1463 + if (enabled) 1464 + musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG, 1465 + (1 << cppi_ch->index)); 1456 1466 1457 1467 cppi_dump_tx(5, cppi_ch, " (done teardown)"); 1458 1468
+2 -2
drivers/usb/musb/musb_core.c
··· 1450 1450 #endif 1451 1451 1452 1452 if (hw_ep->max_packet_sz_tx) { 1453 - printk(KERN_DEBUG 1453 + DBG(1, 1454 1454 "%s: hw_ep %d%s, %smax %d\n", 1455 1455 musb_driver_name, i, 1456 1456 hw_ep->is_shared_fifo ? "shared" : "tx", ··· 1459 1459 hw_ep->max_packet_sz_tx); 1460 1460 } 1461 1461 if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) { 1462 - printk(KERN_DEBUG 1462 + DBG(1, 1463 1463 "%s: hw_ep %d%s, %smax %d\n", 1464 1464 musb_driver_name, i, 1465 1465 "rx",
+34 -45
drivers/usb/musb/musb_gadget.c
··· 4 4 * Copyright 2005 Mentor Graphics Corporation 5 5 * Copyright (C) 2005-2006 by Texas Instruments 6 6 * Copyright (C) 2006-2007 Nokia Corporation 7 + * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com> 7 8 * 8 9 * This program is free software; you can redistribute it and/or 9 10 * modify it under the terms of the GNU General Public License ··· 437 436 csr |= MUSB_TXCSR_P_WZC_BITS; 438 437 csr &= ~MUSB_TXCSR_P_SENTSTALL; 439 438 musb_writew(epio, MUSB_TXCSR, csr); 440 - if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) { 441 - dma->status = MUSB_DMA_STATUS_CORE_ABORT; 442 - musb->dma_controller->channel_abort(dma); 443 - } 444 - 445 - if (request) 446 - musb_g_giveback(musb_ep, request, -EPIPE); 447 - 448 439 break; 449 440 } 450 441 ··· 575 582 */ 576 583 static void rxstate(struct musb *musb, struct musb_request *req) 577 584 { 578 - u16 csr = 0; 579 585 const u8 epnum = req->epnum; 580 586 struct usb_request *request = &req->request; 581 587 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; 582 588 void __iomem *epio = musb->endpoints[epnum].regs; 583 589 unsigned fifo_count = 0; 584 590 u16 len = musb_ep->packet_sz; 591 + u16 csr = musb_readw(epio, MUSB_RXCSR); 585 592 586 - csr = musb_readw(epio, MUSB_RXCSR); 593 + /* We shouldn't get here while DMA is active, but we do... */ 594 + if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { 595 + DBG(4, "DMA pending...\n"); 596 + return; 597 + } 598 + 599 + if (csr & MUSB_RXCSR_P_SENDSTALL) { 600 + DBG(5, "%s stalling, RXCSR %04x\n", 601 + musb_ep->end_point.name, csr); 602 + return; 603 + } 587 604 588 605 if (is_cppi_enabled() && musb_ep->dma) { 589 606 struct dma_controller *c = musb->dma_controller; ··· 764 761 csr, dma ? " (dma)" : "", request); 765 762 766 763 if (csr & MUSB_RXCSR_P_SENTSTALL) { 767 - if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) { 768 - dma->status = MUSB_DMA_STATUS_CORE_ABORT; 769 - (void) musb->dma_controller->channel_abort(dma); 770 - request->actual += musb_ep->dma->actual_len; 771 - } 772 - 773 764 csr |= MUSB_RXCSR_P_WZC_BITS; 774 765 csr &= ~MUSB_RXCSR_P_SENTSTALL; 775 766 musb_writew(epio, MUSB_RXCSR, csr); 776 - 777 - if (request) 778 - musb_g_giveback(musb_ep, request, -EPIPE); 779 - goto done; 767 + return; 780 768 } 781 769 782 770 if (csr & MUSB_RXCSR_P_OVERRUN) { ··· 789 795 DBG((csr & MUSB_RXCSR_DMAENAB) ? 4 : 1, 790 796 "%s busy, csr %04x\n", 791 797 musb_ep->end_point.name, csr); 792 - goto done; 798 + return; 793 799 } 794 800 795 801 if (dma && (csr & MUSB_RXCSR_DMAENAB)) { ··· 820 826 if ((request->actual < request->length) 821 827 && (musb_ep->dma->actual_len 822 828 == musb_ep->packet_sz)) 823 - goto done; 829 + return; 824 830 #endif 825 831 musb_g_giveback(musb_ep, request, 0); 826 832 827 833 request = next_request(musb_ep); 828 834 if (!request) 829 - goto done; 830 - 831 - /* don't start more i/o till the stall clears */ 832 - musb_ep_select(mbase, epnum); 833 - csr = musb_readw(epio, MUSB_RXCSR); 834 - if (csr & MUSB_RXCSR_P_SENDSTALL) 835 - goto done; 835 + return; 836 836 } 837 - 838 837 839 838 /* analyze request if the ep is hot */ 840 839 if (request) ··· 836 849 DBG(3, "packet waiting for %s%s request\n", 837 850 musb_ep->desc ? "" : "inactive ", 838 851 musb_ep->end_point.name); 839 - 840 - done: 841 852 return; 842 853 } 843 854 ··· 1229 1244 void __iomem *mbase; 1230 1245 unsigned long flags; 1231 1246 u16 csr; 1232 - struct musb_request *request = NULL; 1247 + struct musb_request *request; 1233 1248 int status = 0; 1234 1249 1235 1250 if (!ep) ··· 1245 1260 1246 1261 musb_ep_select(mbase, epnum); 1247 1262 1248 - /* cannot portably stall with non-empty FIFO */ 1249 1263 request = to_musb_request(next_request(musb_ep)); 1250 - if (value && musb_ep->is_in) { 1251 - csr = musb_readw(epio, MUSB_TXCSR); 1252 - if (csr & MUSB_TXCSR_FIFONOTEMPTY) { 1253 - DBG(3, "%s fifo busy, cannot halt\n", ep->name); 1254 - spin_unlock_irqrestore(&musb->lock, flags); 1255 - return -EAGAIN; 1264 + if (value) { 1265 + if (request) { 1266 + DBG(3, "request in progress, cannot halt %s\n", 1267 + ep->name); 1268 + status = -EAGAIN; 1269 + goto done; 1256 1270 } 1257 - 1271 + /* Cannot portably stall with non-empty FIFO */ 1272 + if (musb_ep->is_in) { 1273 + csr = musb_readw(epio, MUSB_TXCSR); 1274 + if (csr & MUSB_TXCSR_FIFONOTEMPTY) { 1275 + DBG(3, "FIFO busy, cannot halt %s\n", ep->name); 1276 + status = -EAGAIN; 1277 + goto done; 1278 + } 1279 + } 1258 1280 } 1259 1281 1260 1282 /* set/clear the stall and toggle bits */ 1261 1283 DBG(2, "%s: %s stall\n", ep->name, value ? "set" : "clear"); 1262 1284 if (musb_ep->is_in) { 1263 1285 csr = musb_readw(epio, MUSB_TXCSR); 1264 - if (csr & MUSB_TXCSR_FIFONOTEMPTY) 1265 - csr |= MUSB_TXCSR_FLUSHFIFO; 1266 1286 csr |= MUSB_TXCSR_P_WZC_BITS 1267 1287 | MUSB_TXCSR_CLRDATATOG; 1268 1288 if (value) ··· 1290 1300 musb_writew(epio, MUSB_RXCSR, csr); 1291 1301 } 1292 1302 1293 - done: 1294 - 1295 1303 /* maybe start the first request in the queue */ 1296 1304 if (!musb_ep->busy && !value && request) { 1297 1305 DBG(3, "restarting the request\n"); 1298 1306 musb_ep_restart(musb, request); 1299 1307 } 1300 1308 1309 + done: 1301 1310 spin_unlock_irqrestore(&musb->lock, flags); 1302 1311 return status; 1303 1312 }
+2 -1
drivers/usb/musb/musb_gadget_ep0.c
··· 511 511 512 512 /* update the flags */ 513 513 if (fifo_count < MUSB_MAX_END0_PACKET 514 - || request->actual == request->length) { 514 + || (request->actual == request->length 515 + && !request->zero)) { 515 516 musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT; 516 517 csr |= MUSB_CSR0_P_DATAEND; 517 518 } else
+4 -1
drivers/usb/musb/musb_host.c
··· 1301 1301 return; 1302 1302 } else if (usb_pipeisoc(pipe) && dma) { 1303 1303 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, 1304 - offset, length)) 1304 + offset, length)) { 1305 + if (is_cppi_enabled() || tusb_dma_omap()) 1306 + musb_h_tx_dma_start(hw_ep); 1305 1307 return; 1308 + } 1306 1309 } else if (tx_csr & MUSB_TXCSR_DMAENAB) { 1307 1310 DBG(1, "not complete, but DMA enabled?\n"); 1308 1311 return;
+1 -2
drivers/usb/serial/ftdi_sio.c
··· 1937 1937 return; 1938 1938 } 1939 1939 /* account for transferred data */ 1940 - countback = urb->actual_length; 1940 + countback = urb->transfer_buffer_length; 1941 1941 data_offset = priv->write_offset; 1942 1942 if (data_offset > 0) { 1943 1943 /* Subtract the control bytes */ ··· 1950 1950 1951 1951 if (status) { 1952 1952 dbg("nonzero write bulk status received: %d", status); 1953 - return; 1954 1953 } 1955 1954 1956 1955 usb_serial_port_softint(port);
+5
drivers/usb/serial/option.c
··· 336 336 #define AIRPLUS_VENDOR_ID 0x1011 337 337 #define AIRPLUS_PRODUCT_MCD650 0x3198 338 338 339 + /* 4G Systems products */ 340 + #define FOUR_G_SYSTEMS_VENDOR_ID 0x1c9e 341 + #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 342 + 339 343 static struct usb_device_id option_ids[] = { 340 344 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 341 345 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, ··· 603 599 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, 604 600 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 605 601 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 602 + { USB_DEVICE(FOUR_G_SYSTEMS_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14) }, 606 603 { } /* Terminating entry */ 607 604 }; 608 605 MODULE_DEVICE_TABLE(usb, option_ids);