From: Greg Kroah-Hartman Date: Tue, 10 Jan 2012 18:05:05 +0000 (-0800) Subject: 3.2-stable patches X-Git-Tag: v3.2.1~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c3c6325941b3bf847b0a5735a6ef8ebac4f257e;p=thirdparty%2Fkernel%2Fstable-queue.git 3.2-stable patches added patches: asix-fix-infinite-loop-in-rx_fixup.patch bonding-fix-error-handling-if-slave-is-busy-v2.patch igmp-avoid-zero-delay-when-receiving-odd-mixture-of-igmp-queries.patch usb-add-quirk-for-another-camera.patch usb-add-usb-id-for-multiplex-rc-serial-adapter-to-cp210x.c.patch usb-ch9-fix-up-maxstreams-helper.patch usb-fix-number-of-mapped-sg-dma-entries.patch usb-musb-fix-pm_runtime-mismatch.patch usb-omninet-fix-write_room.patch usb-option-add-zd-incorporated-hspa-modem.patch usb-pxa168-fix-compilation-error.patch usb-usb-storage-doesn-t-support-dynamic-id-currently-the-patch-disables-the-feature-to-fix-an-oops.patch xhci-properly-handle-comp_2nd_bw_err.patch --- diff --git a/queue-3.2/asix-fix-infinite-loop-in-rx_fixup.patch b/queue-3.2/asix-fix-infinite-loop-in-rx_fixup.patch new file mode 100644 index 00000000000..3ae6fb0c76c --- /dev/null +++ b/queue-3.2/asix-fix-infinite-loop-in-rx_fixup.patch @@ -0,0 +1,36 @@ +From 6c15d74defd38e7e7f8805392578b7a1d508097e Mon Sep 17 00:00:00 2001 +From: Aurelien Jacobs +Date: Sat, 7 Jan 2012 12:15:16 -0800 +Subject: asix: fix infinite loop in rx_fixup() + +From: Aurelien Jacobs + +commit 6c15d74defd38e7e7f8805392578b7a1d508097e upstream. + +At this point if skb->len happens to be 2, the subsequant skb_pull(skb, 4) +call won't work and the skb->len won't be decreased and won't ever reach 0, +resulting in an infinite loop. + +With an ASIX 88772 under heavy load, without this patch, rx_fixup() reaches +an infinite loop in less than a minute. With this patch applied, +no infinite loop even after hours of heavy load. + +Signed-off-by: Aurelien Jacobs +Cc: Jussi Kivilinna +Signed-off-by: David S. Miller + +--- + drivers/net/usb/asix.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/usb/asix.c ++++ b/drivers/net/usb/asix.c +@@ -376,7 +376,7 @@ static int asix_rx_fixup(struct usbnet * + + skb_pull(skb, (size + 1) & 0xfffe); + +- if (skb->len == 0) ++ if (skb->len < sizeof(header)) + break; + + head = (u8 *) skb->data; diff --git a/queue-3.2/bonding-fix-error-handling-if-slave-is-busy-v2.patch b/queue-3.2/bonding-fix-error-handling-if-slave-is-busy-v2.patch new file mode 100644 index 00000000000..373f6248069 --- /dev/null +++ b/queue-3.2/bonding-fix-error-handling-if-slave-is-busy-v2.patch @@ -0,0 +1,66 @@ +From f7d9821a6a9c83450ac35e76d3709e32fd38b76f Mon Sep 17 00:00:00 2001 +From: stephen hemminger +Date: Sat, 31 Dec 2011 13:26:46 +0000 +Subject: bonding: fix error handling if slave is busy (v2) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: stephen hemminger + +commit f7d9821a6a9c83450ac35e76d3709e32fd38b76f upstream. + +If slave device already has a receive handler registered, then the +error unwind of bonding device enslave function is broken. + +The following will leave a pointer to freed memory in the slave +device list, causing a later kernel panic. +# modprobe dummy +# ip li add dummy0-1 link dummy0 type macvlan +# modprobe bonding +# echo +dummy0 >/sys/class/net/bond0/bonding/slaves + +The fix is to detach the slave (which removes it from the list) +in the unwind path. + +Signed-off-by: Stephen Hemminger +Reviewed-by: Nicolas de Pesloüan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/bonding/bond_main.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -1822,7 +1822,7 @@ int bond_enslave(struct net_device *bond + "but new slave device does not support netpoll.\n", + bond_dev->name); + res = -EBUSY; +- goto err_close; ++ goto err_detach; + } + } + #endif +@@ -1831,7 +1831,7 @@ int bond_enslave(struct net_device *bond + + res = bond_create_slave_symlinks(bond_dev, slave_dev); + if (res) +- goto err_close; ++ goto err_detach; + + res = netdev_rx_handler_register(slave_dev, bond_handle_frame, + new_slave); +@@ -1852,6 +1852,11 @@ int bond_enslave(struct net_device *bond + err_dest_symlinks: + bond_destroy_slave_symlinks(bond_dev, slave_dev); + ++err_detach: ++ write_lock_bh(&bond->lock); ++ bond_detach_slave(bond, new_slave); ++ write_unlock_bh(&bond->lock); ++ + err_close: + dev_close(slave_dev); + diff --git a/queue-3.2/igmp-avoid-zero-delay-when-receiving-odd-mixture-of-igmp-queries.patch b/queue-3.2/igmp-avoid-zero-delay-when-receiving-odd-mixture-of-igmp-queries.patch new file mode 100644 index 00000000000..9498e259a5f --- /dev/null +++ b/queue-3.2/igmp-avoid-zero-delay-when-receiving-odd-mixture-of-igmp-queries.patch @@ -0,0 +1,34 @@ +From a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27 Mon Sep 17 00:00:00 2001 +From: Ben Hutchings +Date: Mon, 9 Jan 2012 14:06:46 -0800 +Subject: igmp: Avoid zero delay when receiving odd mixture of IGMP queries + +From: Ben Hutchings + +commit a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27 upstream. + +Commit 5b7c84066733c5dfb0e4016d939757b38de189e4 ('ipv4: correct IGMP +behavior on v3 query during v2-compatibility mode') added yet another +case for query parsing, which can result in max_delay = 0. Substitute +a value of 1, as in the usual v3 case. + +Reported-by: Simon McVittie +References: http://bugs.debian.org/654876 +Signed-off-by: Ben Hutchings +Signed-off-by: David S. Miller + +--- + net/ipv4/igmp.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/net/ipv4/igmp.c ++++ b/net/ipv4/igmp.c +@@ -875,6 +875,8 @@ static void igmp_heard_query(struct in_d + * to be intended in a v3 query. + */ + max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); ++ if (!max_delay) ++ max_delay = 1; /* can't mod w/ 0 */ + } else { /* v3 */ + if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) + return; diff --git a/queue-3.2/series b/queue-3.2/series index 6b29595230e..358401b996d 100644 --- a/queue-3.2/series +++ b/queue-3.2/series @@ -32,3 +32,16 @@ cgroup-fix-to-allow-mounting-a-hierarchy-by-name.patch udf-fix-deadlock-when-converting-file-from-in-icb-one-to-normal-one.patch drivers-usb-class-cdc-acm.c-clear-dangling-pointer.patch usb-isight-fix-kernel-bug-when-loading-firmware.patch +usb-usb-storage-doesn-t-support-dynamic-id-currently-the-patch-disables-the-feature-to-fix-an-oops.patch +usb-pxa168-fix-compilation-error.patch +usb-add-quirk-for-another-camera.patch +usb-musb-fix-pm_runtime-mismatch.patch +usb-omninet-fix-write_room.patch +usb-option-add-zd-incorporated-hspa-modem.patch +usb-add-usb-id-for-multiplex-rc-serial-adapter-to-cp210x.c.patch +usb-fix-number-of-mapped-sg-dma-entries.patch +xhci-properly-handle-comp_2nd_bw_err.patch +usb-ch9-fix-up-maxstreams-helper.patch +igmp-avoid-zero-delay-when-receiving-odd-mixture-of-igmp-queries.patch +asix-fix-infinite-loop-in-rx_fixup.patch +bonding-fix-error-handling-if-slave-is-busy-v2.patch diff --git a/queue-3.2/usb-add-quirk-for-another-camera.patch b/queue-3.2/usb-add-quirk-for-another-camera.patch new file mode 100644 index 00000000000..1e9667a769c --- /dev/null +++ b/queue-3.2/usb-add-quirk-for-another-camera.patch @@ -0,0 +1,35 @@ +From 35284b3d2f68a8a3703745e629999469f78386b5 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Tue, 3 Jan 2012 09:58:54 +0100 +Subject: USB: add quirk for another camera + +From: Oliver Neukum + +commit 35284b3d2f68a8a3703745e629999469f78386b5 upstream. + +The Guillemot Webcam Hercules Dualpix Exchange camera +has been reported with a second ID. + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/quirks.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -117,9 +117,12 @@ static const struct usb_device_id usb_qu + { USB_DEVICE(0x06a3, 0x0006), .driver_info = + USB_QUIRK_CONFIG_INTF_STRINGS }, + +- /* Guillemot Webcam Hercules Dualpix Exchange*/ ++ /* Guillemot Webcam Hercules Dualpix Exchange (2nd ID) */ + { USB_DEVICE(0x06f8, 0x0804), .driver_info = USB_QUIRK_RESET_RESUME }, + ++ /* Guillemot Webcam Hercules Dualpix Exchange*/ ++ { USB_DEVICE(0x06f8, 0x3005), .driver_info = USB_QUIRK_RESET_RESUME }, ++ + /* M-Systems Flash Disk Pioneers */ + { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, + diff --git a/queue-3.2/usb-add-usb-id-for-multiplex-rc-serial-adapter-to-cp210x.c.patch b/queue-3.2/usb-add-usb-id-for-multiplex-rc-serial-adapter-to-cp210x.c.patch new file mode 100644 index 00000000000..0fad68e936f --- /dev/null +++ b/queue-3.2/usb-add-usb-id-for-multiplex-rc-serial-adapter-to-cp210x.c.patch @@ -0,0 +1,33 @@ +From 08e87d0d773dc9ca5faf4c3306e238ed0ea129b0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Malte=20Schr=C3=B6der?= +Date: Thu, 5 Jan 2012 20:34:40 +0100 +Subject: USB: Add USB-ID for Multiplex RC serial adapter to cp210x.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Malte Schröder + +commit 08e87d0d773dc9ca5faf4c3306e238ed0ea129b0 upstream. + +Hi, below patch adds the USB-ID of the serial adapters sold by +Multiplex RC (www.multiplex-rc.de). + +Signed-off-by: Malte Schröder +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/cp210x.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -92,6 +92,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ + { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ + { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ ++ { USB_DEVICE(0x10C4, 0x81A9) }, /* Multiplex RC Interface */ + { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */ + { USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */ + { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ diff --git a/queue-3.2/usb-ch9-fix-up-maxstreams-helper.patch b/queue-3.2/usb-ch9-fix-up-maxstreams-helper.patch new file mode 100644 index 00000000000..fc10e4b886b --- /dev/null +++ b/queue-3.2/usb-ch9-fix-up-maxstreams-helper.patch @@ -0,0 +1,77 @@ +From 18b7ede5f7ee2092aedcb578d3ac30bd5d4fc23c Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Mon, 2 Jan 2012 13:35:41 +0200 +Subject: usb: ch9: fix up MaxStreams helper + +From: Felipe Balbi + +commit 18b7ede5f7ee2092aedcb578d3ac30bd5d4fc23c upstream. + +[ removed the dwc3 portion of the patch as it didn't apply to +older kernels - gregkh] + +According to USB 3.0 Specification Table 9-22, if +bmAttributes [4:0] are set to zero, it means "no +streams supported", but the way this helper was +defined on Linux, we will *always* have one stream +which might cause several problems. + +For example on DWC3, we would tell the controller +endpoint has streams enabled and yet start transfers +with Stream ID set to 0, which would goof up the host +side. + +While doing that, convert the macro to an inline +function due to the different checks we now need. + +Signed-off-by: Felipe Balbi +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci.c | 3 +-- + include/linux/usb/ch9.h | 20 +++++++++++++++++++- + 2 files changed, 20 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -2797,8 +2797,7 @@ static int xhci_calculate_streams_and_bi + if (ret < 0) + return ret; + +- max_streams = USB_SS_MAX_STREAMS( +- eps[i]->ss_ep_comp.bmAttributes); ++ max_streams = usb_ss_max_streams(&eps[i]->ss_ep_comp); + if (max_streams < (*num_streams - 1)) { + xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n", + eps[i]->desc.bEndpointAddress, +--- a/include/linux/usb/ch9.h ++++ b/include/linux/usb/ch9.h +@@ -605,8 +605,26 @@ struct usb_ss_ep_comp_descriptor { + } __attribute__ ((packed)); + + #define USB_DT_SS_EP_COMP_SIZE 6 ++ + /* Bits 4:0 of bmAttributes if this is a bulk endpoint */ +-#define USB_SS_MAX_STREAMS(p) (1 << ((p) & 0x1f)) ++static inline int ++usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp) ++{ ++ int max_streams; ++ ++ if (!comp) ++ return 0; ++ ++ max_streams = comp->bmAttributes & 0x1f; ++ ++ if (!max_streams) ++ return 0; ++ ++ max_streams = 1 << max_streams; ++ ++ return max_streams; ++} ++ + /* Bits 1:0 of bmAttributes if this is an isoc endpoint */ + #define USB_SS_MULT(p) (1 + ((p) & 0x3)) + diff --git a/queue-3.2/usb-fix-number-of-mapped-sg-dma-entries.patch b/queue-3.2/usb-fix-number-of-mapped-sg-dma-entries.patch new file mode 100644 index 00000000000..27c089513db --- /dev/null +++ b/queue-3.2/usb-fix-number-of-mapped-sg-dma-entries.patch @@ -0,0 +1,143 @@ +From bc677d5b64644c399cd3db6a905453e611f402ab Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Sat, 3 Dec 2011 23:41:31 +0100 +Subject: usb: fix number of mapped SG DMA entries + +From: Clemens Ladisch + +commit bc677d5b64644c399cd3db6a905453e611f402ab upstream. + +Add a new field num_mapped_sgs to struct urb so that we have a place to +store the number of mapped entries and can also retain the original +value of entries in num_sgs. Previously, usb_hcd_map_urb_for_dma() +would overwrite this with the number of mapped entries, which would +break dma_unmap_sg() because it requires the original number of entries. + +This fixes warnings like the following when using USB storage devices: + ------------[ cut here ]------------ + WARNING: at lib/dma-debug.c:902 check_unmap+0x4e4/0x695() + ehci_hcd 0000:00:12.2: DMA-API: device driver frees DMA sg list with different entry count [map count=4] [unmap count=1] + Modules linked in: ohci_hcd ehci_hcd + Pid: 0, comm: kworker/0:1 Not tainted 3.2.0-rc2+ #319 + Call Trace: + [] warn_slowpath_common+0x80/0x98 + [] warn_slowpath_fmt+0x41/0x43 + [] check_unmap+0x4e4/0x695 + [] ? trace_hardirqs_off+0xd/0xf + [] ? _raw_spin_unlock_irqrestore+0x33/0x50 + [] debug_dma_unmap_sg+0xeb/0x117 + [] usb_hcd_unmap_urb_for_dma+0x71/0x188 + [] unmap_urb_for_dma+0x20/0x22 + [] usb_hcd_giveback_urb+0x5d/0xc0 + [] ehci_urb_done+0xf7/0x10c [ehci_hcd] + [] qh_completions+0x429/0x4bd [ehci_hcd] + [] ehci_work+0x95/0x9c0 [ehci_hcd] + ... + ---[ end trace f29ac88a5a48c580 ]--- + Mapped at: + [] debug_dma_map_sg+0x45/0x139 + [] usb_hcd_map_urb_for_dma+0x22e/0x478 + [] usb_hcd_submit_urb+0x63f/0x6fa + [] usb_submit_urb+0x2c7/0x2de + [] usb_sg_wait+0x55/0x161 + +Signed-off-by: Clemens Ladisch +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hcd.c | 5 ++--- + drivers/usb/host/ehci-q.c | 2 +- + drivers/usb/host/uhci-q.c | 2 +- + drivers/usb/host/whci/qset.c | 4 ++-- + drivers/usb/host/xhci-ring.c | 4 ++-- + include/linux/usb.h | 1 + + 6 files changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/usb/core/hcd.c ++++ b/drivers/usb/core/hcd.c +@@ -1412,11 +1412,10 @@ int usb_hcd_map_urb_for_dma(struct usb_h + ret = -EAGAIN; + else + urb->transfer_flags |= URB_DMA_MAP_SG; +- if (n != urb->num_sgs) { +- urb->num_sgs = n; ++ urb->num_mapped_sgs = n; ++ if (n != urb->num_sgs) + urb->transfer_flags |= + URB_DMA_SG_COMBINED; +- } + } else if (urb->sg) { + struct scatterlist *sg = urb->sg; + urb->transfer_dma = dma_map_page( +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -647,7 +647,7 @@ qh_urb_transaction ( + /* + * data transfer stage: buffer setup + */ +- i = urb->num_sgs; ++ i = urb->num_mapped_sgs; + if (len > 0 && i > 0) { + sg = urb->sg; + buf = sg_dma_address(sg); +--- a/drivers/usb/host/uhci-q.c ++++ b/drivers/usb/host/uhci-q.c +@@ -943,7 +943,7 @@ static int uhci_submit_common(struct uhc + if (usb_pipein(urb->pipe)) + status |= TD_CTRL_SPD; + +- i = urb->num_sgs; ++ i = urb->num_mapped_sgs; + if (len > 0 && i > 0) { + sg = urb->sg; + data = sg_dma_address(sg); +--- a/drivers/usb/host/whci/qset.c ++++ b/drivers/usb/host/whci/qset.c +@@ -443,7 +443,7 @@ static int qset_add_urb_sg(struct whc *w + + remaining = urb->transfer_buffer_length; + +- for_each_sg(urb->sg, sg, urb->num_sgs, i) { ++ for_each_sg(urb->sg, sg, urb->num_mapped_sgs, i) { + dma_addr_t dma_addr; + size_t dma_remaining; + dma_addr_t sp, ep; +@@ -561,7 +561,7 @@ static int qset_add_urb_sg_linearize(str + + remaining = urb->transfer_buffer_length; + +- for_each_sg(urb->sg, sg, urb->num_sgs, i) { ++ for_each_sg(urb->sg, sg, urb->num_mapped_sgs, i) { + size_t len; + size_t sg_remaining; + void *orig; +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -2561,7 +2561,7 @@ static unsigned int count_sg_trbs_needed + struct scatterlist *sg; + + sg = NULL; +- num_sgs = urb->num_sgs; ++ num_sgs = urb->num_mapped_sgs; + temp = urb->transfer_buffer_length; + + xhci_dbg(xhci, "count sg list trbs: \n"); +@@ -2745,7 +2745,7 @@ static int queue_bulk_sg_tx(struct xhci_ + return -EINVAL; + + num_trbs = count_sg_trbs_needed(xhci, urb); +- num_sgs = urb->num_sgs; ++ num_sgs = urb->num_mapped_sgs; + total_packet_count = roundup(urb->transfer_buffer_length, + usb_endpoint_maxp(&urb->ep->desc)); + +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -1221,6 +1221,7 @@ struct urb { + void *transfer_buffer; /* (in) associated data buffer */ + dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ + struct scatterlist *sg; /* (in) scatter gather buffer list */ ++ int num_mapped_sgs; /* (internal) mapped sg entries */ + int num_sgs; /* (in) number of entries in the sg list */ + u32 transfer_buffer_length; /* (in) data buffer length */ + u32 actual_length; /* (return) actual transfer length */ diff --git a/queue-3.2/usb-musb-fix-pm_runtime-mismatch.patch b/queue-3.2/usb-musb-fix-pm_runtime-mismatch.patch new file mode 100644 index 00000000000..4b046c5a491 --- /dev/null +++ b/queue-3.2/usb-musb-fix-pm_runtime-mismatch.patch @@ -0,0 +1,49 @@ +From 772aed45b604c5ff171f0f12c12392d868333f79 Mon Sep 17 00:00:00 2001 +From: Felipe Contreras +Date: Mon, 19 Dec 2011 22:01:54 +0200 +Subject: usb: musb: fix pm_runtime mismatch + +From: Felipe Contreras + +commit 772aed45b604c5ff171f0f12c12392d868333f79 upstream. + +In musb_init_controller() there's a pm_runtime_put(), but there's no +pm_runtime_get(), which creates a mismatch that causes the driver to +sleep when it shouldn't. + +This was introduced in 7acc619[1], but it wasn't triggered in my setup +until 18a2689[2] was merged to Linus' branch at point df0914[3]. IOW; +when PM is working as it was supposed to. + +However, it seems most of the time this is used in a way that keeps the +counter above 0, so nobody noticed. Also, it seems to depend on the +configuration used in versions before 3.1, but not later (or in it). + +I found the problem by loading isp1704_charger before any usb gadgets: +http://article.gmane.org/gmane.linux.kernel/1226122 + +All versions after 2.6.39 are affected. + +[1] usb: musb: Idle path retention and offmode support for OMAP3 +[2] OMAP2+: musb: hwmod adaptation for musb registration +[3] Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 + +Cc: Hema HK +Signed-off-by: Felipe Contreras +Signed-off-by: Felipe Balbi + +--- + drivers/usb/musb/musb_core.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/usb/musb/musb_core.c ++++ b/drivers/usb/musb/musb_core.c +@@ -2012,8 +2012,6 @@ musb_init_controller(struct device *dev, + if (status < 0) + goto fail3; + +- pm_runtime_put(musb->controller); +- + status = musb_init_debugfs(musb); + if (status < 0) + goto fail4; diff --git a/queue-3.2/usb-omninet-fix-write_room.patch b/queue-3.2/usb-omninet-fix-write_room.patch new file mode 100644 index 00000000000..f9eaf420674 --- /dev/null +++ b/queue-3.2/usb-omninet-fix-write_room.patch @@ -0,0 +1,32 @@ +From 694c6301e515bad574af74b6552134c4d9dcb334 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Sun, 6 Nov 2011 19:06:21 +0100 +Subject: USB: omninet: fix write_room + +From: Johan Hovold + +commit 694c6301e515bad574af74b6552134c4d9dcb334 upstream. + +Fix regression introduced by commit 507ca9bc047666 ([PATCH] USB: add +ability for usb-serial drivers to determine if their write urb is +currently being used.) which inverted the logic in write_room so that it +returns zero when the write urb is actually free. + +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/omninet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/serial/omninet.c ++++ b/drivers/usb/serial/omninet.c +@@ -315,7 +315,7 @@ static int omninet_write_room(struct tty + int room = 0; /* Default: no room */ + + /* FIXME: no consistent locking for write_urb_busy */ +- if (wport->write_urb_busy) ++ if (!wport->write_urb_busy) + room = wport->bulk_out_size - OMNINET_HEADERLEN; + + dbg("%s - returns %d", __func__, room); diff --git a/queue-3.2/usb-option-add-zd-incorporated-hspa-modem.patch b/queue-3.2/usb-option-add-zd-incorporated-hspa-modem.patch new file mode 100644 index 00000000000..9539ca3cb9a --- /dev/null +++ b/queue-3.2/usb-option-add-zd-incorporated-hspa-modem.patch @@ -0,0 +1,51 @@ +From 3c8c9316710b83e906e425024153bf0929887b59 Mon Sep 17 00:00:00 2001 +From: Janne Snabb +Date: Wed, 28 Dec 2011 19:36:00 +0000 +Subject: usb: option: add ZD Incorporated HSPA modem + +From: Janne Snabb + +commit 3c8c9316710b83e906e425024153bf0929887b59 upstream. + +Add support for Chinese Noname HSPA USB modem which is apparently +manufactured by a company called ZD Incorporated (based on texts in the +Windows drivers). + +This product is available at least from Dealextreme (SKU 80032) and +possibly in India with name Olive V-MW250. It is based on Qualcomm +MSM6280 chip. + +I needed to also add "options usb-storage quirks=0685:7000:i" in modprobe +configuration because udevd or the kernel keeps poking the embedded +fake-cd-rom which fails and causes the device to reset. There might be +a better way to accomplish the same. usb_modeswitch is not needed with +this device. + +Signed-off-by: Janne Snabb +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -476,6 +476,10 @@ static void option_instat_callback(struc + #define VIETTEL_VENDOR_ID 0x2262 + #define VIETTEL_PRODUCT_VT1000 0x0002 + ++/* ZD Incorporated */ ++#define ZD_VENDOR_ID 0x0685 ++#define ZD_PRODUCT_7000 0x7000 ++ + /* some devices interfaces need special handling due to a number of reasons */ + enum option_blacklist_reason { + OPTION_BLACKLIST_NONE = 0, +@@ -1178,6 +1182,7 @@ static const struct usb_device_id option + { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, + { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, + { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, + { } /* Terminating entry */ + }; + MODULE_DEVICE_TABLE(usb, option_ids); diff --git a/queue-3.2/usb-pxa168-fix-compilation-error.patch b/queue-3.2/usb-pxa168-fix-compilation-error.patch new file mode 100644 index 00000000000..eac7f788804 --- /dev/null +++ b/queue-3.2/usb-pxa168-fix-compilation-error.patch @@ -0,0 +1,40 @@ +From 35657c4d72925936c7219cc5caac118ca632acc2 Mon Sep 17 00:00:00 2001 +From: Tanmay Upadhyay +Date: Thu, 8 Dec 2011 10:03:49 +0530 +Subject: USB: pxa168: Fix compilation error + +From: Tanmay Upadhyay + +commit 35657c4d72925936c7219cc5caac118ca632acc2 upstream. + +After commit c430131a02d677aa708f56342c1565edfdacb3c0 (Support +controllers with big endian capability regs), HC_LENGTH takes +two arguments. This patch fixes following compilation error: + +In file included from drivers/usb/host/ehci-hcd.c:1323: +drivers/usb/host/ehci-pxa168.c:302:54: error: macro "HC_LENGTH" requires 2 arguments, but only 1 given +In file included from drivers/usb/host/ehci-hcd.c:1323: +drivers/usb/host/ehci-pxa168.c: In function 'ehci_pxa168_drv_probe': +drivers/usb/host/ehci-pxa168.c:302: error: 'HC_LENGTH' undeclared (first use in this function) +drivers/usb/host/ehci-pxa168.c:302: error: (Each undeclared identifier is reported only once +drivers/usb/host/ehci-pxa168.c:302: error: for each function it appears in.) + +Signed-off-by: Tanmay Upadhyay +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-pxa168.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/ehci-pxa168.c ++++ b/drivers/usb/host/ehci-pxa168.c +@@ -299,7 +299,7 @@ static int __devinit ehci_pxa168_drv_pro + ehci = hcd_to_ehci(hcd); + ehci->caps = hcd->regs + 0x100; + ehci->regs = hcd->regs + 0x100 + +- HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); ++ HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); + hcd->has_tt = 1; + ehci->sbrn = 0x20; diff --git a/queue-3.2/usb-usb-storage-doesn-t-support-dynamic-id-currently-the-patch-disables-the-feature-to-fix-an-oops.patch b/queue-3.2/usb-usb-storage-doesn-t-support-dynamic-id-currently-the-patch-disables-the-feature-to-fix-an-oops.patch new file mode 100644 index 00000000000..6724bc07d7d --- /dev/null +++ b/queue-3.2/usb-usb-storage-doesn-t-support-dynamic-id-currently-the-patch-disables-the-feature-to-fix-an-oops.patch @@ -0,0 +1,118 @@ +From 1a3a026ba1b6bbfe0b7f79ab38cf991d691e7c9a Mon Sep 17 00:00:00 2001 +From: Huajun Li +Date: Wed, 4 Jan 2012 19:25:33 +0800 +Subject: usb: usb-storage doesn't support dynamic id currently, the patch disables the feature to fix an oops + +From: Huajun Li + +commit 1a3a026ba1b6bbfe0b7f79ab38cf991d691e7c9a upstream. + +Echo vendor and product number of a non usb-storage device to +usb-storage driver's new_id, then plug in the device to host and you +will find following oops msg, the root cause is usb_stor_probe1() +refers invalid id entry if giving a dynamic id, so just disable the +feature. + +[ 3105.018012] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC +[ 3105.018062] CPU 0 +[ 3105.018075] Modules linked in: usb_storage usb_libusual bluetooth +dm_crypt binfmt_misc snd_hda_codec_analog snd_hda_intel snd_hda_codec +snd_hwdep hp_wmi ppdev sparse_keymap snd_pcm snd_seq_midi snd_rawmidi +snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse snd +serio_raw tpm_infineon soundcore i915 snd_page_alloc tpm_tis +parport_pc tpm tpm_bios drm_kms_helper drm i2c_algo_bit video lp +parport usbhid hid sg sr_mod sd_mod ehci_hcd uhci_hcd usbcore e1000e +usb_common floppy +[ 3105.018408] +[ 3105.018419] Pid: 189, comm: khubd Tainted: G I 3.2.0-rc7+ +#29 Hewlett-Packard HP Compaq dc7800p Convertible Minitower/0AACh +[ 3105.018481] RIP: 0010:[] [] +usb_stor_probe1+0x2fd/0xc20 [usb_storage] +[ 3105.018536] RSP: 0018:ffff880056a3d830 EFLAGS: 00010286 +[ 3105.018562] RAX: ffff880065f4e648 RBX: ffff88006bb28000 RCX: 0000000000000000 +[ 3105.018597] RDX: ffff88006f23c7b0 RSI: 0000000000000001 RDI: 0000000000000206 +[ 3105.018632] RBP: ffff880056a3d900 R08: 0000000000000000 R09: ffff880067365000 +[ 3105.018665] R10: 00000000000002ac R11: 0000000000000010 R12: ffff6000b41a7340 +[ 3105.018698] R13: ffff880065f4ef60 R14: ffff88006bb28b88 R15: ffff88006f23d270 +[ 3105.018733] FS: 0000000000000000(0000) GS:ffff88007a200000(0000) +knlGS:0000000000000000 +[ 3105.018773] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b +[ 3105.018801] CR2: 00007fc99c8c4650 CR3: 0000000001e05000 CR4: 00000000000006f0 +[ 3105.018835] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +[ 3105.018870] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 +[ 3105.018906] Process khubd (pid: 189, threadinfo ffff880056a3c000, +task ffff88005677a400) +[ 3105.018945] Stack: +[ 3105.018959] 0000000000000000 0000000000000000 ffff880056a3d8d0 +0000000000000002 +[ 3105.019011] 0000000000000000 ffff880056a3d918 ffff880000000000 +0000000000000002 +[ 3105.019058] ffff880056a3d8d0 0000000000000012 ffff880056a3d8d0 +0000000000000006 +[ 3105.019105] Call Trace: +[ 3105.019128] [] storage_probe+0xa4/0xe0 [usb_storage] +[ 3105.019173] [] usb_probe_interface+0x172/0x330 [usbcore] +[ 3105.019211] [] driver_probe_device+0x257/0x3b0 +[ 3105.019243] [] __device_attach+0x73/0x90 +[ 3105.019272] [] ? __driver_attach+0x110/0x110 +[ 3105.019303] [] bus_for_each_drv+0x9c/0xf0 +[ 3105.019334] [] device_attach+0xf7/0x120 +[ 3105.019364] [] bus_probe_device+0x45/0x80 +[ 3105.019396] [] device_add+0x876/0x990 +[ 3105.019434] [] usb_set_configuration+0x822/0x9e0 [usbcore] +[ 3105.019479] [] generic_probe+0x62/0xf0 [usbcore] +[ 3105.019518] [] usb_probe_device+0x66/0xb0 [usbcore] +[ 3105.019555] [] driver_probe_device+0x257/0x3b0 +[ 3105.019589] [] __device_attach+0x73/0x90 +[ 3105.019617] [] ? __driver_attach+0x110/0x110 +[ 3105.019648] [] bus_for_each_drv+0x9c/0xf0 +[ 3105.019680] [] device_attach+0xf7/0x120 +[ 3105.019709] [] bus_probe_device+0x45/0x80 +[ 3105.021040] usb usb6: usb auto-resume +[ 3105.021045] usb usb6: wakeup_rh +[ 3105.024849] [] device_add+0x876/0x990 +[ 3105.025086] [] usb_new_device+0x1e7/0x2b0 [usbcore] +[ 3105.025086] [] hub_thread+0xb27/0x1ec0 [usbcore] +[ 3105.025086] [] ? wake_up_bit+0x50/0x50 +[ 3105.025086] [] ? usb_remote_wakeup+0xa0/0xa0 [usbcore] +[ 3105.025086] [] kthread+0xd8/0xf0 +[ 3105.025086] [] kernel_thread_helper+0x4/0x10 +[ 3105.025086] [] ? _raw_spin_unlock_irq+0x50/0x80 +[ 3105.025086] [] ? retint_restore_args+0x13/0x13 +[ 3105.025086] [] ? __init_kthread_worker+0x80/0x80 +[ 3105.025086] [] ? gs_change+0x13/0x13 +[ 3105.025086] Code: 00 48 83 05 cd ad 00 00 01 48 83 05 cd ad 00 00 +01 4c 8b ab 30 0c 00 00 48 8b 50 08 48 83 c0 30 48 89 45 a0 4c 89 a3 +40 0c 00 00 <41> 0f b6 44 24 10 48 89 55 a8 3c ff 0f 84 b8 04 00 00 48 +83 05 +[ 3105.025086] RIP [] usb_stor_probe1+0x2fd/0xc20 +[usb_storage] +[ 3105.025086] RSP +[ 3105.060037] hub 6-0:1.0: hub_resume +[ 3105.062616] usb usb5: usb auto-resume +[ 3105.064317] ehci_hcd 0000:00:1d.7: resume root hub +[ 3105.094809] ---[ end trace a7919e7f17c0a727 ]--- +[ 3105.130069] hub 5-0:1.0: hub_resume +[ 3105.132131] usb usb4: usb auto-resume +[ 3105.132136] usb usb4: wakeup_rh +[ 3105.180059] hub 4-0:1.0: hub_resume +[ 3106.290052] usb usb6: suspend_rh (auto-stop) +[ 3106.290077] usb usb4: suspend_rh (auto-stop) + +Signed-off-by: Huajun Li +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/usb.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/storage/usb.c ++++ b/drivers/usb/storage/usb.c +@@ -1073,6 +1073,7 @@ static struct usb_driver usb_storage_dri + .id_table = usb_storage_usb_ids, + .supports_autosuspend = 1, + .soft_unbind = 1, ++ .no_dynamic_id = 1, + }; + + static int __init usb_stor_init(void) diff --git a/queue-3.2/xhci-properly-handle-comp_2nd_bw_err.patch b/queue-3.2/xhci-properly-handle-comp_2nd_bw_err.patch new file mode 100644 index 00000000000..9ac78ee32e2 --- /dev/null +++ b/queue-3.2/xhci-properly-handle-comp_2nd_bw_err.patch @@ -0,0 +1,58 @@ +From 71d85724bdd947a3b42a88d08af79f290a1a767b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 4 Jan 2012 23:29:18 +0100 +Subject: xhci: Properly handle COMP_2ND_BW_ERR + +From: Hans de Goede + +commit 71d85724bdd947a3b42a88d08af79f290a1a767b upstream. + +I encountered a result of COMP_2ND_BW_ERR while improving how the pwc +webcam driver handles not having the full usb1 bandwidth available to +itself. + +I created the following test setup, a NEC xhci controller with a +single TT USB 2 hub plugged into it, with a usb keyboard and a pwc webcam +plugged into the usb2 hub. This caused the following to show up in dmesg +when trying to stream from the pwc camera at its highest alt setting: + +xhci_hcd 0000:01:00.0: ERROR: unexpected command completion code 0x23. +usb 6-2.1: Not enough bandwidth for altsetting 9 + +And usb_set_interface returned -EINVAL, which caused my pwc code to not +do the right thing as it expected -ENOSPC. + +This patch makes the xhci driver properly handle COMP_2ND_BW_ERR and makes +usb_set_interface return -ENOSPC as expected. + +This should be backported to stable kernels as old as 2.6.32. + +Signed-off-by: Hans de Goede +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci.c | 1 + + drivers/usb/host/xhci.h | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -1620,6 +1620,7 @@ static int xhci_configure_endpoint_resul + /* FIXME: can we allocate more resources for the HC? */ + break; + case COMP_BW_ERR: ++ case COMP_2ND_BW_ERR: + dev_warn(&udev->dev, "Not enough bandwidth " + "for new device state.\n"); + ret = -ENOSPC; +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1033,7 +1033,6 @@ struct xhci_transfer_event { + /* Invalid Stream ID Error */ + #define COMP_STRID_ERR 34 + /* Secondary Bandwidth Error - may be returned by a Configure Endpoint cmd */ +-/* FIXME - check for this */ + #define COMP_2ND_BW_ERR 35 + /* Split Transaction Error */ + #define COMP_SPLIT_ERR 36