From cdc647a9b75741659bfc6acc44a6b3a646ad53bf Mon Sep 17 00:00:00 2001 From: David Brownell Date: Wed, 2 Apr 2008 13:40:20 -0700 Subject: USB: another ehci_iaa_watchdog fix This patch, suggested by Alan Stern, fixes the hung USB issues on my notebook from suspend/resume cycles. It does so by eliminating some confusion about the internal state machine associated with unlinking from the EHCI async schedule ring, which caused a recent regression: http://bugzilla.kernel.org/show_bug.cgi?id=10345 Signed-off-by: Mark Lord Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 40e8240..4e065e5 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -135,8 +135,6 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) hcd->state = HC_STATE_QUIESCING; } ehci->command = ehci_readl(ehci, &ehci->regs->command); - if (ehci->reclaim) - end_unlink_async(ehci); ehci_work(ehci); /* Unlike other USB host controller types, EHCI doesn't have @@ -180,6 +178,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) ehci_halt (ehci); hcd->state = HC_STATE_SUSPENDED; + if (ehci->reclaim) + end_unlink_async(ehci); + /* allow remote wakeup */ mask = INTR_MASK; if (!device_may_wakeup(&hcd->self.root_hub->dev)) -- cgit v0.10.2 From 1bfd6693cd66f1e79abce62d3e8c3647e1f59a55 Mon Sep 17 00:00:00 2001 From: Robert Spanton Date: Sun, 23 Mar 2008 19:47:23 +0000 Subject: USB: serial: ti_usb_3410_5052: Correct TUSB3410 endpoint requirements. The changes introduced in commit 063a2da8f01806906f7d7b1a1424b9afddebc443 changed the semantics of the num_interrupt_in, num_interrupt_out, num_bulk_in and num_bulk_out entries of the usb_serial_driver struct to be the number of endpoints the device has when probed. This patch changes the ti_1port_device usb_serial_driver struct to reflect this change. The single port devices only have 1 bulk_out endpoint in their initial configuration, and so this patch changes the number of other types to NUM_DONT_CARE. The same change probably needs doing to the ti_2port_device struct, but I don't have a two port device at hand. Signed-off-by: Robert Spanton Cc: stable Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index b517f93..e3d241f 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -265,8 +265,8 @@ static struct usb_serial_driver ti_1port_device = { .description = "TI USB 3410 1 port adapter", .usb_driver = &ti_usb_driver, .id_table = ti_id_table_3410, - .num_interrupt_in = 1, - .num_bulk_in = 1, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = 1, .num_ports = 1, .attach = ti_startup, -- cgit v0.10.2 From e8898681023c8bfb920afcd215e43c8832597b91 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Tue, 25 Mar 2008 17:32:16 +0100 Subject: USB: cp2101: Add identifiers for the Telegesys ETRX2USB This patch adds support for the Telegesys ETRX2USB which works fine with the cp2101 driver. Signed-off-by: Florian Fainelli Tested-by: Xavier Carcelle Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index f3ca660..324bb61 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c @@ -75,6 +75,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ { USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */ { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */ + { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ -- cgit v0.10.2 From d04863e9e65767feff7807c8f693ac2719dd1944 Mon Sep 17 00:00:00 2001 From: Brad Sawatzky Date: Tue, 25 Mar 2008 22:32:43 -0400 Subject: USB: serial: fix regression in Visor/Palm OS module for kernels >= 2.6.24 Fixes a bug/inconsistency revealed by the additional sanity checking in commit 063a2da8f01806906f7d7b1a1424b9afddebc443 introduced in the original 2.6.24 branch. The Handspring Visor / PalmOS 4 device structure defines .num_bulk_out=2 but the usb-serial probe returns num_bulk_out=3, triggering the check in the above commit and forcing a bail out when the device (a Garmin iQue in my case) attempts to connect. The patch bumps the expected number of endpoints to 3. FWIW, this patch will probably solve the following kernel bug report for Treo users (identical symptoms, different model PalmOS units): Signed-off-by: Brad Sawatzky Cc: stable Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 22b3f78..c2b01f7 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -191,7 +191,7 @@ static struct usb_serial_driver handspring_device = { .id_table = id_table, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = 2, - .num_bulk_out = 2, + .num_bulk_out = NUM_DONT_CARE, .num_ports = 2, .open = visor_open, .close = visor_close, -- cgit v0.10.2 From 4756febb10d96104e08661031ba835771075419c Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Thu, 27 Mar 2008 10:15:22 -0400 Subject: USB: fix bug in sg initialization in usbtest This patch (as1062) fixes a bug in the scatter-gather initialization code in the usbtest driver. When the sg-helper conversion was performed, it wasn't done correctly. Signed-off-by: Alan Stern CC: Jens Axboe Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index da922df..b6b5b2a 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -378,6 +378,7 @@ alloc_sglist (int nents, int max, int vary) sg = kmalloc (nents * sizeof *sg, GFP_KERNEL); if (!sg) return NULL; + sg_init_table(sg, nents); for (i = 0; i < nents; i++) { char *buf; @@ -390,7 +391,7 @@ alloc_sglist (int nents, int max, int vary) } /* kmalloc pages are always physically contiguous! */ - sg_init_one(&sg[i], buf, size); + sg_set_buf(&sg[i], buf, size); switch (pattern) { case 0: -- cgit v0.10.2 From 822470537d0fc1dee38a2a9c8b8c398bfbb332bb Mon Sep 17 00:00:00 2001 From: Clark Rawlins Date: Thu, 27 Mar 2008 09:56:17 -0400 Subject: USB: Allow initialization of broken keyspan serial adapters. Fixes the keyspan driver after the addition of additional checking of driver requirements introduced in usb-serial.c commit 063a2da8f01806906f7d7b1a1424b9afddebc443. The initialization of the keyspan usb_serial_driver structs were not initializing the num_interrupt_out field and the additional checking was rejecting the end point so the driver wouldn't finish initializing. This commit initializes the fields to NUM_DONT_CARE. It works for the keyspan USA-49WG and doesn't break the USA-19HS which are the two keyspan devices I have to test with. Signed-off-by: Clark Rawlins Cc: stable Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h index 8a0d174..74ce8bc 100644 --- a/drivers/usb/serial/keyspan.h +++ b/drivers/usb/serial/keyspan.h @@ -637,6 +637,7 @@ static struct usb_serial_driver keyspan_pre_device = { .description = "Keyspan - (without firmware)", .id_table = keyspan_pre_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 1, @@ -651,6 +652,7 @@ static struct usb_serial_driver keyspan_1port_device = { .description = "Keyspan 1 port adapter", .id_table = keyspan_1port_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 1, @@ -678,6 +680,7 @@ static struct usb_serial_driver keyspan_2port_device = { .description = "Keyspan 2 port adapter", .id_table = keyspan_2port_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 2, @@ -705,6 +708,7 @@ static struct usb_serial_driver keyspan_4port_device = { .description = "Keyspan 4 port adapter", .id_table = keyspan_4port_ids, .num_interrupt_in = NUM_DONT_CARE, + .num_interrupt_out = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 4, -- cgit v0.10.2 From 9cebcdc7fb10d478b22d7125b215cee3b9ea82f2 Mon Sep 17 00:00:00 2001 From: Richard Kennedy Date: Fri, 28 Mar 2008 14:50:30 -0700 Subject: USB: ohci: fix 2 timers to fire at jiffies + 1s Code inspection discovered in 2 places timers were being incorrectly setup using round_jiffies_relative(HZ). The timer would then fire at time (0 <= T < HZ). Fix them to use round_jiffies(jiffies + HZ); Signed-off-by: Richard Kennedy Cc: Alan Stern Cc: David Brownell Cc: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index dd4798e..33f1c1c 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -467,7 +467,7 @@ static void unlink_watchdog_func(unsigned long _ohci) out: kfree(seen); if (ohci->eds_scheduled) - mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ)); + mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ)); done: spin_unlock_irqrestore(&ohci->lock, flags); } diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index 5181732..9c9f3b5 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c @@ -169,7 +169,7 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) if (quirk_zfmicro(ohci) && (ed->type == PIPE_INTERRUPT) && !(ohci->eds_scheduled++)) - mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ)); + mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ)); wmb (); /* we care about rm_list when setting CLE/BLE in case the HC was at -- cgit v0.10.2