Commit eb2890c9 authored by Linus Torvalds's avatar Linus Torvalds

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
parents fa488e22 37c4fd8c
...@@ -362,12 +362,12 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) ...@@ -362,12 +362,12 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
retval = -EINVAL; retval = -EINVAL;
goto halt_fail_and_release; goto halt_fail_and_release;
} }
dev->hard_mtu = tmp;
net->mtu = dev->hard_mtu - net->hard_header_len;
dev_warn(&intf->dev, dev_warn(&intf->dev,
"dev can't take %u byte packets (max %u), " "dev can't take %u byte packets (max %u), "
"adjusting MTU to %u\n", "adjusting MTU to %u\n",
dev->hard_mtu, tmp, net->mtu); dev->hard_mtu, tmp, tmp - net->hard_header_len);
dev->hard_mtu = tmp;
net->mtu = dev->hard_mtu - net->hard_header_len;
} }
/* REVISIT: peripheral "alignment" request is ignored ... */ /* REVISIT: peripheral "alignment" request is ignored ... */
......
...@@ -2139,7 +2139,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count, ...@@ -2139,7 +2139,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count,
static void fsl_udc_release(struct device *dev) static void fsl_udc_release(struct device *dev)
{ {
complete(udc_controller->done); complete(udc_controller->done);
dma_free_coherent(dev, udc_controller->ep_qh_size, dma_free_coherent(dev->parent, udc_controller->ep_qh_size,
udc_controller->ep_qh, udc_controller->ep_qh_dma); udc_controller->ep_qh, udc_controller->ep_qh_dma);
kfree(udc_controller); kfree(udc_controller);
} }
......
...@@ -1003,19 +1003,20 @@ static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port, ...@@ -1003,19 +1003,20 @@ static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port,
if (syssts == SE0) { if (syssts == SE0) {
r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port));
r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port)); r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port));
return; } else {
} if (syssts == FS_JSTS)
r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port));
else if (syssts == LS_JSTS)
r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port));
if (syssts == FS_JSTS) r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port));
r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port)); r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port));
else if (syssts == LS_JSTS)
r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port));
r8a66597_write(r8a66597, ~DTCH, get_intsts_reg(port)); if (r8a66597->bus_suspended)
r8a66597_bset(r8a66597, DTCHE, get_intenb_reg(port)); usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597));
}
if (r8a66597->bus_suspended) usb_hcd_poll_rh_status(r8a66597_to_hcd(r8a66597));
usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597));
} }
/* this function must be called with interrupt disabled */ /* this function must be called with interrupt disabled */
...@@ -1024,6 +1025,8 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port) ...@@ -1024,6 +1025,8 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port)
u16 speed = get_rh_usb_speed(r8a66597, port); u16 speed = get_rh_usb_speed(r8a66597, port);
struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; struct r8a66597_root_hub *rh = &r8a66597->root_hub[port];
rh->port &= ~((1 << USB_PORT_FEAT_HIGHSPEED) |
(1 << USB_PORT_FEAT_LOWSPEED));
if (speed == HSMODE) if (speed == HSMODE)
rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED); rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED);
else if (speed == LSMODE) else if (speed == LSMODE)
......
...@@ -315,6 +315,9 @@ static int option_resume(struct usb_serial *serial); ...@@ -315,6 +315,9 @@ static int option_resume(struct usb_serial *serial);
#define QISDA_PRODUCT_H20_4515 0x4515 #define QISDA_PRODUCT_H20_4515 0x4515
#define QISDA_PRODUCT_H20_4519 0x4519 #define QISDA_PRODUCT_H20_4519 0x4519
/* TLAYTECH PRODUCTS */
#define TLAYTECH_VENDOR_ID 0x20B9
#define TLAYTECH_PRODUCT_TEU800 0x1682
/* TOSHIBA PRODUCTS */ /* TOSHIBA PRODUCTS */
#define TOSHIBA_VENDOR_ID 0x0930 #define TOSHIBA_VENDOR_ID 0x0930
...@@ -593,6 +596,7 @@ static struct usb_device_id option_ids[] = { ...@@ -593,6 +596,7 @@ static struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) },
{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) },
{ USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
{ USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
MODULE_DEVICE_TABLE(usb, option_ids); MODULE_DEVICE_TABLE(usb, option_ids);
......
...@@ -296,7 +296,6 @@ struct sierra_port_private { ...@@ -296,7 +296,6 @@ struct sierra_port_private {
int dsr_state; int dsr_state;
int dcd_state; int dcd_state;
int ri_state; int ri_state;
unsigned int opened:1; unsigned int opened:1;
}; };
...@@ -306,6 +305,8 @@ static int sierra_send_setup(struct usb_serial_port *port) ...@@ -306,6 +305,8 @@ static int sierra_send_setup(struct usb_serial_port *port)
struct sierra_port_private *portdata; struct sierra_port_private *portdata;
__u16 interface = 0; __u16 interface = 0;
int val = 0; int val = 0;
int do_send = 0;
int retval;
dev_dbg(&port->dev, "%s\n", __func__); dev_dbg(&port->dev, "%s\n", __func__);
...@@ -324,10 +325,7 @@ static int sierra_send_setup(struct usb_serial_port *port) ...@@ -324,10 +325,7 @@ static int sierra_send_setup(struct usb_serial_port *port)
*/ */
if (port->interrupt_in_urb) { if (port->interrupt_in_urb) {
/* send control message */ /* send control message */
return usb_control_msg(serial->dev, do_send = 1;
usb_rcvctrlpipe(serial->dev, 0),
0x22, 0x21, val, interface,
NULL, 0, USB_CTRL_SET_TIMEOUT);
} }
} }
...@@ -339,12 +337,18 @@ static int sierra_send_setup(struct usb_serial_port *port) ...@@ -339,12 +337,18 @@ static int sierra_send_setup(struct usb_serial_port *port)
interface = 1; interface = 1;
else if (port->bulk_out_endpointAddress == 5) else if (port->bulk_out_endpointAddress == 5)
interface = 2; interface = 2;
return usb_control_msg(serial->dev,
usb_rcvctrlpipe(serial->dev, 0), do_send = 1;
0x22, 0x21, val, interface,
NULL, 0, USB_CTRL_SET_TIMEOUT);
} }
return 0; if (!do_send)
return 0;
usb_autopm_get_interface(serial->interface);
retval = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT);
usb_autopm_put_interface(serial->interface);
return retval;
} }
static void sierra_set_termios(struct tty_struct *tty, static void sierra_set_termios(struct tty_struct *tty,
...@@ -773,8 +777,11 @@ static void sierra_close(struct usb_serial_port *port) ...@@ -773,8 +777,11 @@ static void sierra_close(struct usb_serial_port *port)
if (serial->dev) { if (serial->dev) {
mutex_lock(&serial->disc_mutex); mutex_lock(&serial->disc_mutex);
if (!serial->disconnected) if (!serial->disconnected) {
serial->interface->needs_remote_wakeup = 0;
usb_autopm_get_interface(serial->interface);
sierra_send_setup(port); sierra_send_setup(port);
}
mutex_unlock(&serial->disc_mutex); mutex_unlock(&serial->disc_mutex);
spin_lock_irq(&intfdata->susp_lock); spin_lock_irq(&intfdata->susp_lock);
portdata->opened = 0; portdata->opened = 0;
...@@ -788,8 +795,6 @@ static void sierra_close(struct usb_serial_port *port) ...@@ -788,8 +795,6 @@ static void sierra_close(struct usb_serial_port *port)
sierra_release_urb(portdata->in_urbs[i]); sierra_release_urb(portdata->in_urbs[i]);
portdata->in_urbs[i] = NULL; portdata->in_urbs[i] = NULL;
} }
usb_autopm_get_interface(serial->interface);
serial->interface->needs_remote_wakeup = 0;
} }
} }
...@@ -827,6 +832,8 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -827,6 +832,8 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
if (err) { if (err) {
/* get rid of everything as in close */ /* get rid of everything as in close */
sierra_close(port); sierra_close(port);
/* restore balance for autopm */
usb_autopm_put_interface(serial->interface);
return err; return err;
} }
sierra_send_setup(port); sierra_send_setup(port);
...@@ -915,7 +922,7 @@ static void sierra_release(struct usb_serial *serial) ...@@ -915,7 +922,7 @@ static void sierra_release(struct usb_serial *serial)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static void stop_read_write_urbs(struct usb_serial *serial) static void stop_read_write_urbs(struct usb_serial *serial)
{ {
int i, j; int i;
struct usb_serial_port *port; struct usb_serial_port *port;
struct sierra_port_private *portdata; struct sierra_port_private *portdata;
...@@ -923,8 +930,7 @@ static void stop_read_write_urbs(struct usb_serial *serial) ...@@ -923,8 +930,7 @@ static void stop_read_write_urbs(struct usb_serial *serial)
for (i = 0; i < serial->num_ports; ++i) { for (i = 0; i < serial->num_ports; ++i) {
port = serial->port[i]; port = serial->port[i];
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
for (j = 0; j < N_IN_URB; j++) sierra_stop_rx_urbs(port);
usb_kill_urb(portdata->in_urbs[j]);
usb_kill_anchored_urbs(&portdata->active); usb_kill_anchored_urbs(&portdata->active);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment