Commit eb2890c92fe3232345de5c8ba56e4ed4ae6422e1
Exists in
master
and in
4 other branches
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
Showing 5 changed files Side-by-side Diff
drivers/net/usb/rndis_host.c
... | ... | @@ -362,12 +362,12 @@ |
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 ... */ |
drivers/usb/gadget/fsl_udc_core.c
... | ... | @@ -2139,7 +2139,7 @@ |
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 | } |
drivers/usb/host/r8a66597-hcd.c
... | ... | @@ -1003,19 +1003,20 @@ |
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; | |
1007 | - } | |
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)); | |
1008 | 1011 | |
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)); | |
1012 | + r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port)); | |
1013 | + r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port)); | |
1013 | 1014 | |
1014 | - r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port)); | |
1015 | - r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port)); | |
1015 | + if (r8a66597->bus_suspended) | |
1016 | + usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); | |
1017 | + } | |
1016 | 1018 | |
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 */ |
... | ... | @@ -1024,6 +1025,8 @@ |
1024 | 1025 | u16 speed = get_rh_usb_speed(r8a66597, port); |
1025 | 1026 | struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; |
1026 | 1027 | |
1028 | + rh->port &= ~((1 << USB_PORT_FEAT_HIGHSPEED) | | |
1029 | + (1 << USB_PORT_FEAT_LOWSPEED)); | |
1027 | 1030 | if (speed == HSMODE) |
1028 | 1031 | rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED); |
1029 | 1032 | else if (speed == LSMODE) |
drivers/usb/serial/option.c
... | ... | @@ -315,6 +315,9 @@ |
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 |
... | ... | @@ -593,6 +596,7 @@ |
593 | 596 | { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, |
594 | 597 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, |
595 | 598 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
599 | + { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, | |
596 | 600 | { } /* Terminating entry */ |
597 | 601 | }; |
598 | 602 | MODULE_DEVICE_TABLE(usb, option_ids); |
drivers/usb/serial/sierra.c
... | ... | @@ -296,7 +296,6 @@ |
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 | |
... | ... | @@ -306,6 +305,8 @@ |
306 | 305 | struct sierra_port_private *portdata; |
307 | 306 | __u16 interface = 0; |
308 | 307 | int val = 0; |
308 | + int do_send = 0; | |
309 | + int retval; | |
309 | 310 | |
310 | 311 | dev_dbg(&port->dev, "%s\n", __func__); |
311 | 312 | |
... | ... | @@ -324,10 +325,7 @@ |
324 | 325 | */ |
325 | 326 | if (port->interrupt_in_urb) { |
326 | 327 | /* send control message */ |
327 | - return usb_control_msg(serial->dev, | |
328 | - usb_rcvctrlpipe(serial->dev, 0), | |
329 | - 0x22, 0x21, val, interface, | |
330 | - NULL, 0, USB_CTRL_SET_TIMEOUT); | |
328 | + do_send = 1; | |
331 | 329 | } |
332 | 330 | } |
333 | 331 | |
334 | 332 | |
... | ... | @@ -339,12 +337,18 @@ |
339 | 337 | interface = 1; |
340 | 338 | else if (port->bulk_out_endpointAddress == 5) |
341 | 339 | interface = 2; |
342 | - return usb_control_msg(serial->dev, | |
343 | - usb_rcvctrlpipe(serial->dev, 0), | |
344 | - 0x22, 0x21, val, interface, | |
345 | - NULL, 0, USB_CTRL_SET_TIMEOUT); | |
340 | + | |
341 | + do_send = 1; | |
346 | 342 | } |
347 | - return 0; | |
343 | + if (!do_send) | |
344 | + return 0; | |
345 | + | |
346 | + usb_autopm_get_interface(serial->interface); | |
347 | + retval = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | |
348 | + 0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT); | |
349 | + usb_autopm_put_interface(serial->interface); | |
350 | + | |
351 | + return retval; | |
348 | 352 | } |
349 | 353 | |
350 | 354 | static void sierra_set_termios(struct tty_struct *tty, |
351 | 355 | |
... | ... | @@ -773,8 +777,11 @@ |
773 | 777 | |
774 | 778 | if (serial->dev) { |
775 | 779 | mutex_lock(&serial->disc_mutex); |
776 | - if (!serial->disconnected) | |
780 | + if (!serial->disconnected) { | |
781 | + serial->interface->needs_remote_wakeup = 0; | |
782 | + usb_autopm_get_interface(serial->interface); | |
777 | 783 | sierra_send_setup(port); |
784 | + } | |
778 | 785 | mutex_unlock(&serial->disc_mutex); |
779 | 786 | spin_lock_irq(&intfdata->susp_lock); |
780 | 787 | portdata->opened = 0; |
... | ... | @@ -788,8 +795,6 @@ |
788 | 795 | sierra_release_urb(portdata->in_urbs[i]); |
789 | 796 | portdata->in_urbs[i] = NULL; |
790 | 797 | } |
791 | - usb_autopm_get_interface(serial->interface); | |
792 | - serial->interface->needs_remote_wakeup = 0; | |
793 | 798 | } |
794 | 799 | } |
795 | 800 | |
... | ... | @@ -827,6 +832,8 @@ |
827 | 832 | if (err) { |
828 | 833 | /* get rid of everything as in close */ |
829 | 834 | sierra_close(port); |
835 | + /* restore balance for autopm */ | |
836 | + usb_autopm_put_interface(serial->interface); | |
830 | 837 | return err; |
831 | 838 | } |
832 | 839 | sierra_send_setup(port); |
... | ... | @@ -915,7 +922,7 @@ |
915 | 922 | #ifdef CONFIG_PM |
916 | 923 | static void stop_read_write_urbs(struct usb_serial *serial) |
917 | 924 | { |
918 | - int i, j; | |
925 | + int i; | |
919 | 926 | struct usb_serial_port *port; |
920 | 927 | struct sierra_port_private *portdata; |
921 | 928 | |
... | ... | @@ -923,8 +930,7 @@ |
923 | 930 | for (i = 0; i < serial->num_ports; ++i) { |
924 | 931 | port = serial->port[i]; |
925 | 932 | portdata = usb_get_serial_port_data(port); |
926 | - for (j = 0; j < N_IN_URB; j++) | |
927 | - usb_kill_urb(portdata->in_urbs[j]); | |
933 | + sierra_stop_rx_urbs(port); | |
928 | 934 | usb_kill_anchored_urbs(&portdata->active); |
929 | 935 | } |
930 | 936 | } |