diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-06-19 12:27:43 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-06-19 12:27:43 -0700 |
| commit | 504e935281de1cfb5146afdc099d426637cbe05a (patch) | |
| tree | 2c68dd63a578f38cd3fb4956f98f005556c6ac52 /usb | |
| parent | ba9912c485a1886beaddd08feaadcb029e61de79 (diff) | |
| download | patches-504e935281de1cfb5146afdc099d426637cbe05a.tar.gz | |
lots of usb patches added
Diffstat (limited to 'usb')
17 files changed, 1431 insertions, 6 deletions
diff --git a/usb/usb-accessrunner-avoid-unnecessary-memset.patch b/usb/usb-accessrunner-avoid-unnecessary-memset.patch new file mode 100644 index 00000000000000..780f40c303931b --- /dev/null +++ b/usb/usb-accessrunner-avoid-unnecessary-memset.patch @@ -0,0 +1,32 @@ +From akpm@linux-foundation.org Thu Jun 19 11:55:35 2008 +From: Christophe Jaillet <christophe.jaillet@wanadoo.fr> +Date: Mon, 09 Jun 2008 16:39:53 -0700 +Subject: USB: AccessRunner: avoid unnecessary memset +To: greg@kroah.com +Cc: linux-usb@vger.kernel.org, akpm@linux-foundation.org, christophe.jaillet@wanadoo.fr +Message-ID: <200806092339.m59Ndrj7015010@imap1.linux-foundation.org> + + +From: Christophe Jaillet <christophe.jaillet@wanadoo.fr> + +Remove an explicit memset(.., 0, ...) to a variable allocated with kzalloc +(i.e. 'card_info' array of the structure 'instance'). + +Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/atm/cxacru.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/usb/atm/cxacru.c ++++ b/drivers/usb/atm/cxacru.c +@@ -1052,7 +1052,6 @@ static int cxacru_bind(struct usbatm_dat + + instance->usbatm = usbatm_instance; + instance->modem_type = (struct cxacru_modem_type *) id->driver_info; +- memset(instance->card_info, 0, sizeof(instance->card_info)); + + mutex_init(&instance->poll_state_serialize); + instance->poll_state = CXPOLL_STOPPED; diff --git a/usb/usb-add-usb_dev_reset_delayed.patch b/usb/usb-add-usb_dev_reset_delayed.patch index 62eb11303c965d..e41bdcafe265f7 100644 --- a/usb/usb-add-usb_dev_reset_delayed.patch +++ b/usb/usb-add-usb_dev_reset_delayed.patch @@ -27,7 +27,7 @@ Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -3412,3 +3412,86 @@ int usb_reset_composite_device(struct us +@@ -3407,3 +3407,86 @@ int usb_reset_composite_device(struct us return ret; } EXPORT_SYMBOL_GPL(usb_reset_composite_device); @@ -132,10 +132,10 @@ Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> int string_langid; /* static strings from the device */ -@@ -499,6 +501,7 @@ extern int usb_lock_device_for_reset(str +@@ -498,6 +500,7 @@ extern int usb_lock_device_for_reset(str + /* USB port reset for device reinitialization */ extern int usb_reset_device(struct usb_device *dev); - extern int usb_reset_composite_device(struct usb_device *dev, - struct usb_interface *iface); + extern int usb_reset_composite_device(struct usb_device *dev); +extern void usb_dev_reset_delayed(struct usb_device *usb_dev); extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); diff --git a/usb/usb-cdc-wdm-cleanup.patch b/usb/usb-cdc-wdm-cleanup.patch new file mode 100644 index 00000000000000..ef89eaf00fa8a6 --- /dev/null +++ b/usb/usb-cdc-wdm-cleanup.patch @@ -0,0 +1,86 @@ +From oliver@neukum.org Thu Jun 19 11:52:33 2008 +From: Oliver Neukum <oliver@neukum.org> +Date: Thu, 19 Jun 2008 14:20:18 +0200 +Subject: USB: cdc-wdm cleanup +To: Greg KH <greg@kroah.com>, USB list <linux-usb@vger.kernel.org> +Message-ID: <200806191420.18718.oliver@neukum.org> +Content-Disposition: inline + + +- fixes an error with filling out control requests +- increases grepability and error logging +- fixes the short read code path + +Signed-off-by: Oliver Neukum <oneukum@suse.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-wdm.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -28,8 +28,9 @@ + /* + * Version Information + */ +-#define DRIVER_VERSION "v0.02" ++#define DRIVER_VERSION "v0.03" + #define DRIVER_AUTHOR "Oliver Neukum" ++#define DRIVER_DESC "USB Abstract Control Model driver for USB WCM Device Management" + + static struct usb_device_id wdm_ids[] = { + { +@@ -205,7 +206,7 @@ static void wdm_int_callback(struct urb + req->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE; + req->wValue = 0; + req->wIndex = desc->inum; +- req->wLength = cpu_to_le16(desc->bMaxPacketSize0); ++ req->wLength = cpu_to_le16(desc->wMaxCommand); + + usb_fill_control_urb( + desc->response, +@@ -214,7 +215,7 @@ static void wdm_int_callback(struct urb + usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0), + (unsigned char *)req, + desc->inbuf, +- desc->bMaxPacketSize0, ++ desc->wMaxCommand, + wdm_in_callback, + desc + ); +@@ -266,7 +267,7 @@ static void cleanup(struct wdm_device *d + desc->sbuf, + desc->validity->transfer_dma); + usb_buffer_free(interface_to_usbdev(desc->intf), +- desc->wMaxPacketSize, ++ desc->wMaxCommand, + desc->inbuf, + desc->response->transfer_dma); + kfree(desc->orq); +@@ -347,6 +348,7 @@ static ssize_t wdm_write + if (rv < 0) { + kfree(buf); + clear_bit(WDM_IN_USE, &desc->flags); ++ err("Tx URB error: %d", rv); + } else { + dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", + req->wIndex); +@@ -418,6 +420,9 @@ retry: + desc->ubuf[i] = desc->ubuf[i + cntr]; + + desc->length -= cntr; ++ /* in case we had outstanding data */ ++ if (!desc->length) ++ clear_bit(WDM_READ, &desc->flags); + rv = cntr; + + err: +@@ -735,6 +740,5 @@ module_init(wdm_init); + module_exit(wdm_exit); + + MODULE_AUTHOR(DRIVER_AUTHOR); +-MODULE_DESCRIPTION("USB Abstract Control Model driver for " +- "USB WCM Device Management"); ++MODULE_DESCRIPTION(DRIVER_DESC); + MODULE_LICENSE("GPL"); diff --git a/usb/usb-delete-airprime-driver.patch b/usb/usb-delete-airprime-driver.patch new file mode 100644 index 00000000000000..3f3b13b17a0a7b --- /dev/null +++ b/usb/usb-delete-airprime-driver.patch @@ -0,0 +1,419 @@ +From foo@baz Tue Apr 9 12:12:43 2002 +Date: Thu, 19 Jun 2008 11:21:16 -0700 +To: Greg KH <greg@kroah.com> +From: Greg Kroah-Hartman <gregkh@suse.de> +Subject: USB: delete airprime driver + +This driver is only for one device id, and the option driver should be +used instead for it. + +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/Kconfig | 8 + drivers/usb/serial/Makefile | 1 + drivers/usb/serial/airprime.c | 353 ------------------------------------------ + drivers/usb/serial/option.c | 2 + 4 files changed, 2 insertions(+), 362 deletions(-) + +--- a/drivers/usb/serial/airprime.c ++++ /dev/null +@@ -1,353 +0,0 @@ +-/* +- * AirPrime CDMA Wireless Serial USB driver +- * +- * Copyright (C) 2005-2006 Greg Kroah-Hartman <gregkh@suse.de> +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License version +- * 2 as published by the Free Software Foundation. +- */ +- +-#include <linux/kernel.h> +-#include <linux/init.h> +-#include <linux/tty.h> +-#include <linux/tty_flip.h> +-#include <linux/module.h> +-#include <linux/usb.h> +-#include <linux/usb/serial.h> +- +-static struct usb_device_id id_table [] = { +- { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ +- { }, +-}; +-MODULE_DEVICE_TABLE(usb, id_table); +- +-#define URB_TRANSFER_BUFFER_SIZE 4096 +-#define NUM_READ_URBS 4 +-#define NUM_WRITE_URBS 4 +-#define NUM_BULK_EPS 3 +-#define MAX_BULK_EPS 6 +- +-/* if overridden by the user, then use their value for the size of the +- * read and write urbs, and the number of endpoints */ +-static int buffer_size = URB_TRANSFER_BUFFER_SIZE; +-static int endpoints = NUM_BULK_EPS; +-static int debug; +-struct airprime_private { +- spinlock_t lock; +- int outstanding_urbs; +- int throttled; +- struct urb *read_urbp[NUM_READ_URBS]; +- +- /* Settings for the port */ +- int rts_state; /* Handshaking pins (outputs) */ +- int dtr_state; +- int cts_state; /* Handshaking pins (inputs) */ +- int dsr_state; +- int dcd_state; +- int ri_state; +-}; +- +-static int airprime_send_setup(struct usb_serial_port *port) +-{ +- struct usb_serial *serial = port->serial; +- struct airprime_private *priv; +- +- dbg("%s", __func__); +- +- if (port->number != 0) +- return 0; +- +- priv = usb_get_serial_port_data(port); +- +- if (port->tty) { +- int val = 0; +- if (priv->dtr_state) +- val |= 0x01; +- if (priv->rts_state) +- val |= 0x02; +- +- return usb_control_msg(serial->dev, +- usb_rcvctrlpipe(serial->dev, 0), +- 0x22, 0x21, val, 0, NULL, 0, +- USB_CTRL_SET_TIMEOUT); +- } +- +- return 0; +-} +- +-static void airprime_read_bulk_callback(struct urb *urb) +-{ +- struct usb_serial_port *port = urb->context; +- unsigned char *data = urb->transfer_buffer; +- struct tty_struct *tty; +- int result; +- int status = urb->status; +- +- dbg("%s - port %d", __func__, port->number); +- +- if (status) { +- dbg("%s - nonzero read bulk status received: %d", +- __func__, status); +- return; +- } +- usb_serial_debug_data(debug, &port->dev, __func__, +- urb->actual_length, data); +- +- tty = port->tty; +- if (tty && urb->actual_length) { +- tty_insert_flip_string(tty, data, urb->actual_length); +- tty_flip_buffer_push(tty); +- } +- +- result = usb_submit_urb(urb, GFP_ATOMIC); +- if (result) +- dev_err(&port->dev, +- "%s - failed resubmitting read urb, error %d\n", +- __func__, result); +- return; +-} +- +-static void airprime_write_bulk_callback(struct urb *urb) +-{ +- struct usb_serial_port *port = urb->context; +- struct airprime_private *priv = usb_get_serial_port_data(port); +- int status = urb->status; +- unsigned long flags; +- +- dbg("%s - port %d", __func__, port->number); +- +- /* free up the transfer buffer, as usb_free_urb() does not do this */ +- kfree(urb->transfer_buffer); +- +- if (status) +- dbg("%s - nonzero write bulk status received: %d", +- __func__, status); +- spin_lock_irqsave(&priv->lock, flags); +- --priv->outstanding_urbs; +- spin_unlock_irqrestore(&priv->lock, flags); +- +- usb_serial_port_softint(port); +-} +- +-static int airprime_open(struct usb_serial_port *port, struct file *filp) +-{ +- struct airprime_private *priv = usb_get_serial_port_data(port); +- struct usb_serial *serial = port->serial; +- struct urb *urb; +- char *buffer = NULL; +- int i; +- int result = 0; +- +- dbg("%s - port %d", __func__, port->number); +- +- /* initialize our private data structure if it isn't already created */ +- if (!priv) { +- priv = kzalloc(sizeof(*priv), GFP_KERNEL); +- if (!priv) { +- result = -ENOMEM; +- goto out; +- } +- spin_lock_init(&priv->lock); +- usb_set_serial_port_data(port, priv); +- } +- +- /* Set some sane defaults */ +- priv->rts_state = 1; +- priv->dtr_state = 1; +- +- for (i = 0; i < NUM_READ_URBS; ++i) { +- buffer = kmalloc(buffer_size, GFP_KERNEL); +- if (!buffer) { +- dev_err(&port->dev, "%s - out of memory.\n", +- __func__); +- result = -ENOMEM; +- goto errout; +- } +- urb = usb_alloc_urb(0, GFP_KERNEL); +- if (!urb) { +- kfree(buffer); +- dev_err(&port->dev, "%s - no more urbs?\n", +- __func__); +- result = -ENOMEM; +- goto errout; +- } +- usb_fill_bulk_urb(urb, serial->dev, +- usb_rcvbulkpipe(serial->dev, +- port->bulk_out_endpointAddress), +- buffer, buffer_size, +- airprime_read_bulk_callback, port); +- result = usb_submit_urb(urb, GFP_KERNEL); +- if (result) { +- usb_free_urb(urb); +- kfree(buffer); +- dev_err(&port->dev, +- "%s - failed submitting read urb %d for port %d, error %d\n", +- __func__, i, port->number, result); +- goto errout; +- } +- /* remember this urb so we can kill it when the +- port is closed */ +- priv->read_urbp[i] = urb; +- } +- +- airprime_send_setup(port); +- +- goto out; +- +- errout: +- /* some error happened, cancel any submitted urbs and clean up +- anything that got allocated successfully */ +- +- while (i-- != 0) { +- urb = priv->read_urbp[i]; +- buffer = urb->transfer_buffer; +- usb_kill_urb(urb); +- usb_free_urb(urb); +- kfree(buffer); +- } +- +- out: +- return result; +-} +- +-static void airprime_close(struct usb_serial_port *port, struct file *filp) +-{ +- struct airprime_private *priv = usb_get_serial_port_data(port); +- int i; +- +- dbg("%s - port %d", __func__, port->number); +- +- priv->rts_state = 0; +- priv->dtr_state = 0; +- +- mutex_lock(&port->serial->disc_mutex); +- if (!port->serial->disconnected) +- airprime_send_setup(port); +- mutex_unlock(&port->serial->disc_mutex); +- +- for (i = 0; i < NUM_READ_URBS; ++i) { +- usb_kill_urb(priv->read_urbp[i]); +- kfree(priv->read_urbp[i]->transfer_buffer); +- usb_free_urb(priv->read_urbp[i]); +- } +- +- /* free up private structure */ +- kfree(priv); +- usb_set_serial_port_data(port, NULL); +-} +- +-static int airprime_write(struct usb_serial_port *port, +- const unsigned char *buf, int count) +-{ +- struct airprime_private *priv = usb_get_serial_port_data(port); +- struct usb_serial *serial = port->serial; +- struct urb *urb; +- unsigned char *buffer; +- unsigned long flags; +- int status; +- dbg("%s - port %d", __func__, port->number); +- +- spin_lock_irqsave(&priv->lock, flags); +- if (priv->outstanding_urbs > NUM_WRITE_URBS) { +- spin_unlock_irqrestore(&priv->lock, flags); +- dbg("%s - write limit hit\n", __func__); +- return 0; +- } +- spin_unlock_irqrestore(&priv->lock, flags); +- buffer = kmalloc(count, GFP_ATOMIC); +- if (!buffer) { +- dev_err(&port->dev, "out of memory\n"); +- return -ENOMEM; +- } +- urb = usb_alloc_urb(0, GFP_ATOMIC); +- if (!urb) { +- dev_err(&port->dev, "no more free urbs\n"); +- kfree(buffer); +- return -ENOMEM; +- } +- memcpy(buffer, buf, count); +- +- usb_serial_debug_data(debug, &port->dev, __func__, count, buffer); +- +- usb_fill_bulk_urb(urb, serial->dev, +- usb_sndbulkpipe(serial->dev, +- port->bulk_out_endpointAddress), +- buffer, count, +- airprime_write_bulk_callback, port); +- +- /* send it down the pipe */ +- status = usb_submit_urb(urb, GFP_ATOMIC); +- if (status) { +- dev_err(&port->dev, +- "%s - usb_submit_urb(write bulk) failed with status = %d\n", +- __func__, status); +- count = status; +- kfree(buffer); +- } else { +- spin_lock_irqsave(&priv->lock, flags); +- ++priv->outstanding_urbs; +- spin_unlock_irqrestore(&priv->lock, flags); +- } +- /* we are done with this urb, so let the host driver +- * really free it when it is finished with it */ +- usb_free_urb(urb); +- return count; +-} +- +-static struct usb_driver airprime_driver = { +- .name = "airprime", +- .probe = usb_serial_probe, +- .disconnect = usb_serial_disconnect, +- .id_table = id_table, +- .no_dynamic_id = 1, +-}; +- +-static struct usb_serial_driver airprime_device = { +- .driver = { +- .owner = THIS_MODULE, +- .name = "airprime", +- }, +- .usb_driver = &airprime_driver, +- .id_table = id_table, +- .open = airprime_open, +- .close = airprime_close, +- .write = airprime_write, +-}; +- +-static int __init airprime_init(void) +-{ +- int retval; +- +- airprime_device.num_ports = endpoints; +- if (endpoints < 0 || endpoints >= MAX_BULK_EPS) +- airprime_device.num_ports = NUM_BULK_EPS; +- +- retval = usb_serial_register(&airprime_device); +- if (retval) +- return retval; +- retval = usb_register(&airprime_driver); +- if (retval) +- usb_serial_deregister(&airprime_device); +- return retval; +-} +- +-static void __exit airprime_exit(void) +-{ +- dbg("%s", __func__); +- +- usb_deregister(&airprime_driver); +- usb_serial_deregister(&airprime_device); +-} +- +-module_init(airprime_init); +-module_exit(airprime_exit); +-MODULE_LICENSE("GPL"); +- +-module_param(debug, bool, S_IRUGO | S_IWUSR); +-MODULE_PARM_DESC(debug, "Debug enabled"); +-module_param(buffer_size, int, 0); +-MODULE_PARM_DESC(buffer_size, +- "Size of the transfer buffers in bytes (default 4096)"); +-module_param(endpoints, int, 0); +-MODULE_PARM_DESC(endpoints, "Number of bulk EPs to configure (default 3)"); +--- a/drivers/usb/serial/Kconfig ++++ b/drivers/usb/serial/Kconfig +@@ -64,14 +64,6 @@ config USB_SERIAL_AIRCABLE + To compile this driver as a module, choose M here: the module + will be called aircable. + +-config USB_SERIAL_AIRPRIME +- tristate "USB AirPrime CDMA Wireless Driver" +- help +- Say Y here if you want to use a AirPrime CDMA Wireless PC card. +- +- To compile this driver as a module, choose M here: the +- module will be called airprime. +- + config USB_SERIAL_ARK3116 + tristate "USB ARK Micro 3116 USB Serial Driver" + help +--- a/drivers/usb/serial/Makefile ++++ b/drivers/usb/serial/Makefile +@@ -12,7 +12,6 @@ usbserial-obj-$(CONFIG_USB_EZUSB) += ez + usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) + + obj-$(CONFIG_USB_SERIAL_AIRCABLE) += aircable.o +-obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o + obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o + obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o + obj-$(CONFIG_USB_SERIAL_CH341) += ch341.o +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -173,6 +173,7 @@ static int option_send_setup(struct usb + #define DELL_VENDOR_ID 0x413C + + #define KYOCERA_VENDOR_ID 0x0c88 ++#define KYOCERA_PRODUCT_KPC650 0x17da + #define KYOCERA_PRODUCT_KPC680 0x180a + + #define ANYDATA_VENDOR_ID 0x16d5 +@@ -305,6 +306,7 @@ static struct usb_device_id option_ids[] + { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, + { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, + { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, ++ { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, + { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ + { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ diff --git a/usb/usb-drivers-usb-host-isp1760-hcd.c-processor-flags-have-type-unsigned-long.patch b/usb/usb-drivers-usb-host-isp1760-hcd.c-processor-flags-have-type-unsigned-long.patch new file mode 100644 index 00000000000000..1c017a1e53ad73 --- /dev/null +++ b/usb/usb-drivers-usb-host-isp1760-hcd.c-processor-flags-have-type-unsigned-long.patch @@ -0,0 +1,38 @@ +From akpm@linux-foundation.org Thu Jun 19 11:54:33 2008 +From: Andrew Morton <akpm@linux-foundation.org> +Date: Mon, 09 Jun 2008 16:39:52 -0700 +Subject: USB: drivers/usb/host/isp1760-hcd.c: processor flags have type `unsigned long' +To: greg@kroah.com +Cc: linux-usb@vger.kernel.org, akpm@linux-foundation.org +Message-ID: <200806092339.m59NdqqZ015004@imap1.linux-foundation.org> + + +From: Andrew Morton <akpm@linux-foundation.org> + +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/isp1760-hcd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/host/isp1760-hcd.c ++++ b/drivers/usb/host/isp1760-hcd.c +@@ -1592,7 +1592,7 @@ static int isp1760_urb_dequeue(struct us + struct inter_packet_info *ints; + u32 i; + u32 reg_base, or_reg, skip_reg; +- int flags; ++ unsigned long flags; + struct ptd ptd; + + switch (usb_pipetype(urb->pipe)) { +@@ -2061,7 +2061,7 @@ static void isp1760_endpoint_disable(str + struct isp1760_hcd *priv = hcd_to_priv(usb_hcd); + struct isp1760_qh *qh; + struct isp1760_qtd *qtd; +- u32 flags; ++ unsigned long flags; + + spin_lock_irqsave(&priv->lock, flags); + qh = ep->hcpriv; diff --git a/usb/usb-ehci-hcd-unlink-speedups.patch b/usb/usb-ehci-hcd-unlink-speedups.patch index e6370c06a4c62b..1677cfd91273e1 100644 --- a/usb/usb-ehci-hcd-unlink-speedups.patch +++ b/usb/usb-ehci-hcd-unlink-speedups.patch @@ -46,7 +46,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h -@@ -189,7 +189,10 @@ timer_action (struct ehci_hcd *ehci, enu +@@ -198,7 +198,10 @@ timer_action (struct ehci_hcd *ehci, enu break; // case TIMER_ASYNC_SHRINK: default: @@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1; break; } - t += jiffies; + mod_timer(&ehci->watchdog, t + jiffies); --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -84,7 +84,7 @@ static const char hcd_name [] = "ehci_hc diff --git a/usb/usb-fix-comment-of-usb_set_configuration.patch b/usb/usb-fix-comment-of-usb_set_configuration.patch new file mode 100644 index 00000000000000..0364aad38c5215 --- /dev/null +++ b/usb/usb-fix-comment-of-usb_set_configuration.patch @@ -0,0 +1,31 @@ +From tom.leiming@gmail.com Thu Jun 19 12:02:43 2008 +From: Ming Lei <tom.leiming@gmail.com> +Date: Tue, 17 Jun 2008 23:24:08 +0800 +Subject: USB: fix comment of usb_set_configuration +To: stern@rowland.harvard.edu, greg@kroah.com +Cc: linux-usb@vger.kernel.org, Ming Lei <tom.leiming@gmail.com> +Message-ID: <1213716248-4097-1-git-send-email-tom.leiming@gmail.com> + +From: Ming Lei <tom.leiming@gmail.com> + +It is the usb interface driver probe() methods that +can't call usb_set_configuration, not usb device driver. + +Signed-off-by: Ming Lei <tom.leiming@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/message.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/core/message.c ++++ b/drivers/usb/core/message.c +@@ -1476,7 +1476,7 @@ static struct usb_interface_assoc_descri + * + * This call is synchronous. The calling context must be able to sleep, + * must own the device lock, and must not hold the driver model's USB +- * bus mutex; usb device driver probe() methods cannot use this routine. ++ * bus mutex; usb interface driver probe() methods cannot use this routine. + * + * Returns zero on success, or else the status code returned by the + * underlying call that failed. On successful completion, each interface diff --git a/usb/usb-host-use-get-put_unaligned_-helpers-to-fix-more-potential-unaligned-issues.patch b/usb/usb-host-use-get-put_unaligned_-helpers-to-fix-more-potential-unaligned-issues.patch new file mode 100644 index 00000000000000..9261e9e21038dd --- /dev/null +++ b/usb/usb-host-use-get-put_unaligned_-helpers-to-fix-more-potential-unaligned-issues.patch @@ -0,0 +1,87 @@ +From akpm@linux-foundation.org Thu Jun 19 11:56:03 2008 +From: Bryan Wu <cooloney@kernel.org> +Date: Mon, 09 Jun 2008 16:39:54 -0700 +Subject: usb/host: use get/put_unaligned_* helpers to fix more potential unaligned issues. +To: greg@kroah.com +Cc: linux-usb@vger.kernel.org, akpm@linux-foundation.org, cooloney@kernel.org, david-b@pacbell.net, gregkh@suse.de, harvey.harrison@gmail.com, jie.zhang@analog.com, stern@rowland.harvard.edu +Message-ID: <200806092339.m59NdsED015013@imap1.linux-foundation.org> + + +From: Bryan Wu <cooloney@kernel.org> + +[akpm@linux-foundation.org: drivers/usb/host/isp116x-hcd.c needs unaligned.h] +[akpm@linux-foundation.org: drivers/usb/host/uhci-hcd.c needs unaligned.h] +Reviewed-by: Harvey Harrison <harvey.harrison@gmail.com> +Signed-off-by: Jie Zhang <jie.zhang@analog.com> +Signed-off-by: Bryan Wu <cooloney@kernel.org> +Cc: Alan Stern <stern@rowland.harvard.edu> +Cc: David Brownell <david-b@pacbell.net> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/isp116x-hcd.c | 5 +++-- + drivers/usb/host/uhci-hcd.c | 1 + + drivers/usb/host/uhci-hub.c | 6 +++--- + 3 files changed, 7 insertions(+), 5 deletions(-) + +--- a/drivers/usb/host/isp116x-hcd.c ++++ b/drivers/usb/host/isp116x-hcd.c +@@ -68,6 +68,7 @@ + + #include <asm/io.h> + #include <asm/irq.h> ++#include <asm/unaligned.h> + #include <asm/system.h> + #include <asm/byteorder.h> + +@@ -1024,7 +1025,7 @@ static int isp116x_hub_control(struct us + break; + case GetHubStatus: + DBG("GetHubStatus\n"); +- *(__le32 *) buf = 0; ++ put_unaligned_le32(0, buf); + break; + case GetPortStatus: + DBG("GetPortStatus\n"); +@@ -1033,7 +1034,7 @@ static int isp116x_hub_control(struct us + spin_lock_irqsave(&isp116x->lock, flags); + tmp = isp116x_read_reg32(isp116x, (--wIndex) ? HCRHPORT2 : HCRHPORT1); + spin_unlock_irqrestore(&isp116x->lock, flags); +- *(__le32 *) buf = cpu_to_le32(tmp); ++ put_unaligned_le32(tmp, buf); + DBG("GetPortStatus: port[%d] %08x\n", wIndex + 1, tmp); + break; + case ClearPortFeature: +--- a/drivers/usb/host/uhci-hcd.c ++++ b/drivers/usb/host/uhci-hcd.c +@@ -42,6 +42,7 @@ + #include <linux/dmi.h> + + #include <asm/uaccess.h> ++#include <asm/unaligned.h> + #include <asm/io.h> + #include <asm/irq.h> + #include <asm/system.h> +--- a/drivers/usb/host/uhci-hub.c ++++ b/drivers/usb/host/uhci-hub.c +@@ -253,7 +253,7 @@ static int uhci_hub_control(struct usb_h + switch (typeReq) { + + case GetHubStatus: +- *(__le32 *)buf = cpu_to_le32(0); ++ put_unaligned_le32(0, buf); + OK(4); /* hub power */ + case GetPortStatus: + if (port >= uhci->rh_numports) +@@ -306,8 +306,8 @@ static int uhci_hub_control(struct usb_h + dev_dbg(uhci_dev(uhci), "port %d portsc %04x,%02x\n", + wIndex, status, lstatus); + +- *(__le16 *)buf = cpu_to_le16(wPortStatus); +- *(__le16 *)(buf + 2) = cpu_to_le16(wPortChange); ++ put_unaligned_le16(wPortStatus, buf); ++ put_unaligned_le16(wPortChange, buf + 2); + OK(4); + case SetHubFeature: /* We don't implement these */ + case ClearHubFeature: diff --git a/usb/usb-isp1760-support-board-specific-hardware-configurations.patch b/usb/usb-isp1760-support-board-specific-hardware-configurations.patch new file mode 100644 index 00000000000000..b59684aeb39361 --- /dev/null +++ b/usb/usb-isp1760-support-board-specific-hardware-configurations.patch @@ -0,0 +1,295 @@ +From ncase@xes-inc.com Thu Jun 19 12:03:24 2008 +From: Nate Case <ncase@xes-inc.com> +Date: Tue, 17 Jun 2008 11:11:38 -0500 +Subject: USB: isp1760: Support board-specific hardware configurations +To: Sebastian Siewior <sebastian@breakpoint.cc> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, linux-usb@vger.kernel.org, linuxppc-dev@ozlabs.org, Olof Johansson <olof@lixom.net>, Nate Case <ncase@xes-inc.com> +Message-ID: <1213719098-28002-1-git-send-email-ncase@xes-inc.com> + + +This adds support for hardware configurations that don't match the +chip default register settings (e.g., 16-bit data bus, DACK and +DREQ pulled up instead of down, analog overcurrent mode). + +These settings are passed in via the OF device tree. The PCI +interface still assumes the same default values. + +Signed-off-by: Nate Case <ncase@xes-inc.com> +Acked-by: Olof Johansson <olof@lixom.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/isp1760-hcd.c | 67 ++++++++++++++++++++++++++++++++--------- + drivers/usb/host/isp1760-hcd.h | 20 +++++++++++- + drivers/usb/host/isp1760-if.c | 35 ++++++++++++++++++++- + 3 files changed, 104 insertions(+), 18 deletions(-) + +--- a/drivers/usb/host/isp1760-hcd.c ++++ b/drivers/usb/host/isp1760-hcd.c +@@ -38,6 +38,7 @@ struct isp1760_hcd { + unsigned i_thresh; + unsigned long reset_done; + unsigned long next_statechange; ++ unsigned int devflags; + }; + + static inline struct isp1760_hcd *hcd_to_priv(struct usb_hcd *hcd) +@@ -378,9 +379,31 @@ static int isp1760_hc_setup(struct usb_h + { + struct isp1760_hcd *priv = hcd_to_priv(hcd); + int result; +- u32 scratch; ++ u32 scratch, hwmode; ++ ++ /* Setup HW Mode Control: This assumes a level active-low interrupt */ ++ hwmode = HW_DATA_BUS_32BIT; ++ ++ if (priv->devflags & ISP1760_FLAG_BUS_WIDTH_16) ++ hwmode &= ~HW_DATA_BUS_32BIT; ++ if (priv->devflags & ISP1760_FLAG_ANALOG_OC) ++ hwmode |= HW_ANA_DIGI_OC; ++ if (priv->devflags & ISP1760_FLAG_DACK_POL_HIGH) ++ hwmode |= HW_DACK_POL_HIGH; ++ if (priv->devflags & ISP1760_FLAG_DREQ_POL_HIGH) ++ hwmode |= HW_DREQ_POL_HIGH; ++ ++ /* ++ * We have to set this first in case we're in 16-bit mode. ++ * Write it twice to ensure correct upper bits if switching ++ * to 16-bit mode. ++ */ ++ isp1760_writel(hwmode, hcd->regs + HC_HW_MODE_CTRL); ++ isp1760_writel(hwmode, hcd->regs + HC_HW_MODE_CTRL); + + isp1760_writel(0xdeadbabe, hcd->regs + HC_SCRATCH_REG); ++ /* Change bus pattern */ ++ scratch = isp1760_readl(hcd->regs + HC_CHIP_ID_REG); + scratch = isp1760_readl(hcd->regs + HC_SCRATCH_REG); + if (scratch != 0xdeadbabe) { + printk(KERN_ERR "ISP1760: Scratch test failed.\n"); +@@ -403,17 +426,29 @@ static int isp1760_hc_setup(struct usb_h + + /* Step 11 passed */ + +- isp1760_writel(INTERRUPT_ENABLE_MASK, hcd->regs + HC_INTERRUPT_REG); +- isp1760_writel(INTERRUPT_ENABLE_MASK, hcd->regs + HC_INTERRUPT_ENABLE); ++ isp1760_info(priv, "bus width: %d, oc: %s\n", ++ (priv->devflags & ISP1760_FLAG_BUS_WIDTH_16) ? ++ 16 : 32, (priv->devflags & ISP1760_FLAG_ANALOG_OC) ? ++ "analog" : "digital"); + + /* ATL reset */ +- scratch = isp1760_readl(hcd->regs + HC_HW_MODE_CTRL); +- isp1760_writel(scratch | ALL_ATX_RESET, hcd->regs + HC_HW_MODE_CTRL); ++ isp1760_writel(hwmode | ALL_ATX_RESET, hcd->regs + HC_HW_MODE_CTRL); + mdelay(10); +- isp1760_writel(scratch, hcd->regs + HC_HW_MODE_CTRL); ++ isp1760_writel(hwmode, hcd->regs + HC_HW_MODE_CTRL); + +- isp1760_writel(PORT1_POWER | PORT1_INIT2, hcd->regs + HC_PORT1_CTRL); +- mdelay(10); ++ isp1760_writel(INTERRUPT_ENABLE_MASK, hcd->regs + HC_INTERRUPT_REG); ++ isp1760_writel(INTERRUPT_ENABLE_MASK, hcd->regs + HC_INTERRUPT_ENABLE); ++ ++ /* ++ * PORT 1 Control register of the ISP1760 is the OTG control ++ * register on ISP1761. ++ */ ++ if (!(priv->devflags & ISP1760_FLAG_ISP1761) && ++ !(priv->devflags & ISP1760_FLAG_PORT1_DIS)) { ++ isp1760_writel(PORT1_POWER | PORT1_INIT2, ++ hcd->regs + HC_PORT1_CTRL); ++ mdelay(10); ++ } + + priv->hcs_params = isp1760_readl(hcd->regs + HC_HCSPARAMS); + +@@ -453,8 +488,7 @@ static int isp1760_run(struct usb_hcd *h + hcd->state = HC_STATE_RUNNING; + isp1760_enable_interrupts(hcd); + temp = isp1760_readl(hcd->regs + HC_HW_MODE_CTRL); +- temp |= FINAL_HW_CONFIG; +- isp1760_writel(temp, hcd->regs + HC_HW_MODE_CTRL); ++ isp1760_writel(temp | HW_GLOBAL_INTR_EN, hcd->regs + HC_HW_MODE_CTRL); + + command = isp1760_readl(hcd->regs + HC_USBCMD); + command &= ~(CMD_LRESET|CMD_RESET); +@@ -2112,6 +2146,7 @@ static int isp1760_get_frame(struct usb_ + static void isp1760_stop(struct usb_hcd *hcd) + { + struct isp1760_hcd *priv = hcd_to_priv(hcd); ++ u32 temp; + + isp1760_hub_control(hcd, ClearPortFeature, USB_PORT_FEAT_POWER, 1, + NULL, 0); +@@ -2120,7 +2155,8 @@ static void isp1760_stop(struct usb_hcd + spin_lock_irq(&priv->lock); + ehci_reset(priv); + /* Disable IRQ */ +- isp1760_writel(HW_DATA_BUS_32BIT, hcd->regs + HC_HW_MODE_CTRL); ++ temp = isp1760_readl(hcd->regs + HC_HW_MODE_CTRL); ++ isp1760_writel(temp &= ~HW_GLOBAL_INTR_EN, hcd->regs + HC_HW_MODE_CTRL); + spin_unlock_irq(&priv->lock); + + isp1760_writel(0, hcd->regs + HC_CONFIGFLAG); +@@ -2128,10 +2164,11 @@ static void isp1760_stop(struct usb_hcd + + static void isp1760_shutdown(struct usb_hcd *hcd) + { +- u32 command; ++ u32 command, temp; + + isp1760_stop(hcd); +- isp1760_writel(HW_DATA_BUS_32BIT, hcd->regs + HC_HW_MODE_CTRL); ++ temp = isp1760_readl(hcd->regs + HC_HW_MODE_CTRL); ++ isp1760_writel(temp &= ~HW_GLOBAL_INTR_EN, hcd->regs + HC_HW_MODE_CTRL); + + command = isp1760_readl(hcd->regs + HC_USBCMD); + command &= ~CMD_RUN; +@@ -2183,7 +2220,8 @@ void deinit_kmem_cache(void) + } + + struct usb_hcd *isp1760_register(u64 res_start, u64 res_len, int irq, +- u64 irqflags, struct device *dev, const char *busname) ++ u64 irqflags, struct device *dev, const char *busname, ++ unsigned int devflags) + { + struct usb_hcd *hcd; + struct isp1760_hcd *priv; +@@ -2200,6 +2238,7 @@ struct usb_hcd *isp1760_register(u64 res + return ERR_PTR(-ENOMEM); + + priv = hcd_to_priv(hcd); ++ priv->devflags = devflags; + init_memory(priv); + hcd->regs = ioremap(res_start, res_len); + if (!hcd->regs) { +--- a/drivers/usb/host/isp1760-hcd.h ++++ b/drivers/usb/host/isp1760-hcd.h +@@ -3,7 +3,8 @@ + + /* exports for if */ + struct usb_hcd *isp1760_register(u64 res_start, u64 res_len, int irq, +- u64 irqflags, struct device *dev, const char *busname); ++ u64 irqflags, struct device *dev, const char *busname, ++ unsigned int devflags); + int init_kmem_once(void); + void deinit_kmem_cache(void); + +@@ -31,6 +32,7 @@ void deinit_kmem_cache(void); + /* Configuration Register */ + #define HC_HW_MODE_CTRL 0x300 + #define ALL_ATX_RESET (1 << 31) ++#define HW_ANA_DIGI_OC (1 << 15) + #define HW_DATA_BUS_32BIT (1 << 8) + #define HW_DACK_POL_HIGH (1 << 6) + #define HW_DREQ_POL_HIGH (1 << 5) +@@ -56,13 +58,14 @@ void deinit_kmem_cache(void); + #define PORT1_POWER (3 << 3) + #define PORT1_INIT1 (1 << 7) + #define PORT1_INIT2 (1 << 23) ++#define HW_OTG_CTRL_SET 0x374 ++#define HW_OTG_CTRL_CLR 0x376 + + /* Interrupt Register */ + #define HC_INTERRUPT_REG 0x310 + + #define HC_INTERRUPT_ENABLE 0x314 + #define INTERRUPT_ENABLE_MASK (HC_INTL_INT | HC_ATL_INT | HC_EOT_INT) +-#define FINAL_HW_CONFIG (HW_GLOBAL_INTR_EN | HW_DATA_BUS_32BIT) + + #define HC_ISO_INT (1 << 9) + #define HC_ATL_INT (1 << 8) +@@ -122,6 +125,19 @@ typedef void (packet_enqueue)(struct usb + #define isp1760_err(priv, fmt, args...) \ + dev_err(priv_to_hcd(priv)->self.controller, fmt, ##args) + ++/* ++ * Device flags that can vary from board to board. All of these ++ * indicate the most "atypical" case, so that a devflags of 0 is ++ * a sane default configuration. ++ */ ++#define ISP1760_FLAG_PORT1_DIS 0x00000001 /* Port 1 disabled */ ++#define ISP1760_FLAG_BUS_WIDTH_16 0x00000002 /* 16-bit data bus width */ ++#define ISP1760_FLAG_OTG_EN 0x00000004 /* Port 1 supports OTG */ ++#define ISP1760_FLAG_ANALOG_OC 0x00000008 /* Analog overcurrent */ ++#define ISP1760_FLAG_DACK_POL_HIGH 0x00000010 /* DACK active high */ ++#define ISP1760_FLAG_DREQ_POL_HIGH 0x00000020 /* DREQ active high */ ++#define ISP1760_FLAG_ISP1761 0x00000040 /* Chip is ISP1761 */ ++ + /* chip memory management */ + struct memory_chunk { + unsigned int start; +--- a/drivers/usb/host/isp1760-if.c ++++ b/drivers/usb/host/isp1760-if.c +@@ -35,6 +35,8 @@ static int of_isp1760_probe(struct of_de + int virq; + u64 res_len; + int ret; ++ const unsigned int *prop; ++ unsigned int devflags = 0; + + ret = of_address_to_resource(dp, 0, &memory); + if (ret) +@@ -55,8 +57,32 @@ static int of_isp1760_probe(struct of_de + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, + oirq.size); + ++ if (of_device_is_compatible(dp, "nxp,usb-isp1761")) ++ devflags |= ISP1760_FLAG_ISP1761; ++ ++ if (of_get_property(dp, "port1-disable", NULL) != NULL) ++ devflags |= ISP1760_FLAG_PORT1_DIS; ++ ++ /* Some systems wire up only 16 of the 32 data lines */ ++ prop = of_get_property(dp, "bus-width", NULL); ++ if (prop && *prop == 16) ++ devflags |= ISP1760_FLAG_BUS_WIDTH_16; ++ ++ if (of_get_property(dp, "port1-otg", NULL) != NULL) ++ devflags |= ISP1760_FLAG_OTG_EN; ++ ++ if (of_get_property(dp, "analog-oc", NULL) != NULL) ++ devflags |= ISP1760_FLAG_ANALOG_OC; ++ ++ if (of_get_property(dp, "dack-polarity", NULL) != NULL) ++ devflags |= ISP1760_FLAG_DACK_POL_HIGH; ++ ++ if (of_get_property(dp, "dreq-polarity", NULL) != NULL) ++ devflags |= ISP1760_FLAG_DREQ_POL_HIGH; ++ + hcd = isp1760_register(memory.start, res_len, virq, +- IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev)); ++ IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev), ++ devflags); + if (IS_ERR(hcd)) { + ret = PTR_ERR(hcd); + goto release_reg; +@@ -87,6 +113,9 @@ static struct of_device_id of_isp1760_ma + { + .compatible = "nxp,usb-isp1760", + }, ++ { ++ .compatible = "nxp,usb-isp1761", ++ }, + { }, + }; + MODULE_DEVICE_TABLE(of, of_isp1760_match); +@@ -116,6 +145,7 @@ static int __devinit isp1761_pci_probe(s + int length; + int status = 1; + struct usb_hcd *hcd; ++ unsigned int devflags = 0; + + if (usb_disabled()) + return -ENODEV; +@@ -200,7 +230,8 @@ static int __devinit isp1761_pci_probe(s + + dev->dev.dma_mask = NULL; + hcd = isp1760_register(pci_mem_phy0, length, dev->irq, +- IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev)); ++ IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev), ++ devflags); + pci_set_drvdata(dev, hcd); + if (!hcd) + return 0; diff --git a/usb/usb-remove-interface-parameter-of-usb_reset_composite_device.patch b/usb/usb-remove-interface-parameter-of-usb_reset_composite_device.patch new file mode 100644 index 00000000000000..3def541705b75b --- /dev/null +++ b/usb/usb-remove-interface-parameter-of-usb_reset_composite_device.patch @@ -0,0 +1,123 @@ +From tom.leiming@gmail.com Thu Jun 19 11:59:46 2008 +From: Ming Lei <tom.leiming@gmail.com> +Date: Sun, 15 Jun 2008 09:42:02 +0800 +Subject: USB: remove interface parameter of usb_reset_composite_device +To: stern@rowland.harvard.edu, greg@kroah.com +Cc: linux-usb@vger.kernel.org, Ming Lei <tom.leiming@gmail.com> +Message-ID: <1213494122-3841-1-git-send-email-tom.leiming@gmail.com> + + +From: Ming Lei <tom.leiming@gmail.com> + +From the current implementation of usb_reset_composite_device +function, the iface parameter is no longer useful. This function +doesn't do something special for the iface usb_interface,compared +with other interfaces in the usb_device. So remove the parameter +and fix the related caller. + +Signed-off-by: Ming Lei <tom.leiming@gmail.com> +Acked-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/hid/usbhid/hid-core.c | 2 +- + drivers/usb/core/devio.c | 2 +- + drivers/usb/core/hub.c | 11 +++-------- + drivers/usb/storage/transport.c | 3 +-- + include/linux/usb.h | 3 +-- + 5 files changed, 7 insertions(+), 14 deletions(-) + +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -122,7 +122,7 @@ static void hid_reset(struct work_struct + dev_dbg(&usbhid->intf->dev, "resetting device\n"); + rc = rc_lock = usb_lock_device_for_reset(hid_to_usb_dev(hid), usbhid->intf); + if (rc_lock >= 0) { +- rc = usb_reset_composite_device(hid_to_usb_dev(hid), usbhid->intf); ++ rc = usb_reset_composite_device(hid_to_usb_dev(hid)); + if (rc_lock) + usb_unlock_device(hid_to_usb_dev(hid)); + } +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -870,7 +870,7 @@ static int proc_connectinfo(struct dev_s + + static int proc_resetdevice(struct dev_state *ps) + { +- return usb_reset_composite_device(ps->dev, NULL); ++ return usb_reset_composite_device(ps->dev); + } + + static int proc_setintf(struct dev_state *ps, void __user *arg) +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -2709,7 +2709,7 @@ static void hub_port_connect_change(stru + #endif + + } else { +- status = usb_reset_composite_device(udev, NULL); ++ status = usb_reset_composite_device(udev); + } + usb_unlock_device(udev); + +@@ -2937,7 +2937,7 @@ static void hub_events(void) + dev_dbg (hub_dev, "resetting for error %d\n", + hub->error); + +- ret = usb_reset_composite_device(hdev, intf); ++ ret = usb_reset_composite_device(hdev); + if (ret) { + dev_dbg (hub_dev, + "error resetting hub: %d\n", ret); +@@ -3345,7 +3345,6 @@ EXPORT_SYMBOL_GPL(usb_reset_device); + /** + * usb_reset_composite_device - warn interface drivers and perform a USB port reset + * @udev: device to reset (not in SUSPENDED or NOTATTACHED state) +- * @iface: interface bound to the driver making the request (optional) + * + * Warns all drivers bound to registered interfaces (using their pre_reset + * method), performs the port reset, and then lets the drivers know that +@@ -3358,8 +3357,7 @@ EXPORT_SYMBOL_GPL(usb_reset_device); + * For calls that might not occur during probe(), drivers should lock + * the device using usb_lock_device_for_reset(). + */ +-int usb_reset_composite_device(struct usb_device *udev, +- struct usb_interface *iface) ++int usb_reset_composite_device(struct usb_device *udev) + { + int ret; + int i; +@@ -3375,9 +3373,6 @@ int usb_reset_composite_device(struct us + /* Prevent autosuspend during the reset */ + usb_autoresume_device(udev); + +- if (iface && iface->condition != USB_INTERFACE_BINDING) +- iface = NULL; +- + if (config) { + for (i = 0; i < config->desc.bNumInterfaces; ++i) { + struct usb_interface *cintf = config->interface[i]; +--- a/drivers/usb/storage/transport.c ++++ b/drivers/usb/storage/transport.c +@@ -1172,8 +1172,7 @@ int usb_stor_port_reset(struct us_data * + result = -EIO; + US_DEBUGP("No reset during disconnect\n"); + } else { +- result = usb_reset_composite_device( +- us->pusb_dev, us->pusb_intf); ++ result = usb_reset_composite_device(us->pusb_dev); + US_DEBUGP("usb_reset_composite_device returns %d\n", + result); + } +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -497,8 +497,7 @@ extern int usb_lock_device_for_reset(str + + /* USB port reset for device reinitialization */ + extern int usb_reset_device(struct usb_device *dev); +-extern int usb_reset_composite_device(struct usb_device *dev, +- struct usb_interface *iface); ++extern int usb_reset_composite_device(struct usb_device *dev); + + extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); + diff --git a/usb/usb-usb-serial-fix-a-sparse-warning-about-different-signedness.patch b/usb/usb-usb-serial-fix-a-sparse-warning-about-different-signedness.patch new file mode 100644 index 00000000000000..cf1f777f806eaf --- /dev/null +++ b/usb/usb-usb-serial-fix-a-sparse-warning-about-different-signedness.patch @@ -0,0 +1,34 @@ +From andre@bitwigglers.org Thu Jun 19 12:06:43 2008 +From: Andre Haupt <andre@bitwigglers.org> +Date: Wed, 18 Jun 2008 15:56:00 +0200 +Subject: USB: usb-serial: fix a sparse warning about different signedness +To: linux-usb@vger.kernel.org +Cc: greg@kroah.com, Andre Haupt <andre@bitwigglers.org> +Message-ID: <502465cf27898887ddf30859df9420ab8e2c48b1.1213796327.git.andre@bitwigglers.org> + + +fix the following sparse warning: + +drivers/usb/serial/usb-serial.c:927:43: warning: incorrect type in argument 3 (different signedness) +drivers/usb/serial/usb-serial.c:927:43: expected unsigned int *minor +drivers/usb/serial/usb-serial.c:927:43: got int *<noident> + CHECK drivers/usb/serial/generic.c + +Signed-off-by: Andre Haupt <andre@bitwigglers.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/usb-serial.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/serial/usb-serial.c ++++ b/drivers/usb/serial/usb-serial.c +@@ -625,7 +625,7 @@ int usb_serial_probe(struct usb_interfac + struct usb_endpoint_descriptor *bulk_out_endpoint[MAX_NUM_PORTS]; + struct usb_serial_driver *type = NULL; + int retval; +- int minor; ++ unsigned int minor; + int buffer_size; + int i; + int num_interrupt_in = 0; diff --git a/usb/usb-use-standard-sg-iterator-in-the-scatter-gather-library.patch b/usb/usb-use-standard-sg-iterator-in-the-scatter-gather-library.patch new file mode 100644 index 00000000000000..4edc7991c1a49d --- /dev/null +++ b/usb/usb-use-standard-sg-iterator-in-the-scatter-gather-library.patch @@ -0,0 +1,55 @@ +From stern@rowland.harvard.edu Thu Jun 19 12:01:55 2008 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Mon, 16 Jun 2008 12:11:39 -0400 (EDT) +Subject: USB: use standard SG iterator in the scatter-gather library +To: Greg KH <greg@kroah.com> +Cc: Jens Axboe <jens.axboe@oracle.com>, USB list <linux-usb@vger.kernel.org> +Message-ID: <Pine.LNX.4.44L0.0806161209360.16649-100000@iolanthe.rowland.org> + + +This patch (as1103) changes the iteration in the USB scatter-gather to +use a standard SG iterator. Otherwise the iteration will fail if it +encounters a chained SG list. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Acked-by: Jens Axboe <jens.axboe@oracle.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/message.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/usb/core/message.c ++++ b/drivers/usb/core/message.c +@@ -400,7 +400,7 @@ int usb_sg_init(struct usb_sg_request *i + if (usb_pipein(pipe)) + urb_flags |= URB_SHORT_NOT_OK; + +- for (i = 0; i < io->entries; i++) { ++ for_each_sg(sg, sg, io->entries, i) { + unsigned len; + + io->urbs[i] = usb_alloc_urb(0, mem_flags); +@@ -434,17 +434,17 @@ int usb_sg_init(struct usb_sg_request *i + * to prevent stale pointers and to help spot bugs. + */ + if (dma) { +- io->urbs[i]->transfer_dma = sg_dma_address(sg + i); +- len = sg_dma_len(sg + i); ++ io->urbs[i]->transfer_dma = sg_dma_address(sg); ++ len = sg_dma_len(sg); + #if defined(CONFIG_HIGHMEM) || defined(CONFIG_GART_IOMMU) + io->urbs[i]->transfer_buffer = NULL; + #else +- io->urbs[i]->transfer_buffer = sg_virt(&sg[i]); ++ io->urbs[i]->transfer_buffer = sg_virt(sg); + #endif + } else { + /* hc may use _only_ transfer_buffer */ +- io->urbs[i]->transfer_buffer = sg_virt(&sg[i]); +- len = sg[i].length; ++ io->urbs[i]->transfer_buffer = sg_virt(sg); ++ len = sg->length; + } + + if (length) { diff --git a/usb/uwb-add-intel-i1480-hwa-to-the-uwb-rc-quirk-table.patch b/usb/uwb-add-intel-i1480-hwa-to-the-uwb-rc-quirk-table.patch new file mode 100644 index 00000000000000..eb54c39c447ec8 --- /dev/null +++ b/usb/uwb-add-intel-i1480-hwa-to-the-uwb-rc-quirk-table.patch @@ -0,0 +1,35 @@ +From david.vrabel@csr.com Thu Jun 19 11:53:41 2008 +From: David Vrabel <david.vrabel@csr.com> +Date: Mon, 09 Jun 2008 16:03:03 +0100 +Subject: UWB: add Intel i1480 HWA to the UWB RC quirk table +To: linux-usb@vger.kernel.org +Cc: Greg KH <greg@kroah.com> +Message-ID: <484D4627.4080804@csr.com> + + +From: Anderson Lizardo <anderson.lizardo@indt.org.br> + +The Intel i1480 HWA uses WHCI commands/events even though reporting itself as +WUSB compliant. This patch fixes this by marking it with the +WUSB_QUIRK_WHCI_CMD_EVT flag, which disables WUSB command/event filtering. + +Signed-off-by: Anderson Lizardo <anderson.lizardo@indt.org.br> +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/uwb/hwa-rc.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/uwb/hwa-rc.c ++++ b/drivers/uwb/hwa-rc.c +@@ -876,6 +876,9 @@ static struct usb_device_id hwarc_id_tab + /* D-Link DUB-1210 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3d02, 0xe0, 0x01, 0x02), + .driver_info = WUSB_QUIRK_WHCI_CMD_EVT }, ++ /* Intel i1480 (using firmware 1.3PA2-20070828) */ ++ { USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0c3b, 0xe0, 0x01, 0x02), ++ .driver_info = WUSB_QUIRK_WHCI_CMD_EVT }, + /* Generic match for the Radio Control interface */ + { USB_INTERFACE_INFO(0xe0, 0x01, 0x02), }, + { }, diff --git a/usb/uwb-fix-kconfig-causing-undefined-references.patch b/usb/uwb-fix-kconfig-causing-undefined-references.patch new file mode 100644 index 00000000000000..9da9e33384ae1b --- /dev/null +++ b/usb/uwb-fix-kconfig-causing-undefined-references.patch @@ -0,0 +1,34 @@ +From akpm@linux-foundation.org Thu Jun 19 11:54:05 2008 +From: Randy Dunlap <randy.dunlap@oracle.com> +Date: Mon, 09 Jun 2008 16:39:51 -0700 +Subject: uwb: fix Kconfig causing undefined references +To: greg@kroah.com +Cc: linux-usb@vger.kernel.org, akpm@linux-foundation.org, randy.dunlap@oracle.com +Message-ID: <200806092339.m59Ndquq015001@imap1.linux-foundation.org> + + +From: Randy Dunlap <randy.dunlap@oracle.com> + +Fix UWB kconfig so that function reference problems are not generated. + +next-20080430/drivers/uwb/whc-rc.c:478: undefined reference to `hwarc_filter_event' +next-20080430/drivers/uwb/whc-rc.c:478: undefined reference to `hwarc_filter_cmd' + +Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/uwb/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/uwb/Kconfig ++++ b/drivers/uwb/Kconfig +@@ -44,6 +44,7 @@ config UWB_HWA + config UWB_WHCI + tristate "UWB Radio Control driver for WHCI-compliant cards" + depends on PCI ++ depends on UWB_HWA + help + This driver enables the radio controller for WHCI cards. + diff --git a/usb/uwb-fix-oops-in-uwbd_dev_offair.patch b/usb/uwb-fix-oops-in-uwbd_dev_offair.patch new file mode 100644 index 00000000000000..e16a5f99049ed0 --- /dev/null +++ b/usb/uwb-fix-oops-in-uwbd_dev_offair.patch @@ -0,0 +1,43 @@ +From david.vrabel@csr.com Thu Jun 19 11:53:10 2008 +From: David Vrabel <david.vrabel@csr.com> +Date: Mon, 09 Jun 2008 16:01:45 +0100 +Subject: UWB: fix oops in uwbd_dev_offair() +To: linux-usb@vger.kernel.org +Cc: Greg KH <greg@kroah.com> +Message-ID: <484D45D9.9070307@csr.com> + + +From: David Vrabel <david.vrabel@csr.com> + +If a radio controller sees only 1 or two beacons from a device, then +there is a beacon cache entry without a uwb_dev that will (eventually) +be a candidate for purging. + +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/uwb/lc-dev.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/uwb/lc-dev.c ++++ b/drivers/uwb/lc-dev.c +@@ -437,14 +437,13 @@ int __uwb_dev_offair(struct uwb_dev *uwb + */ + void uwbd_dev_offair(struct uwb_beca_e *bce) + { +- struct uwb_rc *rc; + struct uwb_dev *uwb_dev; + + uwb_dev = bce->uwb_dev; +- rc = uwb_dev->rc; +- +- uwb_notify(rc, uwb_dev, UWB_NOTIF_OFFAIR); +- __uwb_dev_offair(uwb_dev, rc); ++ if (uwb_dev) { ++ uwb_notify(uwb_dev->rc, uwb_dev, UWB_NOTIF_OFFAIR); ++ __uwb_dev_offair(uwb_dev, uwb_dev->rc); ++ } + } + + diff --git a/usb/uwb-fix-oops-when-notifying-of-bg-joining-leaving.patch b/usb/uwb-fix-oops-when-notifying-of-bg-joining-leaving.patch new file mode 100644 index 00000000000000..1bac3c41f443f2 --- /dev/null +++ b/usb/uwb-fix-oops-when-notifying-of-bg-joining-leaving.patch @@ -0,0 +1,45 @@ +From david.vrabel@csr.com Thu Jun 19 11:53:24 2008 +From: David Vrabel <david.vrabel@csr.com> +Date: Mon, 09 Jun 2008 16:02:26 +0100 +Subject: UWB: fix oops when notifying of BG joining/leaving +To: linux-usb@vger.kernel.org +Cc: Greg KH <greg@kroah.com> +Message-ID: <484D4602.4090901@csr.com> + +From: David Vrabel <david.vrabel@csr.com> + +There's no need to claim an additional uwb_dev reference in uwb_notify. + +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/uwb/lc-dev.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/uwb/lc-dev.c ++++ b/drivers/uwb/lc-dev.c +@@ -81,8 +81,7 @@ EXPORT_SYMBOL_GPL(uwb_notifs_deregister) + /* + * Notify all event handlers of a given event on @rc + * +- * We are called with a valid reference to the device. Obtain another +- * reference before handing off to callback, release on return. ++ * We are called with a valid reference to the device. + */ + void uwb_notify(struct uwb_rc *rc, struct uwb_dev *uwb_dev, enum uwb_notifs event) + { +@@ -90,12 +89,9 @@ void uwb_notify(struct uwb_rc *rc, struc + if (mutex_lock_interruptible(&rc->notifs_chain.mutex)) + return; + if (!list_empty(&rc->notifs_chain.list)) { +- uwb_dev_get(uwb_dev); +- list_for_each_entry(handler, &rc->notifs_chain.list, +- list_node) { ++ list_for_each_entry(handler, &rc->notifs_chain.list, list_node) { + handler->cb(handler->data, uwb_dev, event); + } +- uwb_dev_put(uwb_dev); + } + mutex_unlock(&rc->notifs_chain.mutex); + } diff --git a/usb/uwb-make-uwb-selectable-on-all-archs-with-usb-support.patch b/usb/uwb-make-uwb-selectable-on-all-archs-with-usb-support.patch new file mode 100644 index 00000000000000..0e436c50442af6 --- /dev/null +++ b/usb/uwb-make-uwb-selectable-on-all-archs-with-usb-support.patch @@ -0,0 +1,68 @@ +From david.vrabel@csr.com Thu Jun 19 11:58:54 2008 +From: David Vrabel <david.vrabel@csr.com> +Date: Wed, 11 Jun 2008 12:04:41 +0100 +Subject: UWB: make UWB selectable on all archs with USB support +To: Byron Bradley <byron.bbradley@gmail.com> +Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Greg KH <greg@kroah.com> +Message-ID: <484FB149.4080000@csr.com> + + +ARM (and some other architectures) don't use drivers/Kconfig. This +patch enables UWB on all these architectures that have USB support. + +Reported-by: Byron Bradley <byron.bbradley@gmail.com> +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + arch/arm/Kconfig | 2 ++ + arch/cris/Kconfig | 2 ++ + arch/h8300/Kconfig | 2 ++ + arch/v850/Kconfig | 2 ++ + 4 files changed, 8 insertions(+) + +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -1169,6 +1169,8 @@ source "drivers/hid/Kconfig" + + source "drivers/usb/Kconfig" + ++source "drivers/uwb/Kconfig" ++ + source "drivers/mmc/Kconfig" + + source "drivers/leds/Kconfig" +--- a/arch/cris/Kconfig ++++ b/arch/cris/Kconfig +@@ -677,6 +677,8 @@ source "fs/Kconfig" + + source "drivers/usb/Kconfig" + ++source "drivers/uwb/Kconfig" ++ + source "arch/cris/Kconfig.debug" + + source "security/Kconfig" +--- a/arch/h8300/Kconfig ++++ b/arch/h8300/Kconfig +@@ -227,6 +227,8 @@ source "drivers/hwmon/Kconfig" + + source "drivers/usb/Kconfig" + ++source "drivers/uwb/Kconfig" ++ + endmenu + + source "fs/Kconfig" +--- a/arch/v850/Kconfig ++++ b/arch/v850/Kconfig +@@ -342,6 +342,8 @@ source "sound/Kconfig" + + source "drivers/usb/Kconfig" + ++source "drivers/uwb/Kconfig" ++ + source "arch/v850/Kconfig.debug" + + source "security/Kconfig" |
