aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2008-11-19 09:48:07 -0500
committerDavid Vrabel <david.vrabel@csr.com>2008-11-19 09:48:07 -0500
commitdba0a918722ee0f0ba3442575e4448c3ab622be4 (patch)
treefdb466cf09e7916135098d651b18924b2fe9ba5f /drivers/usb
parent0996e6382482ce9014787693d3884e9468153a5c (diff)
parent7f0f598a0069d1ab072375965a4b69137233169c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/class/cdc-acm.c9
-rw-r--r--drivers/usb/class/usbtmc.c2
-rw-r--r--drivers/usb/core/hcd.c35
-rw-r--r--drivers/usb/core/hcd.h1
-rw-r--r--drivers/usb/core/hub.c4
-rw-r--r--drivers/usb/core/message.c1
-rw-r--r--drivers/usb/core/sysfs.c2
-rw-r--r--drivers/usb/core/urb.c26
-rw-r--r--drivers/usb/gadget/f_acm.c4
-rw-r--r--drivers/usb/gadget/inode.c1
-rw-r--r--drivers/usb/host/Kconfig23
-rw-r--r--drivers/usb/host/ehci-hcd.c25
-rw-r--r--drivers/usb/host/ehci-ps3.c1
-rw-r--r--drivers/usb/host/ehci-sched.c4
-rw-r--r--drivers/usb/host/isp1760-if.c22
-rw-r--r--drivers/usb/host/ohci-ps3.c3
-rw-r--r--drivers/usb/host/r8a66597-hcd.c5
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c1
-rw-r--r--drivers/usb/misc/vstusb.c2
-rw-r--r--drivers/usb/musb/musb_core.c6
-rw-r--r--drivers/usb/musb/musb_debug.h4
-rw-r--r--drivers/usb/musb/musb_host.c159
-rw-r--r--drivers/usb/musb/musb_host.h1
-rw-r--r--drivers/usb/musb/omap2430.c2
-rw-r--r--drivers/usb/musb/tusb6010.c2
-rw-r--r--drivers/usb/serial/cp2101.c2
-rw-r--r--drivers/usb/serial/ir-usb.c2
-rw-r--r--drivers/usb/serial/option.c6
-rw-r--r--drivers/usb/serial/usb-serial.c1
-rw-r--r--drivers/usb/storage/Kconfig4
-rw-r--r--drivers/usb/storage/unusual_devs.h29
31 files changed, 263 insertions, 126 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 20104443081a..d50a99f70aee 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -158,16 +158,12 @@ static int acm_wb_is_avail(struct acm *acm)
158} 158}
159 159
160/* 160/*
161 * Finish write. 161 * Finish write. Caller must hold acm->write_lock
162 */ 162 */
163static void acm_write_done(struct acm *acm, struct acm_wb *wb) 163static void acm_write_done(struct acm *acm, struct acm_wb *wb)
164{ 164{
165 unsigned long flags;
166
167 spin_lock_irqsave(&acm->write_lock, flags);
168 wb->use = 0; 165 wb->use = 0;
169 acm->transmitting--; 166 acm->transmitting--;
170 spin_unlock_irqrestore(&acm->write_lock, flags);
171} 167}
172 168
173/* 169/*
@@ -482,6 +478,7 @@ static void acm_write_bulk(struct urb *urb)
482{ 478{
483 struct acm_wb *wb = urb->context; 479 struct acm_wb *wb = urb->context;
484 struct acm *acm = wb->instance; 480 struct acm *acm = wb->instance;
481 unsigned long flags;
485 482
486 if (verbose || urb->status 483 if (verbose || urb->status
487 || (urb->actual_length != urb->transfer_buffer_length)) 484 || (urb->actual_length != urb->transfer_buffer_length))
@@ -490,7 +487,9 @@ static void acm_write_bulk(struct urb *urb)
490 urb->transfer_buffer_length, 487 urb->transfer_buffer_length,
491 urb->status); 488 urb->status);
492 489
490 spin_lock_irqsave(&acm->write_lock, flags);
493 acm_write_done(acm, wb); 491 acm_write_done(acm, wb);
492 spin_unlock_irqrestore(&acm->write_lock, flags);
494 if (ACM_READY(acm)) 493 if (ACM_READY(acm))
495 schedule_work(&acm->work); 494 schedule_work(&acm->work);
496 else 495 else
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 543811f6e6e8..8e74657f106c 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -133,7 +133,7 @@ static int usbtmc_release(struct inode *inode, struct file *file)
133 133
134static int usbtmc_ioctl_abort_bulk_in(struct usbtmc_device_data *data) 134static int usbtmc_ioctl_abort_bulk_in(struct usbtmc_device_data *data)
135{ 135{
136 char *buffer; 136 u8 *buffer;
137 struct device *dev; 137 struct device *dev;
138 int rv; 138 int rv;
139 int n; 139 int n;
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index fc9018e72a09..e1b42626d04d 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -106,6 +106,9 @@ static DEFINE_SPINLOCK(hcd_root_hub_lock);
106/* used when updating an endpoint's URB list */ 106/* used when updating an endpoint's URB list */
107static DEFINE_SPINLOCK(hcd_urb_list_lock); 107static DEFINE_SPINLOCK(hcd_urb_list_lock);
108 108
109/* used to protect against unlinking URBs after the device is gone */
110static DEFINE_SPINLOCK(hcd_urb_unlink_lock);
111
109/* wait queue for synchronous unlinks */ 112/* wait queue for synchronous unlinks */
110DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue); 113DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue);
111 114
@@ -1376,10 +1379,25 @@ static int unlink1(struct usb_hcd *hcd, struct urb *urb, int status)
1376int usb_hcd_unlink_urb (struct urb *urb, int status) 1379int usb_hcd_unlink_urb (struct urb *urb, int status)
1377{ 1380{
1378 struct usb_hcd *hcd; 1381 struct usb_hcd *hcd;
1379 int retval; 1382 int retval = -EIDRM;
1383 unsigned long flags;
1380 1384
1381 hcd = bus_to_hcd(urb->dev->bus); 1385 /* Prevent the device and bus from going away while
1382 retval = unlink1(hcd, urb, status); 1386 * the unlink is carried out. If they are already gone
1387 * then urb->use_count must be 0, since disconnected
1388 * devices can't have any active URBs.
1389 */
1390 spin_lock_irqsave(&hcd_urb_unlink_lock, flags);
1391 if (atomic_read(&urb->use_count) > 0) {
1392 retval = 0;
1393 usb_get_dev(urb->dev);
1394 }
1395 spin_unlock_irqrestore(&hcd_urb_unlink_lock, flags);
1396 if (retval == 0) {
1397 hcd = bus_to_hcd(urb->dev->bus);
1398 retval = unlink1(hcd, urb, status);
1399 usb_put_dev(urb->dev);
1400 }
1383 1401
1384 if (retval == 0) 1402 if (retval == 0)
1385 retval = -EINPROGRESS; 1403 retval = -EINPROGRESS;
@@ -1528,6 +1546,17 @@ void usb_hcd_disable_endpoint(struct usb_device *udev,
1528 hcd->driver->endpoint_disable(hcd, ep); 1546 hcd->driver->endpoint_disable(hcd, ep);
1529} 1547}
1530 1548
1549/* Protect against drivers that try to unlink URBs after the device
1550 * is gone, by waiting until all unlinks for @udev are finished.
1551 * Since we don't currently track URBs by device, simply wait until
1552 * nothing is running in the locked region of usb_hcd_unlink_urb().
1553 */
1554void usb_hcd_synchronize_unlinks(struct usb_device *udev)
1555{
1556 spin_lock_irq(&hcd_urb_unlink_lock);
1557 spin_unlock_irq(&hcd_urb_unlink_lock);
1558}
1559
1531/*-------------------------------------------------------------------------*/ 1560/*-------------------------------------------------------------------------*/
1532 1561
1533/* called in any context */ 1562/* called in any context */
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 2dcde61c465e..9465e70f4dd0 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -232,6 +232,7 @@ extern void usb_hcd_flush_endpoint(struct usb_device *udev,
232 struct usb_host_endpoint *ep); 232 struct usb_host_endpoint *ep);
233extern void usb_hcd_disable_endpoint(struct usb_device *udev, 233extern void usb_hcd_disable_endpoint(struct usb_device *udev,
234 struct usb_host_endpoint *ep); 234 struct usb_host_endpoint *ep);
235extern void usb_hcd_synchronize_unlinks(struct usb_device *udev);
235extern int usb_hcd_get_frame_number(struct usb_device *udev); 236extern int usb_hcd_get_frame_number(struct usb_device *udev);
236 237
237extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, 238extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 9b3f16bd12cb..b19cbfcd51da 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -659,6 +659,9 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
659 PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2); 659 PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2);
660 schedule_delayed_work(&hub->init_work, 660 schedule_delayed_work(&hub->init_work,
661 msecs_to_jiffies(delay)); 661 msecs_to_jiffies(delay));
662
663 /* Suppress autosuspend until init is done */
664 to_usb_interface(hub->intfdev)->pm_usage_cnt = 1;
662 return; /* Continues at init2: below */ 665 return; /* Continues at init2: below */
663 } else { 666 } else {
664 hub_power_on(hub, true); 667 hub_power_on(hub, true);
@@ -1429,6 +1432,7 @@ void usb_disconnect(struct usb_device **pdev)
1429 */ 1432 */
1430 dev_dbg (&udev->dev, "unregistering device\n"); 1433 dev_dbg (&udev->dev, "unregistering device\n");
1431 usb_disable_device(udev, 0); 1434 usb_disable_device(udev, 0);
1435 usb_hcd_synchronize_unlinks(udev);
1432 1436
1433 usb_unlock_device(udev); 1437 usb_unlock_device(udev);
1434 1438
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 887738577b28..6d1048faf08e 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1091,6 +1091,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
1091 continue; 1091 continue;
1092 dev_dbg(&dev->dev, "unregistering interface %s\n", 1092 dev_dbg(&dev->dev, "unregistering interface %s\n",
1093 dev_name(&interface->dev)); 1093 dev_name(&interface->dev));
1094 interface->unregistering = 1;
1094 usb_remove_sysfs_intf_files(interface); 1095 usb_remove_sysfs_intf_files(interface);
1095 device_del(&interface->dev); 1096 device_del(&interface->dev);
1096 } 1097 }
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index f66fba11fbd5..4fb65fdc9dc3 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -840,7 +840,7 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf)
840 struct usb_host_interface *alt = intf->cur_altsetting; 840 struct usb_host_interface *alt = intf->cur_altsetting;
841 int retval; 841 int retval;
842 842
843 if (intf->sysfs_files_created) 843 if (intf->sysfs_files_created || intf->unregistering)
844 return 0; 844 return 0;
845 845
846 /* The interface string may be present in some altsettings 846 /* The interface string may be present in some altsettings
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index f2638009a464..1f68af9db3f7 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -85,8 +85,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_urb);
85 * Must be called when a user of a urb is finished with it. When the last user 85 * Must be called when a user of a urb is finished with it. When the last user
86 * of the urb calls this function, the memory of the urb is freed. 86 * of the urb calls this function, the memory of the urb is freed.
87 * 87 *
88 * Note: The transfer buffer associated with the urb is not freed, that must be 88 * Note: The transfer buffer associated with the urb is not freed unless the
89 * done elsewhere. 89 * URB_FREE_BUFFER transfer flag is set.
90 */ 90 */
91void usb_free_urb(struct urb *urb) 91void usb_free_urb(struct urb *urb)
92{ 92{
@@ -474,6 +474,12 @@ EXPORT_SYMBOL_GPL(usb_submit_urb);
474 * indicating that the request has been canceled (rather than any other 474 * indicating that the request has been canceled (rather than any other
475 * code). 475 * code).
476 * 476 *
477 * Drivers should not call this routine or related routines, such as
478 * usb_kill_urb() or usb_unlink_anchored_urbs(), after their disconnect
479 * method has returned. The disconnect function should synchronize with
480 * a driver's I/O routines to insure that all URB-related activity has
481 * completed before it returns.
482 *
477 * This request is always asynchronous. Success is indicated by 483 * This request is always asynchronous. Success is indicated by
478 * returning -EINPROGRESS, at which time the URB will probably not yet 484 * returning -EINPROGRESS, at which time the URB will probably not yet
479 * have been given back to the device driver. When it is eventually 485 * have been given back to the device driver. When it is eventually
@@ -550,6 +556,9 @@ EXPORT_SYMBOL_GPL(usb_unlink_urb);
550 * This routine may not be used in an interrupt context (such as a bottom 556 * This routine may not be used in an interrupt context (such as a bottom
551 * half or a completion handler), or when holding a spinlock, or in other 557 * half or a completion handler), or when holding a spinlock, or in other
552 * situations where the caller can't schedule(). 558 * situations where the caller can't schedule().
559 *
560 * This routine should not be called by a driver after its disconnect
561 * method has returned.
553 */ 562 */
554void usb_kill_urb(struct urb *urb) 563void usb_kill_urb(struct urb *urb)
555{ 564{
@@ -588,6 +597,9 @@ EXPORT_SYMBOL_GPL(usb_kill_urb);
588 * This routine may not be used in an interrupt context (such as a bottom 597 * This routine may not be used in an interrupt context (such as a bottom
589 * half or a completion handler), or when holding a spinlock, or in other 598 * half or a completion handler), or when holding a spinlock, or in other
590 * situations where the caller can't schedule(). 599 * situations where the caller can't schedule().
600 *
601 * This routine should not be called by a driver after its disconnect
602 * method has returned.
591 */ 603 */
592void usb_poison_urb(struct urb *urb) 604void usb_poison_urb(struct urb *urb)
593{ 605{
@@ -622,6 +634,9 @@ EXPORT_SYMBOL_GPL(usb_unpoison_urb);
622 * 634 *
623 * this allows all outstanding URBs to be killed starting 635 * this allows all outstanding URBs to be killed starting
624 * from the back of the queue 636 * from the back of the queue
637 *
638 * This routine should not be called by a driver after its disconnect
639 * method has returned.
625 */ 640 */
626void usb_kill_anchored_urbs(struct usb_anchor *anchor) 641void usb_kill_anchored_urbs(struct usb_anchor *anchor)
627{ 642{
@@ -651,6 +666,9 @@ EXPORT_SYMBOL_GPL(usb_kill_anchored_urbs);
651 * this allows all outstanding URBs to be poisoned starting 666 * this allows all outstanding URBs to be poisoned starting
652 * from the back of the queue. Newly added URBs will also be 667 * from the back of the queue. Newly added URBs will also be
653 * poisoned 668 * poisoned
669 *
670 * This routine should not be called by a driver after its disconnect
671 * method has returned.
654 */ 672 */
655void usb_poison_anchored_urbs(struct usb_anchor *anchor) 673void usb_poison_anchored_urbs(struct usb_anchor *anchor)
656{ 674{
@@ -672,6 +690,7 @@ void usb_poison_anchored_urbs(struct usb_anchor *anchor)
672 spin_unlock_irq(&anchor->lock); 690 spin_unlock_irq(&anchor->lock);
673} 691}
674EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs); 692EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs);
693
675/** 694/**
676 * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse 695 * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse
677 * @anchor: anchor the requests are bound to 696 * @anchor: anchor the requests are bound to
@@ -680,6 +699,9 @@ EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs);
680 * from the back of the queue. This function is asynchronous. 699 * from the back of the queue. This function is asynchronous.
681 * The unlinking is just tiggered. It may happen after this 700 * The unlinking is just tiggered. It may happen after this
682 * function has returned. 701 * function has returned.
702 *
703 * This routine should not be called by a driver after its disconnect
704 * method has returned.
683 */ 705 */
684void usb_unlink_anchored_urbs(struct usb_anchor *anchor) 706void usb_unlink_anchored_urbs(struct usb_anchor *anchor)
685{ 707{
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c
index 5ee1590b8e9c..c1d34df0b157 100644
--- a/drivers/usb/gadget/f_acm.c
+++ b/drivers/usb/gadget/f_acm.c
@@ -463,7 +463,11 @@ static int acm_cdc_notify(struct f_acm *acm, u8 type, u16 value,
463 notify->wLength = cpu_to_le16(length); 463 notify->wLength = cpu_to_le16(length);
464 memcpy(buf, data, length); 464 memcpy(buf, data, length);
465 465
466 /* ep_queue() can complete immediately if it fills the fifo... */
467 spin_unlock(&acm->lock);
466 status = usb_ep_queue(ep, req, GFP_ATOMIC); 468 status = usb_ep_queue(ep, req, GFP_ATOMIC);
469 spin_lock(&acm->lock);
470
467 if (status < 0) { 471 if (status < 0) {
468 ERROR(acm->port.func.config->cdev, 472 ERROR(acm->port.func.config->cdev,
469 "acm ttyGS%d can't notify serial state, %d\n", 473 "acm ttyGS%d can't notify serial state, %d\n",
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index f4585d3e90d7..eeb26c0f88e5 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1251,7 +1251,6 @@ dev_release (struct inode *inode, struct file *fd)
1251 * alternatively, all host requests will time out. 1251 * alternatively, all host requests will time out.
1252 */ 1252 */
1253 1253
1254 fasync_helper (-1, fd, 0, &dev->fasync);
1255 kfree (dev->buf); 1254 kfree (dev->buf);
1256 dev->buf = NULL; 1255 dev->buf = NULL;
1257 put_dev (dev); 1256 put_dev (dev);
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 56f592dc0b36..f3a75a929e0a 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -110,29 +110,18 @@ config USB_ISP116X_HCD
110 110
111config USB_ISP1760_HCD 111config USB_ISP1760_HCD
112 tristate "ISP 1760 HCD support" 112 tristate "ISP 1760 HCD support"
113 depends on USB && EXPERIMENTAL 113 depends on USB && EXPERIMENTAL && (PCI || PPC_OF)
114 ---help--- 114 ---help---
115 The ISP1760 chip is a USB 2.0 host controller. 115 The ISP1760 chip is a USB 2.0 host controller.
116 116
117 This driver does not support isochronous transfers or OTG. 117 This driver does not support isochronous transfers or OTG.
118 This USB controller is usually attached to a non-DMA-Master
119 capable bus. NXP's eval kit brings this chip on PCI card
120 where the chip itself is behind a PLB to simulate such
121 a bus.
118 122
119 To compile this driver as a module, choose M here: the 123 To compile this driver as a module, choose M here: the
120 module will be called isp1760-hcd. 124 module will be called isp1760.
121
122config USB_ISP1760_PCI
123 bool "Support for the PCI bus"
124 depends on USB_ISP1760_HCD && PCI
125 ---help---
126 Enables support for the device present on the PCI bus.
127 This should only be required if you happen to have the eval kit from
128 NXP and you are going to test it.
129
130config USB_ISP1760_OF
131 bool "Support for the OF platform bus"
132 depends on USB_ISP1760_HCD && PPC_OF
133 ---help---
134 Enables support for the device present on the PowerPC
135 OpenFirmware platform bus.
136 125
137config USB_OHCI_HCD 126config USB_OHCI_HCD
138 tristate "OHCI HCD support" 127 tristate "OHCI HCD support"
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 15a803b206b8..4725d15d096f 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -643,7 +643,7 @@ static int ehci_run (struct usb_hcd *hcd)
643static irqreturn_t ehci_irq (struct usb_hcd *hcd) 643static irqreturn_t ehci_irq (struct usb_hcd *hcd)
644{ 644{
645 struct ehci_hcd *ehci = hcd_to_ehci (hcd); 645 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
646 u32 status, pcd_status = 0, cmd; 646 u32 status, masked_status, pcd_status = 0, cmd;
647 int bh; 647 int bh;
648 648
649 spin_lock (&ehci->lock); 649 spin_lock (&ehci->lock);
@@ -656,14 +656,14 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
656 goto dead; 656 goto dead;
657 } 657 }
658 658
659 status &= INTR_MASK; 659 masked_status = status & INTR_MASK;
660 if (!status) { /* irq sharing? */ 660 if (!masked_status) { /* irq sharing? */
661 spin_unlock(&ehci->lock); 661 spin_unlock(&ehci->lock);
662 return IRQ_NONE; 662 return IRQ_NONE;
663 } 663 }
664 664
665 /* clear (just) interrupts */ 665 /* clear (just) interrupts */
666 ehci_writel(ehci, status, &ehci->regs->status); 666 ehci_writel(ehci, masked_status, &ehci->regs->status);
667 cmd = ehci_readl(ehci, &ehci->regs->command); 667 cmd = ehci_readl(ehci, &ehci->regs->command);
668 bh = 0; 668 bh = 0;
669 669
@@ -734,18 +734,17 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
734 734
735 /* PCI errors [4.15.2.4] */ 735 /* PCI errors [4.15.2.4] */
736 if (unlikely ((status & STS_FATAL) != 0)) { 736 if (unlikely ((status & STS_FATAL) != 0)) {
737 ehci_err(ehci, "fatal error\n");
737 dbg_cmd(ehci, "fatal", cmd); 738 dbg_cmd(ehci, "fatal", cmd);
738 dbg_status(ehci, "fatal", status); 739 dbg_status(ehci, "fatal", status);
739 if (status & STS_HALT) { 740 ehci_halt(ehci);
740 ehci_err (ehci, "fatal error\n");
741dead: 741dead:
742 ehci_reset (ehci); 742 ehci_reset(ehci);
743 ehci_writel(ehci, 0, &ehci->regs->configured_flag); 743 ehci_writel(ehci, 0, &ehci->regs->configured_flag);
744 /* generic layer kills/unlinks all urbs, then 744 /* generic layer kills/unlinks all urbs, then
745 * uses ehci_stop to clean up the rest 745 * uses ehci_stop to clean up the rest
746 */ 746 */
747 bh = 1; 747 bh = 1;
748 }
749 } 748 }
750 749
751 if (bh) 750 if (bh)
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 0eba894bcb01..9c9da35abc6c 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -205,6 +205,7 @@ static int ps3_ehci_remove(struct ps3_system_bus_device *dev)
205 205
206 tmp = hcd->irq; 206 tmp = hcd->irq;
207 207
208 ehci_shutdown(hcd);
208 usb_remove_hcd(hcd); 209 usb_remove_hcd(hcd);
209 210
210 ps3_system_bus_set_driver_data(dev, NULL); 211 ps3_system_bus_set_driver_data(dev, NULL);
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 4a0c5a78b2ed..a081ee65bde6 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -918,7 +918,7 @@ iso_stream_init (
918 */ 918 */
919 stream->usecs = HS_USECS_ISO (maxp); 919 stream->usecs = HS_USECS_ISO (maxp);
920 bandwidth = stream->usecs * 8; 920 bandwidth = stream->usecs * 8;
921 bandwidth /= 1 << (interval - 1); 921 bandwidth /= interval;
922 922
923 } else { 923 } else {
924 u32 addr; 924 u32 addr;
@@ -951,7 +951,7 @@ iso_stream_init (
951 } else 951 } else
952 stream->raw_mask = smask_out [hs_transfers - 1]; 952 stream->raw_mask = smask_out [hs_transfers - 1];
953 bandwidth = stream->usecs + stream->c_usecs; 953 bandwidth = stream->usecs + stream->c_usecs;
954 bandwidth /= 1 << (interval + 2); 954 bandwidth /= interval << 3;
955 955
956 /* stream->splits gets created from raw_mask later */ 956 /* stream->splits gets created from raw_mask later */
957 stream->address = cpu_to_hc32(ehci, addr); 957 stream->address = cpu_to_hc32(ehci, addr);
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index af849f596135..b87ca7cf4b37 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -14,16 +14,16 @@
14#include "../core/hcd.h" 14#include "../core/hcd.h"
15#include "isp1760-hcd.h" 15#include "isp1760-hcd.h"
16 16
17#ifdef CONFIG_USB_ISP1760_OF 17#ifdef CONFIG_PPC_OF
18#include <linux/of.h> 18#include <linux/of.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#endif 20#endif
21 21
22#ifdef CONFIG_USB_ISP1760_PCI 22#ifdef CONFIG_PCI
23#include <linux/pci.h> 23#include <linux/pci.h>
24#endif 24#endif
25 25
26#ifdef CONFIG_USB_ISP1760_OF 26#ifdef CONFIG_PPC_OF
27static int of_isp1760_probe(struct of_device *dev, 27static int of_isp1760_probe(struct of_device *dev,
28 const struct of_device_id *match) 28 const struct of_device_id *match)
29{ 29{
@@ -128,7 +128,7 @@ static struct of_platform_driver isp1760_of_driver = {
128}; 128};
129#endif 129#endif
130 130
131#ifdef CONFIG_USB_ISP1760_PCI 131#ifdef CONFIG_PCI
132static u32 nxp_pci_io_base; 132static u32 nxp_pci_io_base;
133static u32 iolength; 133static u32 iolength;
134static u32 pci_mem_phy0; 134static u32 pci_mem_phy0;
@@ -288,28 +288,28 @@ static struct pci_driver isp1761_pci_driver = {
288 288
289static int __init isp1760_init(void) 289static int __init isp1760_init(void)
290{ 290{
291 int ret = -ENODEV; 291 int ret;
292 292
293 init_kmem_once(); 293 init_kmem_once();
294 294
295#ifdef CONFIG_USB_ISP1760_OF 295#ifdef CONFIG_PPC_OF
296 ret = of_register_platform_driver(&isp1760_of_driver); 296 ret = of_register_platform_driver(&isp1760_of_driver);
297 if (ret) { 297 if (ret) {
298 deinit_kmem_cache(); 298 deinit_kmem_cache();
299 return ret; 299 return ret;
300 } 300 }
301#endif 301#endif
302#ifdef CONFIG_USB_ISP1760_PCI 302#ifdef CONFIG_PCI
303 ret = pci_register_driver(&isp1761_pci_driver); 303 ret = pci_register_driver(&isp1761_pci_driver);
304 if (ret) 304 if (ret)
305 goto unreg_of; 305 goto unreg_of;
306#endif 306#endif
307 return ret; 307 return ret;
308 308
309#ifdef CONFIG_USB_ISP1760_PCI 309#ifdef CONFIG_PCI
310unreg_of: 310unreg_of:
311#endif 311#endif
312#ifdef CONFIG_USB_ISP1760_OF 312#ifdef CONFIG_PPC_OF
313 of_unregister_platform_driver(&isp1760_of_driver); 313 of_unregister_platform_driver(&isp1760_of_driver);
314#endif 314#endif
315 deinit_kmem_cache(); 315 deinit_kmem_cache();
@@ -319,10 +319,10 @@ module_init(isp1760_init);
319 319
320static void __exit isp1760_exit(void) 320static void __exit isp1760_exit(void)
321{ 321{
322#ifdef CONFIG_USB_ISP1760_OF 322#ifdef CONFIG_PPC_OF
323 of_unregister_platform_driver(&isp1760_of_driver); 323 of_unregister_platform_driver(&isp1760_of_driver);
324#endif 324#endif
325#ifdef CONFIG_USB_ISP1760_PCI 325#ifdef CONFIG_PCI
326 pci_unregister_driver(&isp1761_pci_driver); 326 pci_unregister_driver(&isp1761_pci_driver);
327#endif 327#endif
328 deinit_kmem_cache(); 328 deinit_kmem_cache();
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
index 2089d8a46c4b..3c1a3b5f89f1 100644
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -192,7 +192,7 @@ fail_start:
192 return result; 192 return result;
193} 193}
194 194
195static int ps3_ohci_remove (struct ps3_system_bus_device *dev) 195static int ps3_ohci_remove(struct ps3_system_bus_device *dev)
196{ 196{
197 unsigned int tmp; 197 unsigned int tmp;
198 struct usb_hcd *hcd = 198 struct usb_hcd *hcd =
@@ -205,6 +205,7 @@ static int ps3_ohci_remove (struct ps3_system_bus_device *dev)
205 205
206 tmp = hcd->irq; 206 tmp = hcd->irq;
207 207
208 ohci_shutdown(hcd);
208 usb_remove_hcd(hcd); 209 usb_remove_hcd(hcd);
209 210
210 ps3_system_bus_set_driver_data(dev, NULL); 211 ps3_system_bus_set_driver_data(dev, NULL);
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index c18d8790c410..2376f24f3c83 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -1763,11 +1763,12 @@ static void r8a66597_timer(unsigned long _r8a66597)
1763{ 1763{
1764 struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; 1764 struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597;
1765 unsigned long flags; 1765 unsigned long flags;
1766 int port;
1766 1767
1767 spin_lock_irqsave(&r8a66597->lock, flags); 1768 spin_lock_irqsave(&r8a66597->lock, flags);
1768 1769
1769 r8a66597_root_hub_control(r8a66597, 0); 1770 for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
1770 r8a66597_root_hub_control(r8a66597, 1); 1771 r8a66597_root_hub_control(r8a66597, port);
1771 1772
1772 spin_unlock_irqrestore(&r8a66597->lock, flags); 1773 spin_unlock_irqrestore(&r8a66597->lock, flags);
1773} 1774}
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 69c34a58e205..b4ec716de7da 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -3270,6 +3270,7 @@ static struct usb_device_id sisusb_table [] = {
3270 { USB_DEVICE(0x0711, 0x0900) }, 3270 { USB_DEVICE(0x0711, 0x0900) },
3271 { USB_DEVICE(0x0711, 0x0901) }, 3271 { USB_DEVICE(0x0711, 0x0901) },
3272 { USB_DEVICE(0x0711, 0x0902) }, 3272 { USB_DEVICE(0x0711, 0x0902) },
3273 { USB_DEVICE(0x0711, 0x0903) },
3273 { USB_DEVICE(0x0711, 0x0918) }, 3274 { USB_DEVICE(0x0711, 0x0918) },
3274 { USB_DEVICE(0x182d, 0x021c) }, 3275 { USB_DEVICE(0x182d, 0x021c) },
3275 { USB_DEVICE(0x182d, 0x0269) }, 3276 { USB_DEVICE(0x182d, 0x0269) },
diff --git a/drivers/usb/misc/vstusb.c b/drivers/usb/misc/vstusb.c
index 8648470c81ca..63dff9ba73c5 100644
--- a/drivers/usb/misc/vstusb.c
+++ b/drivers/usb/misc/vstusb.c
@@ -620,7 +620,7 @@ static long vstusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
620 __func__); 620 __func__);
621 retval = -EFAULT; 621 retval = -EFAULT;
622 } else { 622 } else {
623 dev_dbg(&dev->dev, "%s: recv %d bytes from pipe %d\n", 623 dev_dbg(&dev->dev, "%s: recv %zd bytes from pipe %d\n",
624 __func__, usb_data.count, usb_data.pipe); 624 __func__, usb_data.count, usb_data.pipe);
625 } 625 }
626 626
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 4a35745b30be..5280dba9b1fb 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -114,8 +114,8 @@
114 114
115 115
116 116
117unsigned debug; 117unsigned musb_debug;
118module_param(debug, uint, S_IRUGO | S_IWUSR); 118module_param(musb_debug, uint, S_IRUGO | S_IWUSR);
119MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); 119MODULE_PARM_DESC(debug, "Debug message level. Default = 0");
120 120
121#define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" 121#define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia"
@@ -2248,7 +2248,7 @@ static int __init musb_init(void)
2248 "host" 2248 "host"
2249#endif 2249#endif
2250 ", debug=%d\n", 2250 ", debug=%d\n",
2251 musb_driver_name, debug); 2251 musb_driver_name, musb_debug);
2252 return platform_driver_probe(&musb_driver, musb_probe); 2252 return platform_driver_probe(&musb_driver, musb_probe);
2253} 2253}
2254 2254
diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/musb/musb_debug.h
index 4d2794441b15..9fc1db44c72c 100644
--- a/drivers/usb/musb/musb_debug.h
+++ b/drivers/usb/musb/musb_debug.h
@@ -48,11 +48,11 @@
48 __func__, __LINE__ , ## args); \ 48 __func__, __LINE__ , ## args); \
49 } } while (0) 49 } } while (0)
50 50
51extern unsigned debug; 51extern unsigned musb_debug;
52 52
53static inline int _dbg_level(unsigned l) 53static inline int _dbg_level(unsigned l)
54{ 54{
55 return debug >= l; 55 return musb_debug >= l;
56} 56}
57 57
58#define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args) 58#define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args)
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 3133990f04ec..e45e70bcc5e2 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -378,6 +378,19 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
378 378
379 switch (qh->type) { 379 switch (qh->type) {
380 380
381 case USB_ENDPOINT_XFER_CONTROL:
382 case USB_ENDPOINT_XFER_BULK:
383 /* fifo policy for these lists, except that NAKing
384 * should rotate a qh to the end (for fairness).
385 */
386 if (qh->mux == 1) {
387 head = qh->ring.prev;
388 list_del(&qh->ring);
389 kfree(qh);
390 qh = first_qh(head);
391 break;
392 }
393
381 case USB_ENDPOINT_XFER_ISOC: 394 case USB_ENDPOINT_XFER_ISOC:
382 case USB_ENDPOINT_XFER_INT: 395 case USB_ENDPOINT_XFER_INT:
383 /* this is where periodic bandwidth should be 396 /* this is where periodic bandwidth should be
@@ -388,17 +401,6 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
388 kfree(qh); 401 kfree(qh);
389 qh = NULL; 402 qh = NULL;
390 break; 403 break;
391
392 case USB_ENDPOINT_XFER_CONTROL:
393 case USB_ENDPOINT_XFER_BULK:
394 /* fifo policy for these lists, except that NAKing
395 * should rotate a qh to the end (for fairness).
396 */
397 head = qh->ring.prev;
398 list_del(&qh->ring);
399 kfree(qh);
400 qh = first_qh(head);
401 break;
402 } 404 }
403 } 405 }
404 return qh; 406 return qh;
@@ -1507,10 +1509,29 @@ void musb_host_rx(struct musb *musb, u8 epnum)
1507 musb_writew(hw_ep->regs, MUSB_RXCSR, val); 1509 musb_writew(hw_ep->regs, MUSB_RXCSR, val);
1508 1510
1509#ifdef CONFIG_USB_INVENTRA_DMA 1511#ifdef CONFIG_USB_INVENTRA_DMA
1512 if (usb_pipeisoc(pipe)) {
1513 struct usb_iso_packet_descriptor *d;
1514
1515 d = urb->iso_frame_desc + qh->iso_idx;
1516 d->actual_length = xfer_len;
1517
1518 /* even if there was an error, we did the dma
1519 * for iso_frame_desc->length
1520 */
1521 if (d->status != EILSEQ && d->status != -EOVERFLOW)
1522 d->status = 0;
1523
1524 if (++qh->iso_idx >= urb->number_of_packets)
1525 done = true;
1526 else
1527 done = false;
1528
1529 } else {
1510 /* done if urb buffer is full or short packet is recd */ 1530 /* done if urb buffer is full or short packet is recd */
1511 done = (urb->actual_length + xfer_len >= 1531 done = (urb->actual_length + xfer_len >=
1512 urb->transfer_buffer_length 1532 urb->transfer_buffer_length
1513 || dma->actual_len < qh->maxpacket); 1533 || dma->actual_len < qh->maxpacket);
1534 }
1514 1535
1515 /* send IN token for next packet, without AUTOREQ */ 1536 /* send IN token for next packet, without AUTOREQ */
1516 if (!done) { 1537 if (!done) {
@@ -1547,7 +1568,8 @@ void musb_host_rx(struct musb *musb, u8 epnum)
1547 if (dma) { 1568 if (dma) {
1548 struct dma_controller *c; 1569 struct dma_controller *c;
1549 u16 rx_count; 1570 u16 rx_count;
1550 int ret; 1571 int ret, length;
1572 dma_addr_t buf;
1551 1573
1552 rx_count = musb_readw(epio, MUSB_RXCOUNT); 1574 rx_count = musb_readw(epio, MUSB_RXCOUNT);
1553 1575
@@ -1560,6 +1582,35 @@ void musb_host_rx(struct musb *musb, u8 epnum)
1560 1582
1561 c = musb->dma_controller; 1583 c = musb->dma_controller;
1562 1584
1585 if (usb_pipeisoc(pipe)) {
1586 int status = 0;
1587 struct usb_iso_packet_descriptor *d;
1588
1589 d = urb->iso_frame_desc + qh->iso_idx;
1590
1591 if (iso_err) {
1592 status = -EILSEQ;
1593 urb->error_count++;
1594 }
1595 if (rx_count > d->length) {
1596 if (status == 0) {
1597 status = -EOVERFLOW;
1598 urb->error_count++;
1599 }
1600 DBG(2, "** OVERFLOW %d into %d\n",\
1601 rx_count, d->length);
1602
1603 length = d->length;
1604 } else
1605 length = rx_count;
1606 d->status = status;
1607 buf = urb->transfer_dma + d->offset;
1608 } else {
1609 length = rx_count;
1610 buf = urb->transfer_dma +
1611 urb->actual_length;
1612 }
1613
1563 dma->desired_mode = 0; 1614 dma->desired_mode = 0;
1564#ifdef USE_MODE1 1615#ifdef USE_MODE1
1565 /* because of the issue below, mode 1 will 1616 /* because of the issue below, mode 1 will
@@ -1571,6 +1622,12 @@ void musb_host_rx(struct musb *musb, u8 epnum)
1571 urb->actual_length) 1622 urb->actual_length)
1572 > qh->maxpacket) 1623 > qh->maxpacket)
1573 dma->desired_mode = 1; 1624 dma->desired_mode = 1;
1625 if (rx_count < hw_ep->max_packet_sz_rx) {
1626 length = rx_count;
1627 dma->bDesiredMode = 0;
1628 } else {
1629 length = urb->transfer_buffer_length;
1630 }
1574#endif 1631#endif
1575 1632
1576/* Disadvantage of using mode 1: 1633/* Disadvantage of using mode 1:
@@ -1608,12 +1665,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
1608 */ 1665 */
1609 ret = c->channel_program( 1666 ret = c->channel_program(
1610 dma, qh->maxpacket, 1667 dma, qh->maxpacket,
1611 dma->desired_mode, 1668 dma->desired_mode, buf, length);
1612 urb->transfer_dma
1613 + urb->actual_length,
1614 (dma->desired_mode == 0)
1615 ? rx_count
1616 : urb->transfer_buffer_length);
1617 1669
1618 if (!ret) { 1670 if (!ret) {
1619 c->channel_release(dma); 1671 c->channel_release(dma);
@@ -1631,19 +1683,6 @@ void musb_host_rx(struct musb *musb, u8 epnum)
1631 } 1683 }
1632 } 1684 }
1633 1685
1634 if (dma && usb_pipeisoc(pipe)) {
1635 struct usb_iso_packet_descriptor *d;
1636 int iso_stat = status;
1637
1638 d = urb->iso_frame_desc + qh->iso_idx;
1639 d->actual_length += xfer_len;
1640 if (iso_err) {
1641 iso_stat = -EILSEQ;
1642 urb->error_count++;
1643 }
1644 d->status = iso_stat;
1645 }
1646
1647finish: 1686finish:
1648 urb->actual_length += xfer_len; 1687 urb->actual_length += xfer_len;
1649 qh->offset += xfer_len; 1688 qh->offset += xfer_len;
@@ -1671,22 +1710,9 @@ static int musb_schedule(
1671 struct list_head *head = NULL; 1710 struct list_head *head = NULL;
1672 1711
1673 /* use fixed hardware for control and bulk */ 1712 /* use fixed hardware for control and bulk */
1674 switch (qh->type) { 1713 if (qh->type == USB_ENDPOINT_XFER_CONTROL) {
1675 case USB_ENDPOINT_XFER_CONTROL:
1676 head = &musb->control; 1714 head = &musb->control;
1677 hw_ep = musb->control_ep; 1715 hw_ep = musb->control_ep;
1678 break;
1679 case USB_ENDPOINT_XFER_BULK:
1680 hw_ep = musb->bulk_ep;
1681 if (is_in)
1682 head = &musb->in_bulk;
1683 else
1684 head = &musb->out_bulk;
1685 break;
1686 }
1687 if (head) {
1688 idle = list_empty(head);
1689 list_add_tail(&qh->ring, head);
1690 goto success; 1716 goto success;
1691 } 1717 }
1692 1718
@@ -1725,19 +1751,34 @@ static int musb_schedule(
1725 else 1751 else
1726 diff = hw_ep->max_packet_sz_tx - qh->maxpacket; 1752 diff = hw_ep->max_packet_sz_tx - qh->maxpacket;
1727 1753
1728 if (diff > 0 && best_diff > diff) { 1754 if (diff >= 0 && best_diff > diff) {
1729 best_diff = diff; 1755 best_diff = diff;
1730 best_end = epnum; 1756 best_end = epnum;
1731 } 1757 }
1732 } 1758 }
1733 if (best_end < 0) 1759 /* use bulk reserved ep1 if no other ep is free */
1760 if (best_end > 0 && qh->type == USB_ENDPOINT_XFER_BULK) {
1761 hw_ep = musb->bulk_ep;
1762 if (is_in)
1763 head = &musb->in_bulk;
1764 else
1765 head = &musb->out_bulk;
1766 goto success;
1767 } else if (best_end < 0) {
1734 return -ENOSPC; 1768 return -ENOSPC;
1769 }
1735 1770
1736 idle = 1; 1771 idle = 1;
1772 qh->mux = 0;
1737 hw_ep = musb->endpoints + best_end; 1773 hw_ep = musb->endpoints + best_end;
1738 musb->periodic[best_end] = qh; 1774 musb->periodic[best_end] = qh;
1739 DBG(4, "qh %p periodic slot %d\n", qh, best_end); 1775 DBG(4, "qh %p periodic slot %d\n", qh, best_end);
1740success: 1776success:
1777 if (head) {
1778 idle = list_empty(head);
1779 list_add_tail(&qh->ring, head);
1780 qh->mux = 1;
1781 }
1741 qh->hw_ep = hw_ep; 1782 qh->hw_ep = hw_ep;
1742 qh->hep->hcpriv = qh; 1783 qh->hep->hcpriv = qh;
1743 if (idle) 1784 if (idle)
@@ -2015,11 +2056,13 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
2015 sched = &musb->control; 2056 sched = &musb->control;
2016 break; 2057 break;
2017 case USB_ENDPOINT_XFER_BULK: 2058 case USB_ENDPOINT_XFER_BULK:
2018 if (usb_pipein(urb->pipe)) 2059 if (qh->mux == 1) {
2019 sched = &musb->in_bulk; 2060 if (usb_pipein(urb->pipe))
2020 else 2061 sched = &musb->in_bulk;
2021 sched = &musb->out_bulk; 2062 else
2022 break; 2063 sched = &musb->out_bulk;
2064 break;
2065 }
2023 default: 2066 default:
2024 /* REVISIT when we get a schedule tree, periodic 2067 /* REVISIT when we get a schedule tree, periodic
2025 * transfers won't always be at the head of a 2068 * transfers won't always be at the head of a
@@ -2067,11 +2110,13 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
2067 sched = &musb->control; 2110 sched = &musb->control;
2068 break; 2111 break;
2069 case USB_ENDPOINT_XFER_BULK: 2112 case USB_ENDPOINT_XFER_BULK:
2070 if (is_in) 2113 if (qh->mux == 1) {
2071 sched = &musb->in_bulk; 2114 if (is_in)
2072 else 2115 sched = &musb->in_bulk;
2073 sched = &musb->out_bulk; 2116 else
2074 break; 2117 sched = &musb->out_bulk;
2118 break;
2119 }
2075 default: 2120 default:
2076 /* REVISIT when we get a schedule tree, periodic transfers 2121 /* REVISIT when we get a schedule tree, periodic transfers
2077 * won't always be at the head of a singleton queue... 2122 * won't always be at the head of a singleton queue...
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
index 77bcdb9d5b32..0b7fbcd21963 100644
--- a/drivers/usb/musb/musb_host.h
+++ b/drivers/usb/musb/musb_host.h
@@ -53,6 +53,7 @@ struct musb_qh {
53 53
54 struct list_head ring; /* of musb_qh */ 54 struct list_head ring; /* of musb_qh */
55 /* struct musb_qh *next; */ /* for periodic tree */ 55 /* struct musb_qh *next; */ /* for periodic tree */
56 u8 mux; /* qh multiplexed to hw_ep */
56 57
57 unsigned offset; /* in urb->transfer_buffer */ 58 unsigned offset; /* in urb->transfer_buffer */
58 unsigned segsize; /* current xfer fragment */ 59 unsigned segsize; /* current xfer fragment */
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 9d2dcb121c5e..ce6c162920f7 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -53,7 +53,9 @@ static void musb_do_idle(unsigned long _musb)
53{ 53{
54 struct musb *musb = (void *)_musb; 54 struct musb *musb = (void *)_musb;
55 unsigned long flags; 55 unsigned long flags;
56#ifdef CONFIG_USB_MUSB_HDRC_HCD
56 u8 power; 57 u8 power;
58#endif
57 u8 devctl; 59 u8 devctl;
58 60
59 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); 61 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index b73b036f3d77..ee8fca92a4ac 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -605,7 +605,7 @@ void musb_platform_set_mode(struct musb *musb, u8 musb_mode)
605 605
606 if (musb->board_mode != MUSB_OTG) { 606 if (musb->board_mode != MUSB_OTG) {
607 ERR("Changing mode currently only supported in OTG mode\n"); 607 ERR("Changing mode currently only supported in OTG mode\n");
608 return; 608 return -EINVAL;
609 } 609 }
610 610
611 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); 611 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT);
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index 8008d0bc80ad..9035d7256b03 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -67,6 +67,7 @@ static struct usb_device_id id_table [] = {
67 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ 67 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */
68 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ 68 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
69 { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ 69 { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */
70 { USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */
70 { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ 71 { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
71 { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ 72 { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */
72 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ 73 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
@@ -85,6 +86,7 @@ static struct usb_device_id id_table [] = {
85 { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */ 86 { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
86 { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ 87 { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */
87 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ 88 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
89 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */
88 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 90 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
89 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 91 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
90 { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ 92 { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index b679a556b98d..4e2cda93da59 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -26,7 +26,7 @@
26 * Introduced common header to be used also in USB Gadget Framework. 26 * Introduced common header to be used also in USB Gadget Framework.
27 * Still needs some other style fixes. 27 * Still needs some other style fixes.
28 * 28 *
29 * 2007_Jun_21 Alan Cox <alan@redhat.com> 29 * 2007_Jun_21 Alan Cox <alan@lxorguk.ukuu.org.uk>
30 * Minimal cleanups for some of the driver problens and tty layer abuse. 30 * Minimal cleanups for some of the driver problens and tty layer abuse.
31 * Still needs fixing to allow multiple dongles. 31 * Still needs fixing to allow multiple dongles.
32 * 32 *
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index bd07eaa300b9..6fa1ec441b61 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -160,6 +160,11 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
160 160
161#define NOVATELWIRELESS_VENDOR_ID 0x1410 161#define NOVATELWIRELESS_VENDOR_ID 0x1410
162 162
163/* YISO PRODUCTS */
164
165#define YISO_VENDOR_ID 0x0EAB
166#define YISO_PRODUCT_U893 0xC893
167
163/* MERLIN EVDO PRODUCTS */ 168/* MERLIN EVDO PRODUCTS */
164#define NOVATELWIRELESS_PRODUCT_V640 0x1100 169#define NOVATELWIRELESS_PRODUCT_V640 0x1100
165#define NOVATELWIRELESS_PRODUCT_V620 0x1110 170#define NOVATELWIRELESS_PRODUCT_V620 0x1110
@@ -408,6 +413,7 @@ static struct usb_device_id option_ids[] = {
408 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, 413 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
409 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) }, 414 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) },
410 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, 415 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) },
416 { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) },
411 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 417 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
412 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, 418 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
413 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) }, 419 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) },
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 8be3f39891c7..794b5ffe4397 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -281,6 +281,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
281 if (tty->driver_data) 281 if (tty->driver_data)
282 tty->driver_data = NULL; 282 tty->driver_data = NULL;
283 tty_port_tty_set(&port->port, NULL); 283 tty_port_tty_set(&port->port, NULL);
284 tty_kref_put(tty);
284 } 285 }
285 } 286 }
286 287
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 3d9249632ae1..c68b738900bd 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -2,8 +2,8 @@
2# USB Storage driver configuration 2# USB Storage driver configuration
3# 3#
4 4
5comment "NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'" 5comment "NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;"
6comment "may also be needed; see USB_STORAGE Help for more information" 6comment "see USB_STORAGE Help for more information"
7 depends on USB 7 depends on USB
8 8
9config USB_STORAGE 9config USB_STORAGE
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index a2b9ebbef38e..d4e5fc86e43c 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -253,6 +253,14 @@ UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591,
253 US_SC_DEVICE, US_PR_DEVICE, NULL, 253 US_SC_DEVICE, US_PR_DEVICE, NULL,
254 US_FL_FIX_CAPACITY ), 254 US_FL_FIX_CAPACITY ),
255 255
256/* Submitted by Ricky Wong Yung Fei <evilbladewarrior@gmail.com> */
257/* Nokia 7610 Supernova - Too many sectors reported in usb storage mode */
258UNUSUAL_DEV( 0x0421, 0x00f5, 0x0000, 0x0470,
259 "Nokia",
260 "7610 Supernova",
261 US_SC_DEVICE, US_PR_DEVICE, NULL,
262 US_FL_FIX_CAPACITY ),
263
256/* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */ 264/* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */
257UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, 265UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210,
258 "SMSC", 266 "SMSC",
@@ -333,6 +341,13 @@ UNUSUAL_DEV( 0x0482, 0x0103, 0x0100, 0x0100,
333 "Finecam S5", 341 "Finecam S5",
334 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), 342 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY),
335 343
344/* Patch submitted by Jens Taprogge <jens.taprogge@taprogge.org> */
345UNUSUAL_DEV( 0x0482, 0x0107, 0x0100, 0x0100,
346 "Kyocera",
347 "CONTAX SL300R T*",
348 US_SC_DEVICE, US_PR_DEVICE, NULL,
349 US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE),
350
336/* Reported by Paul Stewart <stewart@wetlogic.net> 351/* Reported by Paul Stewart <stewart@wetlogic.net>
337 * This entry is needed because the device reports Sub=ff */ 352 * This entry is needed because the device reports Sub=ff */
338UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001, 353UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001,
@@ -411,6 +426,13 @@ UNUSUAL_DEV( 0x04b0, 0x0417, 0x0100, 0x0100,
411 US_SC_DEVICE, US_PR_DEVICE, NULL, 426 US_SC_DEVICE, US_PR_DEVICE, NULL,
412 US_FL_FIX_CAPACITY), 427 US_FL_FIX_CAPACITY),
413 428
429/* Reported by paul ready <lxtwin@homecall.co.uk> */
430UNUSUAL_DEV( 0x04b0, 0x0419, 0x0100, 0x0200,
431 "NIKON",
432 "NIKON DSC D300",
433 US_SC_DEVICE, US_PR_DEVICE, NULL,
434 US_FL_FIX_CAPACITY),
435
414/* Reported by Doug Maxey (dwm@austin.ibm.com) */ 436/* Reported by Doug Maxey (dwm@austin.ibm.com) */
415UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110, 437UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110,
416 "IBM", 438 "IBM",
@@ -1251,6 +1273,13 @@ UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001,
1251 US_SC_DEVICE, US_PR_DEVICE, NULL, 1273 US_SC_DEVICE, US_PR_DEVICE, NULL,
1252 US_FL_FIX_INQUIRY), 1274 US_FL_FIX_INQUIRY),
1253 1275
1276/* Reported by Luciano Rocha <luciano@eurotux.com> */
1277UNUSUAL_DEV( 0x0840, 0x0082, 0x0001, 0x0001,
1278 "Argosy",
1279 "Storage",
1280 US_SC_DEVICE, US_PR_DEVICE, NULL,
1281 US_FL_FIX_CAPACITY),
1282
1254/* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>. 1283/* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>.
1255 * Flag will support Bulk devices which use a standards-violating 32-byte 1284 * Flag will support Bulk devices which use a standards-violating 32-byte
1256 * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with 1285 * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with