aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-06-30 16:45:50 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-30 16:45:50 -0700
commit4f380d9c1d1c3e77a996c2dfaa09daebdce6b257 (patch)
treeb6786a0f524c5532299abc8359d5b8b3e66ff445 /usb
parent916bf118409d009d6100202823fe1d1e4ed35150 (diff)
downloadpatches-4f380d9c1d1c3e77a996c2dfaa09daebdce6b257.tar.gz
more patches added
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-ehci-fix-bogus-alteration-of-a-local-variable.patch46
-rw-r--r--usb/usb-ipaq.c-bugfixes.patch62
-rw-r--r--usb/usb-ipaq.c-timing-parameters.patch82
-rw-r--r--usb/usb-ohci-hub-code-unaligned-access.patch2
-rw-r--r--usb/usb-remove-empty-destructor-from-drivers-usb-mon-mon_text.c.patch50
5 files changed, 241 insertions, 1 deletions
diff --git a/usb/usb-ehci-fix-bogus-alteration-of-a-local-variable.patch b/usb/usb-ehci-fix-bogus-alteration-of-a-local-variable.patch
new file mode 100644
index 0000000000000..8d6db804fccdd
--- /dev/null
+++ b/usb/usb-ehci-fix-bogus-alteration-of-a-local-variable.patch
@@ -0,0 +1,46 @@
+From akpm@osdl.org Fri Jun 30 16:39:44 2006
+Message-Id: <200606300934.k5U9YgNT001781@shell0.pdx.osdl.net>
+From: David Brownell <david-b@pacbell.net>
+Subject: USB: ehci: fix bogus alteration of a local variable
+To: greg@kroah.com
+Cc: akpm@osdl.org, david-b@pacbell.net, dbrownell@users.sourceforge.net,
+ saxofon@musiker.nu
+Date: Fri, 30 Jun 2006 02:34:42 -0700
+
+From: David Brownell <david-b@pacbell.net>
+
+In a rare and all-but-unused path, the EHCI driver could reuse a variable
+in a way that'd make trouble. Specifically, if the first root hub port
+gets an overcurrent event (rare) during a remote wakeup scenario (all but
+unused in today's Linux, except for folk working with suspend-to-RAM and
+similar sleep states), that would look like a fatal error which would shut
+down the controller. Fix by not reusing that variable.
+
+Spotted by Per Hallsmark <saxofon@musiker.nu>
+Fixes http://bugzilla.kernel.org/show_bug.cgi?id=6661
+
+Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/ehci-hcd.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/host/ehci-hcd.c
++++ gregkh-2.6/drivers/usb/host/ehci-hcd.c
+@@ -626,10 +626,11 @@ static irqreturn_t ehci_irq (struct usb_
+ writel (status | CMD_RUN, &ehci->regs->command);
+
+ while (i--) {
+- status = readl (&ehci->regs->port_status [i]);
+- if (status & PORT_OWNER)
++ int pstatus = readl (&ehci->regs->port_status [i]);
++
++ if (pstatus & PORT_OWNER)
+ continue;
+- if (!(status & PORT_RESUME)
++ if (!(pstatus & PORT_RESUME)
+ || ehci->reset_done [i] != 0)
+ continue;
+
diff --git a/usb/usb-ipaq.c-bugfixes.patch b/usb/usb-ipaq.c-bugfixes.patch
new file mode 100644
index 0000000000000..bd0a6edb20fca
--- /dev/null
+++ b/usb/usb-ipaq.c-bugfixes.patch
@@ -0,0 +1,62 @@
+From akpm@osdl.org Fri Jun 30 16:40:04 2006
+Message-Id: <200606300934.k5U9YiSw001784@shell0.pdx.osdl.net>
+From: Frank Gevaerts <frank.gevaerts@fks.be>
+Subject: USB: ipaq.c bugfixes
+To: greg@kroah.com
+Cc: akpm@osdl.org, frank.gevaerts@fks.be, lcapitulino@mandriva.com.br
+Date: Fri, 30 Jun 2006 02:34:44 -0700
+
+From: Frank Gevaerts <frank.gevaerts@fks.be>
+
+This patch fixes several problems in the ipaq.c driver with connecting
+and disconnecting pocketpc devices:
+
+* The read urb stayed active if the connect failed, causing nullpointer
+ dereferences later on.
+
+* If a write failed, the driver continued as if nothing happened. Now it
+ handles that case the same way as other usb serial devices (fix by
+ Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>)
+
+Signed-off-by: Frank Gevaerts <frank.gevaerts@fks.be>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+
+ drivers/usb/serial/ipaq.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/serial/ipaq.c
++++ gregkh-2.6/drivers/usb/serial/ipaq.c
+@@ -652,11 +652,6 @@ static int ipaq_open(struct usb_serial_p
+ usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
+ port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
+ ipaq_read_bulk_callback, port);
+- result = usb_submit_urb(port->read_urb, GFP_KERNEL);
+- if (result) {
+- err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
+- goto error;
+- }
+
+ /*
+ * Send out control message observed in win98 sniffs. Not sure what
+@@ -671,6 +666,11 @@ static int ipaq_open(struct usb_serial_p
+ usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
+ 0x1, 0, NULL, 0, 100);
+ if (result == 0) {
++ result = usb_submit_urb(port->read_urb, GFP_KERNEL);
++ if (result) {
++ err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
++ goto error;
++ }
+ return 0;
+ }
+ }
+@@ -855,6 +855,7 @@ static void ipaq_write_bulk_callback(str
+
+ if (urb->status) {
+ dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
++ return;
+ }
+
+ spin_lock_irqsave(&write_list_lock, flags);
diff --git a/usb/usb-ipaq.c-timing-parameters.patch b/usb/usb-ipaq.c-timing-parameters.patch
new file mode 100644
index 0000000000000..2105e906c4146
--- /dev/null
+++ b/usb/usb-ipaq.c-timing-parameters.patch
@@ -0,0 +1,82 @@
+From akpm@osdl.org Fri Jun 30 16:40:28 2006
+Message-Id: <200606300934.k5U9YjKY001787@shell0.pdx.osdl.net>
+From: Frank Gevaerts <frank.gevaerts@fks.be>
+Subject: USB: ipaq.c timing parameters
+To: greg@kroah.com
+Cc: akpm@osdl.org, frank.gevaerts@fks.be
+Date: Fri, 30 Jun 2006 02:34:45 -0700
+
+From: Frank Gevaerts <frank.gevaerts@fks.be>
+
+Adds configurable waiting periods to the ipaq connection code. These are
+not needed when the pocketpc device is running normally when plugged in,
+but they need extra delays if they are physically connected while
+rebooting.
+
+There are two parameters :
+
+* initial_wait : this is the delay before the driver attemts to start the
+ connection. This is needed because the pocktpc device takes much
+ longer to boot if the driver starts sending control packets too soon.
+
+* connect_retries : this is the number of times the control urb is
+ retried before finally giving up. The patch also adds a 1 second delay
+ between retries.
+
+I'm not sure if the cases where this patch is useful are general enough
+to include this in the kernel.
+
+Signed-off-by: Frank Gevaerts <frank.gevaerts@fks.be>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ipaq.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/usb/serial/ipaq.c
++++ gregkh-2.6/drivers/usb/serial/ipaq.c
+@@ -71,6 +71,8 @@
+
+ static __u16 product, vendor;
+ static int debug;
++static int connect_retries = KP_RETRIES;
++static int initial_wait;
+
+ /* Function prototypes for an ipaq */
+ static int ipaq_open (struct usb_serial_port *port, struct file *filp);
+@@ -583,7 +585,7 @@ static int ipaq_open(struct usb_serial_p
+ struct ipaq_private *priv;
+ struct ipaq_packet *pkt;
+ int i, result = 0;
+- int retries = KP_RETRIES;
++ int retries = connect_retries;
+
+ dbg("%s - port %d", __FUNCTION__, port->number);
+
+@@ -647,6 +649,7 @@ static int ipaq_open(struct usb_serial_p
+ port->read_urb->transfer_buffer_length = URBDATA_SIZE;
+ port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE;
+
++ msleep(1000*initial_wait);
+ /* Start reading from the device */
+ usb_fill_bulk_urb(port->read_urb, serial->dev,
+ usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
+@@ -673,6 +676,7 @@ static int ipaq_open(struct usb_serial_p
+ }
+ return 0;
+ }
++ msleep(1000);
+ }
+ err("%s - failed doing control urb, error %d", __FUNCTION__, result);
+ goto error;
+@@ -968,3 +972,9 @@ MODULE_PARM_DESC(vendor, "User specified
+
+ module_param(product, ushort, 0);
+ MODULE_PARM_DESC(product, "User specified USB idProduct");
++
++module_param(connect_retries, int, S_IRUGO|S_IWUSR);
++MODULE_PARM_DESC(connect_retries, "Maximum number of connect retries (one second each)");
++
++module_param(initial_wait, int, S_IRUGO|S_IWUSR);
++MODULE_PARM_DESC(initial_wait, "Time to wait before attempting a connection (in seconds)");
diff --git a/usb/usb-ohci-hub-code-unaligned-access.patch b/usb/usb-ohci-hub-code-unaligned-access.patch
index 2bc187a2f0ba8..7bd2767a8061f 100644
--- a/usb/usb-ohci-hub-code-unaligned-access.patch
+++ b/usb/usb-ohci-hub-code-unaligned-access.patch
@@ -10,7 +10,7 @@ I noticed this while debugging something unrelated on
sparc64.
Signed-off-by: David S. Miller <davem@davemloft.net>
-Cc: David Brownell <david-b@pacbell.net>
+Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
diff --git a/usb/usb-remove-empty-destructor-from-drivers-usb-mon-mon_text.c.patch b/usb/usb-remove-empty-destructor-from-drivers-usb-mon-mon_text.c.patch
new file mode 100644
index 0000000000000..83bd324ccae2e
--- /dev/null
+++ b/usb/usb-remove-empty-destructor-from-drivers-usb-mon-mon_text.c.patch
@@ -0,0 +1,50 @@
+From akpm@osdl.org Fri Jun 30 16:41:19 2006
+Message-Id: <200606300934.k5U9YlDV001793@shell0.pdx.osdl.net>
+From: Christoph Lameter <clameter@sgi.com>
+Subject: USB: remove empty destructor from drivers/usb/mon/mon_text.c
+To: greg@kroah.com
+Cc: akpm@osdl.org, clameter@sgi.com, penberg@cs.helsinki.fi
+From: akpm@osdl.org
+Date: Fri, 30 Jun 2006 02:34:47 -0700
+
+From: Christoph Lameter <clameter@sgi.com>
+
+Remove destructor and call kmem_cache_create with NULL for the destructor.
+
+Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
+Signed-off-by: Christoph Lameter <clameter@sgi.com>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Cc: Pete Zaitcev <zaitcev@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/mon/mon_text.c | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/mon/mon_text.c
++++ gregkh-2.6/drivers/usb/mon/mon_text.c
+@@ -64,7 +64,6 @@ struct mon_reader_text {
+ };
+
+ static void mon_text_ctor(void *, kmem_cache_t *, unsigned long);
+-static void mon_text_dtor(void *, kmem_cache_t *, unsigned long);
+
+ /*
+ * mon_text_submit
+@@ -268,7 +267,7 @@ static int mon_text_open(struct inode *i
+ (long)rp);
+ rp->e_slab = kmem_cache_create(rp->slab_name,
+ sizeof(struct mon_event_text), sizeof(long), 0,
+- mon_text_ctor, mon_text_dtor);
++ mon_text_ctor, NULL);
+ if (rp->e_slab == NULL) {
+ rc = -ENOMEM;
+ goto err_slab;
+@@ -459,7 +458,3 @@ static void mon_text_ctor(void *mem, kme
+ memset(mem, 0xe5, sizeof(struct mon_event_text));
+ }
+
+-static void mon_text_dtor(void *mem, kmem_cache_t *slab, unsigned long sflags)
+-{
+- ;
+-}