aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:35:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:35:43 -0500
commitc9140487b4601ea0b4479af3d92ceb0cda2c691f (patch)
tree6ff23dfe9d7366accade95b6aaad9ffd434690d0
parent456eac94789e1b512515e6974e091ef655f343de (diff)
parent0a2fea2e0dea9df8ead1cb45e4b9cd68e1b1d29b (diff)
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: isp1362: fix build failure on ARM systems via irq_flags cleanup USB: isp1362: better 64bit printf warning fixes USB: fix usbstorage for 2770:915d delivers no FAT USB: Fix level of isp1760 Reloading ptd error message USB: FHCI: avoid NULL pointer dereference USB: Fix duplicate sysfs problem after device reset. USB: add speed values for USB 3.0 and wireless controllers USB: add missing delay during remote wakeup USB: EHCI & UHCI: fix race between root-hub suspend and port resume USB: EHCI: fix handling of unusual interrupt intervals USB: Don't use GFP_KERNEL while we cannot reset a storage device USB: fix bitmask merge error usb: serial: fix memory leak in generic driver USB: serial: fix USB serial fix kfifo_len locking
-rw-r--r--drivers/usb/core/devices.c2
-rw-r--r--drivers/usb/core/hcd.c18
-rw-r--r--drivers/usb/core/hub.c18
-rw-r--r--drivers/usb/core/message.c8
-rw-r--r--drivers/usb/core/sysfs.c6
-rw-r--r--drivers/usb/host/ehci-hcd.c5
-rw-r--r--drivers/usb/host/ehci-hub.c20
-rw-r--r--drivers/usb/host/ehci-q.c11
-rw-r--r--drivers/usb/host/fhci-hcd.c3
-rw-r--r--drivers/usb/host/isp1362-hcd.c25
-rw-r--r--drivers/usb/host/isp1760-hcd.c6
-rw-r--r--drivers/usb/host/uhci-hcd.c15
-rw-r--r--drivers/usb/host/uhci-hub.c2
-rw-r--r--drivers/usb/serial/generic.c10
-rw-r--r--drivers/usb/storage/unusual_devs.h7
-rw-r--r--drivers/usb/storage/usb.c3
-rw-r--r--include/linux/usb.h1
17 files changed, 112 insertions, 48 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 96f11715cd26..355dffcc23b0 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -494,7 +494,7 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
494 return 0; 494 return 0;
495 /* allocate 2^1 pages = 8K (on i386); 495 /* allocate 2^1 pages = 8K (on i386);
496 * should be more than enough for one device */ 496 * should be more than enough for one device */
497 pages_start = (char *)__get_free_pages(GFP_KERNEL, 1); 497 pages_start = (char *)__get_free_pages(GFP_NOIO, 1);
498 if (!pages_start) 498 if (!pages_start)
499 return -ENOMEM; 499 return -ENOMEM;
500 500
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 0495fa651225..80995ef0868c 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1684,6 +1684,24 @@ int usb_hcd_alloc_bandwidth(struct usb_device *udev,
1684 } 1684 }
1685 } 1685 }
1686 if (cur_alt && new_alt) { 1686 if (cur_alt && new_alt) {
1687 struct usb_interface *iface = usb_ifnum_to_if(udev,
1688 cur_alt->desc.bInterfaceNumber);
1689
1690 if (iface->resetting_device) {
1691 /*
1692 * The USB core just reset the device, so the xHCI host
1693 * and the device will think alt setting 0 is installed.
1694 * However, the USB core will pass in the alternate
1695 * setting installed before the reset as cur_alt. Dig
1696 * out the alternate setting 0 structure, or the first
1697 * alternate setting if a broken device doesn't have alt
1698 * setting 0.
1699 */
1700 cur_alt = usb_altnum_to_altsetting(iface, 0);
1701 if (!cur_alt)
1702 cur_alt = &iface->altsetting[0];
1703 }
1704
1687 /* Drop all the endpoints in the current alt setting */ 1705 /* Drop all the endpoints in the current alt setting */
1688 for (i = 0; i < cur_alt->desc.bNumEndpoints; i++) { 1706 for (i = 0; i < cur_alt->desc.bNumEndpoints; i++) {
1689 ret = hcd->driver->drop_endpoint(hcd, udev, 1707 ret = hcd->driver->drop_endpoint(hcd, udev,
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 0cec6caf6e9b..35cc8b9ba1f5 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3347,6 +3347,9 @@ static void hub_events(void)
3347 USB_PORT_FEAT_C_SUSPEND); 3347 USB_PORT_FEAT_C_SUSPEND);
3348 udev = hdev->children[i-1]; 3348 udev = hdev->children[i-1];
3349 if (udev) { 3349 if (udev) {
3350 /* TRSMRCY = 10 msec */
3351 msleep(10);
3352
3350 usb_lock_device(udev); 3353 usb_lock_device(udev);
3351 ret = remote_wakeup(hdev-> 3354 ret = remote_wakeup(hdev->
3352 children[i-1]); 3355 children[i-1]);
@@ -3692,19 +3695,14 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
3692 usb_enable_interface(udev, intf, true); 3695 usb_enable_interface(udev, intf, true);
3693 ret = 0; 3696 ret = 0;
3694 } else { 3697 } else {
3695 /* We've just reset the device, so it will think alt 3698 /* Let the bandwidth allocation function know that this
3696 * setting 0 is installed. For usb_set_interface() to 3699 * device has been reset, and it will have to use
3697 * work properly, we need to set the current alternate 3700 * alternate setting 0 as the current alternate setting.
3698 * interface setting to 0 (or the first alt setting, if
3699 * the device doesn't have alt setting 0).
3700 */ 3701 */
3701 intf->cur_altsetting = 3702 intf->resetting_device = 1;
3702 usb_find_alt_setting(config, i, 0);
3703 if (!intf->cur_altsetting)
3704 intf->cur_altsetting =
3705 &config->intf_cache[i]->altsetting[0];
3706 ret = usb_set_interface(udev, desc->bInterfaceNumber, 3703 ret = usb_set_interface(udev, desc->bInterfaceNumber,
3707 desc->bAlternateSetting); 3704 desc->bAlternateSetting);
3705 intf->resetting_device = 0;
3708 } 3706 }
3709 if (ret < 0) { 3707 if (ret < 0) {
3710 dev_err(&udev->dev, "failed to restore interface %d " 3708 dev_err(&udev->dev, "failed to restore interface %d "
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 1b994846e8e0..9bc95fec793f 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -906,11 +906,11 @@ char *usb_cache_string(struct usb_device *udev, int index)
906 if (index <= 0) 906 if (index <= 0)
907 return NULL; 907 return NULL;
908 908
909 buf = kmalloc(MAX_USB_STRING_SIZE, GFP_KERNEL); 909 buf = kmalloc(MAX_USB_STRING_SIZE, GFP_NOIO);
910 if (buf) { 910 if (buf) {
911 len = usb_string(udev, index, buf, MAX_USB_STRING_SIZE); 911 len = usb_string(udev, index, buf, MAX_USB_STRING_SIZE);
912 if (len > 0) { 912 if (len > 0) {
913 smallbuf = kmalloc(++len, GFP_KERNEL); 913 smallbuf = kmalloc(++len, GFP_NOIO);
914 if (!smallbuf) 914 if (!smallbuf)
915 return buf; 915 return buf;
916 memcpy(smallbuf, buf, len); 916 memcpy(smallbuf, buf, len);
@@ -1731,7 +1731,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
1731 if (cp) { 1731 if (cp) {
1732 nintf = cp->desc.bNumInterfaces; 1732 nintf = cp->desc.bNumInterfaces;
1733 new_interfaces = kmalloc(nintf * sizeof(*new_interfaces), 1733 new_interfaces = kmalloc(nintf * sizeof(*new_interfaces),
1734 GFP_KERNEL); 1734 GFP_NOIO);
1735 if (!new_interfaces) { 1735 if (!new_interfaces) {
1736 dev_err(&dev->dev, "Out of memory\n"); 1736 dev_err(&dev->dev, "Out of memory\n");
1737 return -ENOMEM; 1737 return -ENOMEM;
@@ -1740,7 +1740,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
1740 for (; n < nintf; ++n) { 1740 for (; n < nintf; ++n) {
1741 new_interfaces[n] = kzalloc( 1741 new_interfaces[n] = kzalloc(
1742 sizeof(struct usb_interface), 1742 sizeof(struct usb_interface),
1743 GFP_KERNEL); 1743 GFP_NOIO);
1744 if (!new_interfaces[n]) { 1744 if (!new_interfaces[n]) {
1745 dev_err(&dev->dev, "Out of memory\n"); 1745 dev_err(&dev->dev, "Out of memory\n");
1746 ret = -ENOMEM; 1746 ret = -ENOMEM;
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 485edf937f25..5f3908f6e2dc 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -115,6 +115,12 @@ show_speed(struct device *dev, struct device_attribute *attr, char *buf)
115 case USB_SPEED_HIGH: 115 case USB_SPEED_HIGH:
116 speed = "480"; 116 speed = "480";
117 break; 117 break;
118 case USB_SPEED_VARIABLE:
119 speed = "480";
120 break;
121 case USB_SPEED_SUPER:
122 speed = "5000";
123 break;
118 default: 124 default:
119 speed = "unknown"; 125 speed = "unknown";
120 } 126 }
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 5859522d6edd..1ec3857f22e6 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -787,9 +787,10 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
787 787
788 /* start 20 msec resume signaling from this port, 788 /* start 20 msec resume signaling from this port,
789 * and make khubd collect PORT_STAT_C_SUSPEND to 789 * and make khubd collect PORT_STAT_C_SUSPEND to
790 * stop that signaling. 790 * stop that signaling. Use 5 ms extra for safety,
791 * like usb_port_resume() does.
791 */ 792 */
792 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20); 793 ehci->reset_done[i] = jiffies + msecs_to_jiffies(25);
793 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); 794 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
794 mod_timer(&hcd->rh_timer, ehci->reset_done[i]); 795 mod_timer(&hcd->rh_timer, ehci->reset_done[i]);
795 } 796 }
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 2c6571c05f35..c75d9270c752 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -120,9 +120,26 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
120 del_timer_sync(&ehci->watchdog); 120 del_timer_sync(&ehci->watchdog);
121 del_timer_sync(&ehci->iaa_watchdog); 121 del_timer_sync(&ehci->iaa_watchdog);
122 122
123 port = HCS_N_PORTS (ehci->hcs_params);
124 spin_lock_irq (&ehci->lock); 123 spin_lock_irq (&ehci->lock);
125 124
125 /* Once the controller is stopped, port resumes that are already
126 * in progress won't complete. Hence if remote wakeup is enabled
127 * for the root hub and any ports are in the middle of a resume or
128 * remote wakeup, we must fail the suspend.
129 */
130 if (hcd->self.root_hub->do_remote_wakeup) {
131 port = HCS_N_PORTS(ehci->hcs_params);
132 while (port--) {
133 if (ehci->reset_done[port] != 0) {
134 spin_unlock_irq(&ehci->lock);
135 ehci_dbg(ehci, "suspend failed because "
136 "port %d is resuming\n",
137 port + 1);
138 return -EBUSY;
139 }
140 }
141 }
142
126 /* stop schedules, clean any completed work */ 143 /* stop schedules, clean any completed work */
127 if (HC_IS_RUNNING(hcd->state)) { 144 if (HC_IS_RUNNING(hcd->state)) {
128 ehci_quiesce (ehci); 145 ehci_quiesce (ehci);
@@ -138,6 +155,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
138 */ 155 */
139 ehci->bus_suspended = 0; 156 ehci->bus_suspended = 0;
140 ehci->owned_ports = 0; 157 ehci->owned_ports = 0;
158 port = HCS_N_PORTS(ehci->hcs_params);
141 while (port--) { 159 while (port--) {
142 u32 __iomem *reg = &ehci->regs->port_status [port]; 160 u32 __iomem *reg = &ehci->regs->port_status [port];
143 u32 t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS; 161 u32 t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index a427d3b00634..89521775c567 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -849,9 +849,10 @@ qh_make (
849 * But interval 1 scheduling is simpler, and 849 * But interval 1 scheduling is simpler, and
850 * includes high bandwidth. 850 * includes high bandwidth.
851 */ 851 */
852 dbg ("intr period %d uframes, NYET!", 852 urb->interval = 1;
853 urb->interval); 853 } else if (qh->period > ehci->periodic_size) {
854 goto done; 854 qh->period = ehci->periodic_size;
855 urb->interval = qh->period << 3;
855 } 856 }
856 } else { 857 } else {
857 int think_time; 858 int think_time;
@@ -874,6 +875,10 @@ qh_make (
874 usb_calc_bus_time (urb->dev->speed, 875 usb_calc_bus_time (urb->dev->speed,
875 is_input, 0, max_packet (maxp))); 876 is_input, 0, max_packet (maxp)));
876 qh->period = urb->interval; 877 qh->period = urb->interval;
878 if (qh->period > ehci->periodic_size) {
879 qh->period = ehci->periodic_size;
880 urb->interval = qh->period;
881 }
877 } 882 }
878 } 883 }
879 884
diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
index 0951818ef93b..78e7c3cfcb72 100644
--- a/drivers/usb/host/fhci-hcd.c
+++ b/drivers/usb/host/fhci-hcd.c
@@ -242,9 +242,10 @@ err:
242static void fhci_usb_free(void *lld) 242static void fhci_usb_free(void *lld)
243{ 243{
244 struct fhci_usb *usb = lld; 244 struct fhci_usb *usb = lld;
245 struct fhci_hcd *fhci = usb->fhci; 245 struct fhci_hcd *fhci;
246 246
247 if (usb) { 247 if (usb) {
248 fhci = usb->fhci;
248 fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF); 249 fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF);
249 fhci_ep0_free(usb); 250 fhci_ep0_free(usb);
250 kfree(usb->actual_frame); 251 kfree(usb->actual_frame);
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 73352f3739b5..42971657fde2 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -2270,10 +2270,10 @@ static int isp1362_mem_config(struct usb_hcd *hcd)
2270 dev_info(hcd->self.controller, "ISP1362 Memory usage:\n"); 2270 dev_info(hcd->self.controller, "ISP1362 Memory usage:\n");
2271 dev_info(hcd->self.controller, " ISTL: 2 * %4d: %4d @ $%04x:$%04x\n", 2271 dev_info(hcd->self.controller, " ISTL: 2 * %4d: %4d @ $%04x:$%04x\n",
2272 istl_size / 2, istl_size, 0, istl_size / 2); 2272 istl_size / 2, istl_size, 0, istl_size / 2);
2273 dev_info(hcd->self.controller, " INTL: %4d * (%3lu+8): %4d @ $%04x\n", 2273 dev_info(hcd->self.controller, " INTL: %4d * (%3zu+8): %4d @ $%04x\n",
2274 ISP1362_INTL_BUFFERS, intl_blksize - PTD_HEADER_SIZE, 2274 ISP1362_INTL_BUFFERS, intl_blksize - PTD_HEADER_SIZE,
2275 intl_size, istl_size); 2275 intl_size, istl_size);
2276 dev_info(hcd->self.controller, " ATL : %4d * (%3lu+8): %4d @ $%04x\n", 2276 dev_info(hcd->self.controller, " ATL : %4d * (%3zu+8): %4d @ $%04x\n",
2277 atl_buffers, atl_blksize - PTD_HEADER_SIZE, 2277 atl_buffers, atl_blksize - PTD_HEADER_SIZE,
2278 atl_size, istl_size + intl_size); 2278 atl_size, istl_size + intl_size);
2279 dev_info(hcd->self.controller, " USED/FREE: %4d %4d\n", total, 2279 dev_info(hcd->self.controller, " USED/FREE: %4d %4d\n", total,
@@ -2697,6 +2697,8 @@ static int __init isp1362_probe(struct platform_device *pdev)
2697 void __iomem *data_reg; 2697 void __iomem *data_reg;
2698 int irq; 2698 int irq;
2699 int retval = 0; 2699 int retval = 0;
2700 struct resource *irq_res;
2701 unsigned int irq_flags = 0;
2700 2702
2701 /* basic sanity checks first. board-specific init logic should 2703 /* basic sanity checks first. board-specific init logic should
2702 * have initialized this the three resources and probably board 2704 * have initialized this the three resources and probably board
@@ -2710,11 +2712,12 @@ static int __init isp1362_probe(struct platform_device *pdev)
2710 2712
2711 data = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2713 data = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2712 addr = platform_get_resource(pdev, IORESOURCE_MEM, 1); 2714 addr = platform_get_resource(pdev, IORESOURCE_MEM, 1);
2713 irq = platform_get_irq(pdev, 0); 2715 irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
2714 if (!addr || !data || irq < 0) { 2716 if (!addr || !data || !irq_res) {
2715 retval = -ENODEV; 2717 retval = -ENODEV;
2716 goto err1; 2718 goto err1;
2717 } 2719 }
2720 irq = irq_res->start;
2718 2721
2719#ifdef CONFIG_USB_HCD_DMA 2722#ifdef CONFIG_USB_HCD_DMA
2720 if (pdev->dev.dma_mask) { 2723 if (pdev->dev.dma_mask) {
@@ -2781,12 +2784,16 @@ static int __init isp1362_probe(struct platform_device *pdev)
2781 } 2784 }
2782#endif 2785#endif
2783 2786
2784#ifdef CONFIG_ARM 2787 if (irq_res->flags & IORESOURCE_IRQ_HIGHEDGE)
2785 if (isp1362_hcd->board) 2788 irq_flags |= IRQF_TRIGGER_RISING;
2786 set_irq_type(irq, isp1362_hcd->board->int_act_high ? IRQT_RISING : IRQT_FALLING); 2789 if (irq_res->flags & IORESOURCE_IRQ_LOWEDGE)
2787#endif 2790 irq_flags |= IRQF_TRIGGER_FALLING;
2791 if (irq_res->flags & IORESOURCE_IRQ_HIGHLEVEL)
2792 irq_flags |= IRQF_TRIGGER_HIGH;
2793 if (irq_res->flags & IORESOURCE_IRQ_LOWLEVEL)
2794 irq_flags |= IRQF_TRIGGER_LOW;
2788 2795
2789 retval = usb_add_hcd(hcd, irq, IRQF_TRIGGER_LOW | IRQF_DISABLED | IRQF_SHARED); 2796 retval = usb_add_hcd(hcd, irq, irq_flags | IRQF_DISABLED | IRQF_SHARED);
2790 if (retval != 0) 2797 if (retval != 0)
2791 goto err6; 2798 goto err6;
2792 pr_info("%s, irq %d\n", hcd->product_desc, irq); 2799 pr_info("%s, irq %d\n", hcd->product_desc, irq);
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index 9600a58299db..27b8f7cb4471 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -1039,12 +1039,12 @@ static void do_atl_int(struct usb_hcd *usb_hcd)
1039 if (!nakcount && (dw3 & DW3_QTD_ACTIVE)) { 1039 if (!nakcount && (dw3 & DW3_QTD_ACTIVE)) {
1040 u32 buffstatus; 1040 u32 buffstatus;
1041 1041
1042 /* XXX 1042 /*
1043 * NAKs are handled in HW by the chip. Usually if the 1043 * NAKs are handled in HW by the chip. Usually if the
1044 * device is not able to send data fast enough. 1044 * device is not able to send data fast enough.
1045 * This did not trigger for a long time now. 1045 * This happens mostly on slower hardware.
1046 */ 1046 */
1047 printk(KERN_ERR "Reloading ptd %p/%p... qh %p readed: " 1047 printk(KERN_NOTICE "Reloading ptd %p/%p... qh %p read: "
1048 "%d of %zu done: %08x cur: %08x\n", qtd, 1048 "%d of %zu done: %08x cur: %08x\n", qtd,
1049 urb, qh, PTD_XFERRED_LENGTH(dw3), 1049 urb, qh, PTD_XFERRED_LENGTH(dw3),
1050 qtd->length, done_map, 1050 qtd->length, done_map,
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 5cd0e48f67fb..99cd00fd3514 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -749,7 +749,20 @@ static int uhci_rh_suspend(struct usb_hcd *hcd)
749 spin_lock_irq(&uhci->lock); 749 spin_lock_irq(&uhci->lock);
750 if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) 750 if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
751 rc = -ESHUTDOWN; 751 rc = -ESHUTDOWN;
752 else if (!uhci->dead) 752 else if (uhci->dead)
753 ; /* Dead controllers tell no tales */
754
755 /* Once the controller is stopped, port resumes that are already
756 * in progress won't complete. Hence if remote wakeup is enabled
757 * for the root hub and any ports are in the middle of a resume or
758 * remote wakeup, we must fail the suspend.
759 */
760 else if (hcd->self.root_hub->do_remote_wakeup &&
761 uhci->resuming_ports) {
762 dev_dbg(uhci_dev(uhci), "suspend failed because a port "
763 "is resuming\n");
764 rc = -EBUSY;
765 } else
753 suspend_rh(uhci, UHCI_RH_SUSPENDED); 766 suspend_rh(uhci, UHCI_RH_SUSPENDED);
754 spin_unlock_irq(&uhci->lock); 767 spin_unlock_irq(&uhci->lock);
755 return rc; 768 return rc;
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
index 885b585360b9..8270055848ca 100644
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -167,7 +167,7 @@ static void uhci_check_ports(struct uhci_hcd *uhci)
167 /* Port received a wakeup request */ 167 /* Port received a wakeup request */
168 set_bit(port, &uhci->resuming_ports); 168 set_bit(port, &uhci->resuming_ports);
169 uhci->ports_timeout = jiffies + 169 uhci->ports_timeout = jiffies +
170 msecs_to_jiffies(20); 170 msecs_to_jiffies(25);
171 171
172 /* Make sure we see the port again 172 /* Make sure we see the port again
173 * after the resuming period is over. */ 173 * after the resuming period is over. */
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index f1ea3a33b6e6..83443d6306d6 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -386,12 +386,12 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty)
386 386
387 dbg("%s - port %d", __func__, port->number); 387 dbg("%s - port %d", __func__, port->number);
388 388
389 if (serial->type->max_in_flight_urbs) { 389 spin_lock_irqsave(&port->lock, flags);
390 spin_lock_irqsave(&port->lock, flags); 390 if (serial->type->max_in_flight_urbs)
391 chars = port->tx_bytes_flight; 391 chars = port->tx_bytes_flight;
392 spin_unlock_irqrestore(&port->lock, flags); 392 else if (serial->num_bulk_out)
393 } else if (serial->num_bulk_out)
394 chars = kfifo_len(&port->write_fifo); 393 chars = kfifo_len(&port->write_fifo);
394 spin_unlock_irqrestore(&port->lock, flags);
395 395
396 dbg("%s - returns %d", __func__, chars); 396 dbg("%s - returns %d", __func__, chars);
397 return chars; 397 return chars;
@@ -489,6 +489,8 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
489 dbg("%s - port %d", __func__, port->number); 489 dbg("%s - port %d", __func__, port->number);
490 490
491 if (port->serial->type->max_in_flight_urbs) { 491 if (port->serial->type->max_in_flight_urbs) {
492 kfree(urb->transfer_buffer);
493
492 spin_lock_irqsave(&port->lock, flags); 494 spin_lock_irqsave(&port->lock, flags);
493 --port->urbs_in_flight; 495 --port->urbs_in_flight;
494 port->tx_bytes_flight -= urb->transfer_buffer_length; 496 port->tx_bytes_flight -= urb->transfer_buffer_length;
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 64a0a2c27e12..c932f9053188 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1807,13 +1807,6 @@ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
1807 US_SC_DEVICE, US_PR_DEVICE, NULL, 1807 US_SC_DEVICE, US_PR_DEVICE, NULL,
1808 US_FL_GO_SLOW ), 1808 US_FL_GO_SLOW ),
1809 1809
1810/* Reported by Rohan Hart <rohan.hart17@gmail.com> */
1811UNUSUAL_DEV( 0x2770, 0x915d, 0x0010, 0x0010,
1812 "INTOVA",
1813 "Pixtreme",
1814 US_SC_DEVICE, US_PR_DEVICE, NULL,
1815 US_FL_FIX_CAPACITY ),
1816
1817/* Reported by Frederic Marchal <frederic.marchal@wowcompany.com> 1810/* Reported by Frederic Marchal <frederic.marchal@wowcompany.com>
1818 * Mio Moov 330 1811 * Mio Moov 330
1819 */ 1812 */
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 5a53d4f0dd11..e9f995486ec1 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -434,7 +434,8 @@ static void adjust_quirks(struct us_data *us)
434 u16 vid = le16_to_cpu(us->pusb_dev->descriptor.idVendor); 434 u16 vid = le16_to_cpu(us->pusb_dev->descriptor.idVendor);
435 u16 pid = le16_to_cpu(us->pusb_dev->descriptor.idProduct); 435 u16 pid = le16_to_cpu(us->pusb_dev->descriptor.idProduct);
436 unsigned f = 0; 436 unsigned f = 0;
437 unsigned int mask = (US_FL_SANE_SENSE | US_FL_FIX_CAPACITY | 437 unsigned int mask = (US_FL_SANE_SENSE | US_FL_BAD_SENSE |
438 US_FL_FIX_CAPACITY |
438 US_FL_CAPACITY_HEURISTICS | US_FL_IGNORE_DEVICE | 439 US_FL_CAPACITY_HEURISTICS | US_FL_IGNORE_DEVICE |
439 US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 | 440 US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 |
440 US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE | 441 US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE |
diff --git a/include/linux/usb.h b/include/linux/usb.h
index e101a2d04d75..d7ace1b80f09 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -192,6 +192,7 @@ struct usb_interface {
192 unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ 192 unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */
193 unsigned needs_binding:1; /* needs delayed unbind/rebind */ 193 unsigned needs_binding:1; /* needs delayed unbind/rebind */
194 unsigned reset_running:1; 194 unsigned reset_running:1;
195 unsigned resetting_device:1; /* true: bandwidth alloc after reset */
195 196
196 struct device dev; /* interface specific device info */ 197 struct device dev; /* interface specific device info */
197 struct device *usb_dev; 198 struct device *usb_dev;