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: fsl_udc_core: Fix kernel oops on module removal
USB: option: TLAYTECH TUE800 support
USB: r8a66597-hcd: fix cannot detect a device when uses_new_polling is set
USB: serial: sierra driver autopm fixes
USB: serial: sierra driver send_setup() autopm fix
USB: rndis_host: debug info clobbered before it is logged

+44 -31
+3 -3
drivers/net/usb/rndis_host.c
··· 362 362 retval = -EINVAL; 363 363 goto halt_fail_and_release; 364 364 } 365 - dev->hard_mtu = tmp; 366 - net->mtu = dev->hard_mtu - net->hard_header_len; 367 365 dev_warn(&intf->dev, 368 366 "dev can't take %u byte packets (max %u), " 369 367 "adjusting MTU to %u\n", 370 - dev->hard_mtu, tmp, net->mtu); 368 + dev->hard_mtu, tmp, tmp - net->hard_header_len); 369 + dev->hard_mtu = tmp; 370 + net->mtu = dev->hard_mtu - net->hard_header_len; 371 371 } 372 372 373 373 /* REVISIT: peripheral "alignment" request is ignored ... */
+1 -1
drivers/usb/gadget/fsl_udc_core.c
··· 2139 2139 static void fsl_udc_release(struct device *dev) 2140 2140 { 2141 2141 complete(udc_controller->done); 2142 - dma_free_coherent(dev, udc_controller->ep_qh_size, 2142 + dma_free_coherent(dev->parent, udc_controller->ep_qh_size, 2143 2143 udc_controller->ep_qh, udc_controller->ep_qh_dma); 2144 2144 kfree(udc_controller); 2145 2145 }
+14 -11
drivers/usb/host/r8a66597-hcd.c
··· 1003 1003 if (syssts == SE0) { 1004 1004 r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); 1005 1005 r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port)); 1006 - return; 1006 + } else { 1007 + if (syssts == FS_JSTS) 1008 + r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port)); 1009 + else if (syssts == LS_JSTS) 1010 + r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port)); 1011 + 1012 + r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port)); 1013 + r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port)); 1014 + 1015 + if (r8a66597->bus_suspended) 1016 + usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); 1007 1017 } 1008 1018 1009 - if (syssts == FS_JSTS) 1010 - r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port)); 1011 - else if (syssts == LS_JSTS) 1012 - r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port)); 1013 - 1014 - r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port)); 1015 - r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port)); 1016 - 1017 - if (r8a66597->bus_suspended) 1018 - usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); 1019 + usb_hcd_poll_rh_status(r8a66597_to_hcd(r8a66597)); 1019 1020 } 1020 1021 1021 1022 /* this function must be called with interrupt disabled */ ··· 1025 1024 u16 speed = get_rh_usb_speed(r8a66597, port); 1026 1025 struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; 1027 1026 1027 + rh->port &= ~((1 << USB_PORT_FEAT_HIGHSPEED) | 1028 + (1 << USB_PORT_FEAT_LOWSPEED)); 1028 1029 if (speed == HSMODE) 1029 1030 rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED); 1030 1031 else if (speed == LSMODE)
+4
drivers/usb/serial/option.c
··· 315 315 #define QISDA_PRODUCT_H20_4515 0x4515 316 316 #define QISDA_PRODUCT_H20_4519 0x4519 317 317 318 + /* TLAYTECH PRODUCTS */ 319 + #define TLAYTECH_VENDOR_ID 0x20B9 320 + #define TLAYTECH_PRODUCT_TEU800 0x1682 318 321 319 322 /* TOSHIBA PRODUCTS */ 320 323 #define TOSHIBA_VENDOR_ID 0x0930 ··· 596 593 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, 597 594 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, 598 595 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 596 + { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 599 597 { } /* Terminating entry */ 600 598 }; 601 599 MODULE_DEVICE_TABLE(usb, option_ids);
+22 -16
drivers/usb/serial/sierra.c
··· 296 296 int dsr_state; 297 297 int dcd_state; 298 298 int ri_state; 299 - 300 299 unsigned int opened:1; 301 300 }; 302 301 ··· 305 306 struct sierra_port_private *portdata; 306 307 __u16 interface = 0; 307 308 int val = 0; 309 + int do_send = 0; 310 + int retval; 308 311 309 312 dev_dbg(&port->dev, "%s\n", __func__); 310 313 ··· 325 324 */ 326 325 if (port->interrupt_in_urb) { 327 326 /* send control message */ 328 - return usb_control_msg(serial->dev, 329 - usb_rcvctrlpipe(serial->dev, 0), 330 - 0x22, 0x21, val, interface, 331 - NULL, 0, USB_CTRL_SET_TIMEOUT); 327 + do_send = 1; 332 328 } 333 329 } 334 330 ··· 337 339 interface = 1; 338 340 else if (port->bulk_out_endpointAddress == 5) 339 341 interface = 2; 340 - return usb_control_msg(serial->dev, 341 - usb_rcvctrlpipe(serial->dev, 0), 342 - 0x22, 0x21, val, interface, 343 - NULL, 0, USB_CTRL_SET_TIMEOUT); 342 + 343 + do_send = 1; 344 344 } 345 - return 0; 345 + if (!do_send) 346 + return 0; 347 + 348 + usb_autopm_get_interface(serial->interface); 349 + retval = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 350 + 0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT); 351 + usb_autopm_put_interface(serial->interface); 352 + 353 + return retval; 346 354 } 347 355 348 356 static void sierra_set_termios(struct tty_struct *tty, ··· 777 773 778 774 if (serial->dev) { 779 775 mutex_lock(&serial->disc_mutex); 780 - if (!serial->disconnected) 776 + if (!serial->disconnected) { 777 + serial->interface->needs_remote_wakeup = 0; 778 + usb_autopm_get_interface(serial->interface); 781 779 sierra_send_setup(port); 780 + } 782 781 mutex_unlock(&serial->disc_mutex); 783 782 spin_lock_irq(&intfdata->susp_lock); 784 783 portdata->opened = 0; ··· 795 788 sierra_release_urb(portdata->in_urbs[i]); 796 789 portdata->in_urbs[i] = NULL; 797 790 } 798 - usb_autopm_get_interface(serial->interface); 799 - serial->interface->needs_remote_wakeup = 0; 800 791 } 801 792 } 802 793 ··· 832 827 if (err) { 833 828 /* get rid of everything as in close */ 834 829 sierra_close(port); 830 + /* restore balance for autopm */ 831 + usb_autopm_put_interface(serial->interface); 835 832 return err; 836 833 } 837 834 sierra_send_setup(port); ··· 922 915 #ifdef CONFIG_PM 923 916 static void stop_read_write_urbs(struct usb_serial *serial) 924 917 { 925 - int i, j; 918 + int i; 926 919 struct usb_serial_port *port; 927 920 struct sierra_port_private *portdata; 928 921 ··· 930 923 for (i = 0; i < serial->num_ports; ++i) { 931 924 port = serial->port[i]; 932 925 portdata = usb_get_serial_port_data(port); 933 - for (j = 0; j < N_IN_URB; j++) 934 - usb_kill_urb(portdata->in_urbs[j]); 926 + sierra_stop_rx_urbs(port); 935 927 usb_kill_anchored_urbs(&portdata->active); 936 928 } 937 929 }