diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-31 15:16:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-31 15:16:09 -0400 |
commit | eb2890c92fe3232345de5c8ba56e4ed4ae6422e1 (patch) | |
tree | 945d51db59e98d1ac287bc031c304dcd9703ee68 /drivers | |
parent | fa488e22864370b610e61b540efe10ab4a41865b (diff) | |
parent | 37c4fd8c7551c7419a5faf87a76ff6949c5adaf3 (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: 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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/rndis_host.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 23 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 4 | ||||
-rw-r--r-- | drivers/usb/serial/sierra.c | 38 |
5 files changed, 43 insertions, 30 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 0caa8008c51c..f56dec6119c3 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -362,12 +362,12 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
362 | retval = -EINVAL; | 362 | retval = -EINVAL; |
363 | goto halt_fail_and_release; | 363 | goto halt_fail_and_release; |
364 | } | 364 | } |
365 | dev->hard_mtu = tmp; | ||
366 | net->mtu = dev->hard_mtu - net->hard_header_len; | ||
367 | dev_warn(&intf->dev, | 365 | dev_warn(&intf->dev, |
368 | "dev can't take %u byte packets (max %u), " | 366 | "dev can't take %u byte packets (max %u), " |
369 | "adjusting MTU to %u\n", | 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 | /* REVISIT: peripheral "alignment" request is ignored ... */ | 373 | /* REVISIT: peripheral "alignment" request is ignored ... */ |
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 42a74b8a0bb8..fa3d142ba64d 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c | |||
@@ -2139,7 +2139,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count, | |||
2139 | static void fsl_udc_release(struct device *dev) | 2139 | static void fsl_udc_release(struct device *dev) |
2140 | { | 2140 | { |
2141 | complete(udc_controller->done); | 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 | udc_controller->ep_qh, udc_controller->ep_qh_dma); | 2143 | udc_controller->ep_qh, udc_controller->ep_qh_dma); |
2144 | kfree(udc_controller); | 2144 | kfree(udc_controller); |
2145 | } | 2145 | } |
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 749b53742828..e33d36256350 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -1003,19 +1003,20 @@ static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port, | |||
1003 | if (syssts == SE0) { | 1003 | if (syssts == SE0) { |
1004 | r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); | 1004 | r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); |
1005 | r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port)); | 1005 | r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port)); |
1006 | return; | 1006 | } else { |
1007 | } | 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) | 1012 | r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port)); |
1010 | r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port)); | 1013 | r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port)); |
1011 | else if (syssts == LS_JSTS) | ||
1012 | r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port)); | ||
1013 | 1014 | ||
1014 | r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port)); | 1015 | if (r8a66597->bus_suspended) |
1015 | r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port)); | 1016 | usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); |
1017 | } | ||
1016 | 1018 | ||
1017 | if (r8a66597->bus_suspended) | 1019 | usb_hcd_poll_rh_status(r8a66597_to_hcd(r8a66597)); |
1018 | usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); | ||
1019 | } | 1020 | } |
1020 | 1021 | ||
1021 | /* this function must be called with interrupt disabled */ | 1022 | /* this function must be called with interrupt disabled */ |
@@ -1024,6 +1025,8 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port) | |||
1024 | u16 speed = get_rh_usb_speed(r8a66597, port); | 1025 | u16 speed = get_rh_usb_speed(r8a66597, port); |
1025 | struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; | 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 | if (speed == HSMODE) | 1030 | if (speed == HSMODE) |
1028 | rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED); | 1031 | rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED); |
1029 | else if (speed == LSMODE) | 1032 | else if (speed == LSMODE) |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 65d96b214f95..cd44c68954df 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -315,6 +315,9 @@ static int option_resume(struct usb_serial *serial); | |||
315 | #define QISDA_PRODUCT_H20_4515 0x4515 | 315 | #define QISDA_PRODUCT_H20_4515 0x4515 |
316 | #define QISDA_PRODUCT_H20_4519 0x4519 | 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 | /* TOSHIBA PRODUCTS */ | 322 | /* TOSHIBA PRODUCTS */ |
320 | #define TOSHIBA_VENDOR_ID 0x0930 | 323 | #define TOSHIBA_VENDOR_ID 0x0930 |
@@ -593,6 +596,7 @@ static struct usb_device_id option_ids[] = { | |||
593 | { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, | 596 | { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, |
594 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, | 597 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, |
595 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, | 598 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
599 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, | ||
596 | { } /* Terminating entry */ | 600 | { } /* Terminating entry */ |
597 | }; | 601 | }; |
598 | MODULE_DEVICE_TABLE(usb, option_ids); | 602 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 45883988a005..5019325ba25d 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -296,7 +296,6 @@ struct sierra_port_private { | |||
296 | int dsr_state; | 296 | int dsr_state; |
297 | int dcd_state; | 297 | int dcd_state; |
298 | int ri_state; | 298 | int ri_state; |
299 | |||
300 | unsigned int opened:1; | 299 | unsigned int opened:1; |
301 | }; | 300 | }; |
302 | 301 | ||
@@ -306,6 +305,8 @@ static int sierra_send_setup(struct usb_serial_port *port) | |||
306 | struct sierra_port_private *portdata; | 305 | struct sierra_port_private *portdata; |
307 | __u16 interface = 0; | 306 | __u16 interface = 0; |
308 | int val = 0; | 307 | int val = 0; |
308 | int do_send = 0; | ||
309 | int retval; | ||
309 | 310 | ||
310 | dev_dbg(&port->dev, "%s\n", __func__); | 311 | dev_dbg(&port->dev, "%s\n", __func__); |
311 | 312 | ||
@@ -324,10 +325,7 @@ static int sierra_send_setup(struct usb_serial_port *port) | |||
324 | */ | 325 | */ |
325 | if (port->interrupt_in_urb) { | 326 | if (port->interrupt_in_urb) { |
326 | /* send control message */ | 327 | /* send control message */ |
327 | return usb_control_msg(serial->dev, | 328 | do_send = 1; |
328 | usb_rcvctrlpipe(serial->dev, 0), | ||
329 | 0x22, 0x21, val, interface, | ||
330 | NULL, 0, USB_CTRL_SET_TIMEOUT); | ||
331 | } | 329 | } |
332 | } | 330 | } |
333 | 331 | ||
@@ -339,12 +337,18 @@ static int sierra_send_setup(struct usb_serial_port *port) | |||
339 | interface = 1; | 337 | interface = 1; |
340 | else if (port->bulk_out_endpointAddress == 5) | 338 | else if (port->bulk_out_endpointAddress == 5) |
341 | interface = 2; | 339 | interface = 2; |
342 | return usb_control_msg(serial->dev, | 340 | |
343 | usb_rcvctrlpipe(serial->dev, 0), | 341 | do_send = 1; |
344 | 0x22, 0x21, val, interface, | ||
345 | NULL, 0, USB_CTRL_SET_TIMEOUT); | ||
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 | static void sierra_set_termios(struct tty_struct *tty, | 354 | static void sierra_set_termios(struct tty_struct *tty, |
@@ -773,8 +777,11 @@ static void sierra_close(struct usb_serial_port *port) | |||
773 | 777 | ||
774 | if (serial->dev) { | 778 | if (serial->dev) { |
775 | mutex_lock(&serial->disc_mutex); | 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 | sierra_send_setup(port); | 783 | sierra_send_setup(port); |
784 | } | ||
778 | mutex_unlock(&serial->disc_mutex); | 785 | mutex_unlock(&serial->disc_mutex); |
779 | spin_lock_irq(&intfdata->susp_lock); | 786 | spin_lock_irq(&intfdata->susp_lock); |
780 | portdata->opened = 0; | 787 | portdata->opened = 0; |
@@ -788,8 +795,6 @@ static void sierra_close(struct usb_serial_port *port) | |||
788 | sierra_release_urb(portdata->in_urbs[i]); | 795 | sierra_release_urb(portdata->in_urbs[i]); |
789 | portdata->in_urbs[i] = NULL; | 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 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
827 | if (err) { | 832 | if (err) { |
828 | /* get rid of everything as in close */ | 833 | /* get rid of everything as in close */ |
829 | sierra_close(port); | 834 | sierra_close(port); |
835 | /* restore balance for autopm */ | ||
836 | usb_autopm_put_interface(serial->interface); | ||
830 | return err; | 837 | return err; |
831 | } | 838 | } |
832 | sierra_send_setup(port); | 839 | sierra_send_setup(port); |
@@ -915,7 +922,7 @@ static void sierra_release(struct usb_serial *serial) | |||
915 | #ifdef CONFIG_PM | 922 | #ifdef CONFIG_PM |
916 | static void stop_read_write_urbs(struct usb_serial *serial) | 923 | static void stop_read_write_urbs(struct usb_serial *serial) |
917 | { | 924 | { |
918 | int i, j; | 925 | int i; |
919 | struct usb_serial_port *port; | 926 | struct usb_serial_port *port; |
920 | struct sierra_port_private *portdata; | 927 | struct sierra_port_private *portdata; |
921 | 928 | ||
@@ -923,8 +930,7 @@ static void stop_read_write_urbs(struct usb_serial *serial) | |||
923 | for (i = 0; i < serial->num_ports; ++i) { | 930 | for (i = 0; i < serial->num_ports; ++i) { |
924 | port = serial->port[i]; | 931 | port = serial->port[i]; |
925 | portdata = usb_get_serial_port_data(port); | 932 | portdata = usb_get_serial_port_data(port); |
926 | for (j = 0; j < N_IN_URB; j++) | 933 | sierra_stop_rx_urbs(port); |
927 | usb_kill_urb(portdata->in_urbs[j]); | ||
928 | usb_kill_anchored_urbs(&portdata->active); | 934 | usb_kill_anchored_urbs(&portdata->active); |
929 | } | 935 | } |
930 | } | 936 | } |