From 9482fb48280d291cbf9c1b1fa68b7f96347ce269 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 1 Dec 2009 17:22:47 -0800 Subject: [PATCH] more .31 patches --- ...up-error-code-from-ace_load_firmware.patch | 32 +++++ ...-use-the-packet-s-source-mac-address.patch | 56 ++++++++ .../net-fix-sk_forward_alloc-corruption.patch | 130 +++++++++++++++++ .../pkt_sched-pedit-use-proper-struct.patch | 34 +++++ ...-by-zalloc-ing-most-of-the-cpu-masks.patch | 45 ++++++ queue-2.6.31/series | 12 ++ ...ectly-for-page-buffers-passed-to-gro.patch | 60 ++++++++ ...isition-outside-of-devtree_lock-grab.patch | 47 +++++++ .../sparc64-replace-parentheses-in-pmul.patch | 30 ++++ queue-2.6.31/udp-fix-udp_poll-and-ioctl.patch | 133 ++++++++++++++++++ ...r-three-additional-hauppauge-usb-ids.patch | 37 +++++ ...orce_ts_valid-mode-for-mpeg-ts-input.patch | 53 +++++++ ...val-for-the-hauppauge-wintv-hvr-1150.patch | 32 +++++ 13 files changed, 701 insertions(+) create mode 100644 queue-2.6.31/acenic-pass-up-error-code-from-ace_load_firmware.patch create mode 100644 queue-2.6.31/bonding-modify-hash-transmit-policies-to-use-the-packet-s-source-mac-address.patch create mode 100644 queue-2.6.31/net-fix-sk_forward_alloc-corruption.patch create mode 100644 queue-2.6.31/pkt_sched-pedit-use-proper-struct.patch create mode 100644 queue-2.6.31/sched-fix-boot-crash-by-zalloc-ing-most-of-the-cpu-masks.patch create mode 100644 queue-2.6.31/sfc-set-ip_summed-correctly-for-page-buffers-passed-to-gro.patch create mode 100644 queue-2.6.31/sparc-move-of_set_property_mutex-acquisition-outside-of-devtree_lock-grab.patch create mode 100644 queue-2.6.31/sparc64-replace-parentheses-in-pmul.patch create mode 100644 queue-2.6.31/udp-fix-udp_poll-and-ioctl.patch create mode 100644 queue-2.6.31/v4l-dvb-13202-smsusb-add-autodetection-support-for-three-additional-hauppauge-usb-ids.patch create mode 100644 queue-2.6.31/v4l-dvb-13313-saa7134-add-support-for-force_ts_valid-mode-for-mpeg-ts-input.patch create mode 100644 queue-2.6.31/v4l-dvb-13314-saa7134-set-ts_force_val-for-the-hauppauge-wintv-hvr-1150.patch diff --git a/queue-2.6.31/acenic-pass-up-error-code-from-ace_load_firmware.patch b/queue-2.6.31/acenic-pass-up-error-code-from-ace_load_firmware.patch new file mode 100644 index 00000000000..ae69d591085 --- /dev/null +++ b/queue-2.6.31/acenic-pass-up-error-code-from-ace_load_firmware.patch @@ -0,0 +1,32 @@ +From 61ccefa50f367ad531f52b57eef3621f3529c6df Mon Sep 17 00:00:00 2001 +From: Ben Hutchings +Date: Mon, 12 Oct 2009 04:18:48 -0700 +Subject: acenic: Pass up error code from ace_load_firmware() + +From: Ben Hutchings + +[ Upstream commit 6c60e0c30c80fcd53e61701b7865a85283f8a341 ] + +If ace_load_firmware() fails, ace_init() cleans up but still returns +0, leading to an oops as seen in . +It should pass the error code up. + +Signed-off-by: Ben Hutchings +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/acenic.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/acenic.c ++++ b/drivers/net/acenic.c +@@ -1209,7 +1209,8 @@ static int __devinit ace_init(struct net + memset(ap->info, 0, sizeof(struct ace_info)); + memset(ap->skb, 0, sizeof(struct ace_skb)); + +- if (ace_load_firmware(dev)) ++ ecode = ace_load_firmware(dev); ++ if (ecode) + goto init_error; + + ap->fw_running = 0; diff --git a/queue-2.6.31/bonding-modify-hash-transmit-policies-to-use-the-packet-s-source-mac-address.patch b/queue-2.6.31/bonding-modify-hash-transmit-policies-to-use-the-packet-s-source-mac-address.patch new file mode 100644 index 00000000000..c924526253b --- /dev/null +++ b/queue-2.6.31/bonding-modify-hash-transmit-policies-to-use-the-packet-s-source-mac-address.patch @@ -0,0 +1,56 @@ +From 441d36e87afee0a4d5f90fed7c174cab77a6d0bd Mon Sep 17 00:00:00 2001 +From: Jasper Spaans +Date: Fri, 23 Oct 2009 04:08:46 +0000 +Subject: bonding: Modify hash transmit policies to use the packet's source MAC address + +From: Jasper Spaans + +[ Upstream commit d3da68310a2cf934c2ea8a99a519d8b1ccca4c56 ] + +Modify bonding hash transmit policies to use the psource MAC address of +the packet instead of the MAC address configured for the bonding device. + +The old sitation conflicts with the documentation. + +Signed-off-by: Jasper Spaans +Acked-by: Eric Dumazet +Signed-off-by: Jay Vosburgh +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/bonding/bond_main.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -3707,10 +3707,10 @@ static int bond_xmit_hash_policy_l23(str + + if (skb->protocol == htons(ETH_P_IP)) { + return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^ +- (data->h_dest[5] ^ bond_dev->dev_addr[5])) % count; ++ (data->h_dest[5] ^ data->h_source[5])) % count; + } + +- return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count; ++ return (data->h_dest[5] ^ data->h_source[5]) % count; + } + + /* +@@ -3737,7 +3737,7 @@ static int bond_xmit_hash_policy_l34(str + + } + +- return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count; ++ return (data->h_dest[5] ^ data->h_source[5]) % count; + } + + /* +@@ -3748,7 +3748,7 @@ static int bond_xmit_hash_policy_l2(stru + { + struct ethhdr *data = (struct ethhdr *)skb->data; + +- return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count; ++ return (data->h_dest[5] ^ data->h_source[5]) % count; + } + + /*-------------------------- Device entry points ----------------------------*/ diff --git a/queue-2.6.31/net-fix-sk_forward_alloc-corruption.patch b/queue-2.6.31/net-fix-sk_forward_alloc-corruption.patch new file mode 100644 index 00000000000..f8aef121aac --- /dev/null +++ b/queue-2.6.31/net-fix-sk_forward_alloc-corruption.patch @@ -0,0 +1,130 @@ +From 4432366eece70b6cf72a7e862945ea8c9e576e3d Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Sun, 15 Nov 2009 20:50:00 -0800 +Subject: net: fix sk_forward_alloc corruption + +From: Eric Dumazet + +[ Upstream commit: 9d410c796067686b1e032d54ce475b7055537138 ] + +On UDP sockets, we must call skb_free_datagram() with socket locked, +or risk sk_forward_alloc corruption. This requirement is not respected +in SUNRPC. + +Add a convenient helper, skb_free_datagram_locked() and use it in SUNRPC + +Reported-by: Francis Moreau +Signed-off-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/skbuff.h | 2 ++ + net/core/datagram.c | 10 +++++++++- + net/ipv4/udp.c | 4 +--- + net/ipv6/udp.c | 4 +--- + net/sunrpc/svcsock.c | 10 +++++----- + 5 files changed, 18 insertions(+), 12 deletions(-) + +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -1761,6 +1761,8 @@ extern int skb_copy_datagram_cons + int to_offset, + int size); + extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); ++extern void skb_free_datagram_locked(struct sock *sk, ++ struct sk_buff *skb); + extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, + unsigned int flags); + extern __wsum skb_checksum(const struct sk_buff *skb, int offset, +--- a/net/core/datagram.c ++++ b/net/core/datagram.c +@@ -223,6 +223,15 @@ void skb_free_datagram(struct sock *sk, + consume_skb(skb); + sk_mem_reclaim_partial(sk); + } ++EXPORT_SYMBOL(skb_free_datagram); ++ ++void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb) ++{ ++ lock_sock(sk); ++ skb_free_datagram(sk, skb); ++ release_sock(sk); ++} ++EXPORT_SYMBOL(skb_free_datagram_locked); + + /** + * skb_kill_datagram - Free a datagram skbuff forcibly +@@ -749,5 +758,4 @@ unsigned int datagram_poll(struct file * + EXPORT_SYMBOL(datagram_poll); + EXPORT_SYMBOL(skb_copy_and_csum_datagram_iovec); + EXPORT_SYMBOL(skb_copy_datagram_iovec); +-EXPORT_SYMBOL(skb_free_datagram); + EXPORT_SYMBOL(skb_recv_datagram); +--- a/net/ipv4/udp.c ++++ b/net/ipv4/udp.c +@@ -987,9 +987,7 @@ try_again: + err = ulen; + + out_free: +- lock_sock(sk); +- skb_free_datagram(sk, skb); +- release_sock(sk); ++ skb_free_datagram_locked(sk, skb); + out: + return err; + +--- a/net/ipv6/udp.c ++++ b/net/ipv6/udp.c +@@ -288,9 +288,7 @@ try_again: + err = ulen; + + out_free: +- lock_sock(sk); +- skb_free_datagram(sk, skb); +- release_sock(sk); ++ skb_free_datagram_locked(sk, skb); + out: + return err; + +--- a/net/sunrpc/svcsock.c ++++ b/net/sunrpc/svcsock.c +@@ -110,7 +110,7 @@ static void svc_release_skb(struct svc_r + rqstp->rq_xprt_ctxt = NULL; + + dprintk("svc: service %p, releasing skb %p\n", rqstp, skb); +- skb_free_datagram(svsk->sk_sk, skb); ++ skb_free_datagram_locked(svsk->sk_sk, skb); + } + } + +@@ -537,7 +537,7 @@ static int svc_udp_recvfrom(struct svc_r + printk("rpcsvc: received unknown control message:" + "%d/%d\n", + cmh->cmsg_level, cmh->cmsg_type); +- skb_free_datagram(svsk->sk_sk, skb); ++ skb_free_datagram_locked(svsk->sk_sk, skb); + return 0; + } + svc_udp_get_dest_address(rqstp, cmh); +@@ -548,18 +548,18 @@ static int svc_udp_recvfrom(struct svc_r + if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) { + local_bh_enable(); + /* checksum error */ +- skb_free_datagram(svsk->sk_sk, skb); ++ skb_free_datagram_locked(svsk->sk_sk, skb); + return 0; + } + local_bh_enable(); +- skb_free_datagram(svsk->sk_sk, skb); ++ skb_free_datagram_locked(svsk->sk_sk, skb); + } else { + /* we can use it in-place */ + rqstp->rq_arg.head[0].iov_base = skb->data + + sizeof(struct udphdr); + rqstp->rq_arg.head[0].iov_len = len; + if (skb_checksum_complete(skb)) { +- skb_free_datagram(svsk->sk_sk, skb); ++ skb_free_datagram_locked(svsk->sk_sk, skb); + return 0; + } + rqstp->rq_xprt_ctxt = skb; diff --git a/queue-2.6.31/pkt_sched-pedit-use-proper-struct.patch b/queue-2.6.31/pkt_sched-pedit-use-proper-struct.patch new file mode 100644 index 00000000000..6437a3def52 --- /dev/null +++ b/queue-2.6.31/pkt_sched-pedit-use-proper-struct.patch @@ -0,0 +1,34 @@ +From 40ab8366787b89557c749798d6fe73fd69101a78 Mon Sep 17 00:00:00 2001 +From: jamal +Date: Sun, 11 Oct 2009 04:21:38 +0000 +Subject: pkt_sched: pedit use proper struct + +From: Jamal Hadi Salim + +[ Upstream commit 53f7e35f8b7fc2f5620a863ac613bcf3080cb6ba ] + +This probably deserves to go into -stable. + +Pedit will reject a policy that is large because it +uses the wrong structure in the policy validation. +This fixes it. + +Signed-off-by: Jamal Hadi Salim +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/sched/act_pedit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/sched/act_pedit.c ++++ b/net/sched/act_pedit.c +@@ -34,7 +34,7 @@ static struct tcf_hashinfo pedit_hash_in + }; + + static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = { +- [TCA_PEDIT_PARMS] = { .len = sizeof(struct tcf_pedit) }, ++ [TCA_PEDIT_PARMS] = { .len = sizeof(struct tc_pedit) }, + }; + + static int tcf_pedit_init(struct nlattr *nla, struct nlattr *est, diff --git a/queue-2.6.31/sched-fix-boot-crash-by-zalloc-ing-most-of-the-cpu-masks.patch b/queue-2.6.31/sched-fix-boot-crash-by-zalloc-ing-most-of-the-cpu-masks.patch new file mode 100644 index 00000000000..63a3cb34000 --- /dev/null +++ b/queue-2.6.31/sched-fix-boot-crash-by-zalloc-ing-most-of-the-cpu-masks.patch @@ -0,0 +1,45 @@ +From 49557e620339cb134127b5bfbcfecc06b77d0232 Mon Sep 17 00:00:00 2001 +From: Rusty Russell +Date: Mon, 2 Nov 2009 20:37:20 +1030 +Subject: sched: Fix boot crash by zalloc()ing most of the cpu masks + +From: Rusty Russell + +commit 49557e620339cb134127b5bfbcfecc06b77d0232 upstream. + +I got a boot crash when forcing cpumasks offstack on 32 bit, +because find_new_ilb() returned 3 on my UP system (nohz.cpu_mask +wasn't zeroed). + +AFAICT the others need to be zeroed too: only +nohz.ilb_grp_nohz_mask is initialized before use. + +Signed-off-by: Rusty Russell +Cc: Peter Zijlstra +LKML-Reference: <200911022037.21282.rusty@rustcorp.com.au> +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sched.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/kernel/sched.c ++++ b/kernel/sched.c +@@ -9383,13 +9383,13 @@ void __init sched_init(void) + current->sched_class = &fair_sched_class; + + /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */ +- alloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT); ++ zalloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT); + #ifdef CONFIG_SMP + #ifdef CONFIG_NO_HZ +- alloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT); ++ zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT); + alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT); + #endif +- alloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT); ++ zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT); + #endif /* SMP */ + + perf_counter_init(); diff --git a/queue-2.6.31/series b/queue-2.6.31/series index 67c38df672c..29a30f7d103 100644 --- a/queue-2.6.31/series +++ b/queue-2.6.31/series @@ -69,3 +69,15 @@ v4l-dvb-12696-gspca-sonixj-sn9c102-two-drivers-for-0c45-60fc-and-0c45-613e.patch drm-i915-select-config_shmem.patch drm-work-around-edids-with-bad-htotal-vtotal-values.patch drm-i915-fix-irq-stall-issue-on-ironlake.patch +udp-fix-udp_poll-and-ioctl.patch +acenic-pass-up-error-code-from-ace_load_firmware.patch +pkt_sched-pedit-use-proper-struct.patch +net-fix-sk_forward_alloc-corruption.patch +bonding-modify-hash-transmit-policies-to-use-the-packet-s-source-mac-address.patch +sfc-set-ip_summed-correctly-for-page-buffers-passed-to-gro.patch +sparc64-replace-parentheses-in-pmul.patch +sparc-move-of_set_property_mutex-acquisition-outside-of-devtree_lock-grab.patch +sched-fix-boot-crash-by-zalloc-ing-most-of-the-cpu-masks.patch +v4l-dvb-13202-smsusb-add-autodetection-support-for-three-additional-hauppauge-usb-ids.patch +v4l-dvb-13313-saa7134-add-support-for-force_ts_valid-mode-for-mpeg-ts-input.patch +v4l-dvb-13314-saa7134-set-ts_force_val-for-the-hauppauge-wintv-hvr-1150.patch diff --git a/queue-2.6.31/sfc-set-ip_summed-correctly-for-page-buffers-passed-to-gro.patch b/queue-2.6.31/sfc-set-ip_summed-correctly-for-page-buffers-passed-to-gro.patch new file mode 100644 index 00000000000..05269addfe7 --- /dev/null +++ b/queue-2.6.31/sfc-set-ip_summed-correctly-for-page-buffers-passed-to-gro.patch @@ -0,0 +1,60 @@ +From 4df0d4b3f67dca65da23cf57ae9710d12f7a5cd3 Mon Sep 17 00:00:00 2001 +From: Ben Hutchings +Date: Wed, 28 Oct 2009 03:43:49 -0700 +Subject: sfc: Set ip_summed correctly for page buffers passed to GRO + +From: Ben Hutchings + +[ Upstream commit 345056af41feeda506a8993474b9cbb2c66bc9fb ] + +Page buffers containing packets with an incorrect checksum or using a +protocol not handled by hardware checksum offload were previously not +passed to LRO. The conversion to GRO changed this, but did not set +the ip_summed value accordingly. + +Signed-off-by: Ben Hutchings +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/sfc/rx.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/sfc/rx.c ++++ b/drivers/net/sfc/rx.c +@@ -444,7 +444,8 @@ static void efx_rx_packet__check_len(str + * the appropriate LRO method + */ + static void efx_rx_packet_lro(struct efx_channel *channel, +- struct efx_rx_buffer *rx_buf) ++ struct efx_rx_buffer *rx_buf, ++ bool checksummed) + { + struct napi_struct *napi = &channel->napi_str; + +@@ -466,7 +467,8 @@ static void efx_rx_packet_lro(struct efx + skb->len = rx_buf->len; + skb->data_len = rx_buf->len; + skb->truesize += rx_buf->len; +- skb->ip_summed = CHECKSUM_UNNECESSARY; ++ skb->ip_summed = ++ checksummed ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE; + + napi_gro_frags(napi); + +@@ -475,6 +477,7 @@ out: + rx_buf->page = NULL; + } else { + EFX_BUG_ON_PARANOID(!rx_buf->skb); ++ EFX_BUG_ON_PARANOID(!checksummed); + + napi_gro_receive(napi, rx_buf->skb); + rx_buf->skb = NULL; +@@ -570,7 +573,7 @@ void __efx_rx_packet(struct efx_channel + } + + if (likely(checksummed || rx_buf->page)) { +- efx_rx_packet_lro(channel, rx_buf); ++ efx_rx_packet_lro(channel, rx_buf, checksummed); + goto done; + } + diff --git a/queue-2.6.31/sparc-move-of_set_property_mutex-acquisition-outside-of-devtree_lock-grab.patch b/queue-2.6.31/sparc-move-of_set_property_mutex-acquisition-outside-of-devtree_lock-grab.patch new file mode 100644 index 00000000000..c5a5ae483eb --- /dev/null +++ b/queue-2.6.31/sparc-move-of_set_property_mutex-acquisition-outside-of-devtree_lock-grab.patch @@ -0,0 +1,47 @@ +From dd8f3182c6809ad4b6bdcdd07499b692ee1b0aee Mon Sep 17 00:00:00 2001 +From: David S. Miller +Date: Sun, 8 Nov 2009 17:41:20 -0800 +Subject: sparc: Move of_set_property_mutex acquisition outside of devtree_lock grab. + +From: David S. Miller + +[ Upstream commit 1c9d80ddc60f8ac26344ec3db9830e5f8016c16d ] + +Otherwise we try to sleep with preemption disabled, etc. + +Noticed by Thomas Gleixner. + +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/prom_common.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/sparc/kernel/prom_common.c ++++ b/arch/sparc/kernel/prom_common.c +@@ -76,6 +76,7 @@ int of_set_property(struct device_node * + + err = -ENODEV; + ++ mutex_lock(&of_set_property_mutex); + write_lock(&devtree_lock); + prevp = &dp->properties; + while (*prevp) { +@@ -85,9 +86,7 @@ int of_set_property(struct device_node * + void *old_val = prop->value; + int ret; + +- mutex_lock(&of_set_property_mutex); + ret = prom_setprop(dp->node, name, val, len); +- mutex_unlock(&of_set_property_mutex); + + err = -EINVAL; + if (ret >= 0) { +@@ -106,6 +105,7 @@ int of_set_property(struct device_node * + prevp = &(*prevp)->next; + } + write_unlock(&devtree_lock); ++ mutex_unlock(&of_set_property_mutex); + + /* XXX Upate procfs if necessary... */ + diff --git a/queue-2.6.31/sparc64-replace-parentheses-in-pmul.patch b/queue-2.6.31/sparc64-replace-parentheses-in-pmul.patch new file mode 100644 index 00000000000..a4f52739f89 --- /dev/null +++ b/queue-2.6.31/sparc64-replace-parentheses-in-pmul.patch @@ -0,0 +1,30 @@ +From 806d3d696d5178c5f3370271910959384c196878 Mon Sep 17 00:00:00 2001 +From: Roel Kluin +Date: Sun, 8 Nov 2009 00:26:56 -0800 +Subject: sparc64: replace parentheses in pmul() + +From: Roel Kluin + +[ Upstream commit 88b938e63e68fd35e603421f722be0f35dde1016 ] + +`>>' has a higher precedence than `?' so src2 evaluated to +either 16 or 0 dependent on the bits set in rs2. + +Signed-off-by: Roel Kluin +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/visemul.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/sparc/kernel/visemul.c ++++ b/arch/sparc/kernel/visemul.c +@@ -617,7 +617,7 @@ static void pmul(struct pt_regs *regs, u + rs2 = fps_regval(f, RS2(insn)); + + rd_val = 0; +- src2 = (rs2 >> (opf == FMUL8x16AU_OPF) ? 16 : 0); ++ src2 = rs2 >> (opf == FMUL8x16AU_OPF ? 16 : 0); + for (byte = 0; byte < 4; byte++) { + u16 src1 = (rs1 >> (byte * 8)) & 0x00ff; + u32 prod = src1 * src2; diff --git a/queue-2.6.31/udp-fix-udp_poll-and-ioctl.patch b/queue-2.6.31/udp-fix-udp_poll-and-ioctl.patch new file mode 100644 index 00000000000..ece40c844f7 --- /dev/null +++ b/queue-2.6.31/udp-fix-udp_poll-and-ioctl.patch @@ -0,0 +1,133 @@ +From 4a41c8ae366c4ed00913519d273b8dcaf4d8b8c6 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Fri, 9 Oct 2009 04:43:40 +0000 +Subject: udp: Fix udp_poll() and ioctl() + +From: Eric Dumazet + +[ Upstream commit 85584672012ee0c3b7b8e033a1ecf7c11878e45f ] + +udp_poll() can in some circumstances drop frames with incorrect checksums. + +Problem is we now have to lock the socket while dropping frames, or risk +sk_forward corruption. + +This bug is present since commit 95766fff6b9a78d1 +([UDP]: Add memory accounting.) + +While we are at it, we can correct ioctl(SIOCINQ) to also drop bad frames. + +Signed-off-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/udp.c | 74 +++++++++++++++++++++++++++++++++------------------------ + 1 file changed, 43 insertions(+), 31 deletions(-) + +--- a/net/ipv4/udp.c ++++ b/net/ipv4/udp.c +@@ -831,6 +831,42 @@ out: + return ret; + } + ++ ++/** ++ * first_packet_length - return length of first packet in receive queue ++ * @sk: socket ++ * ++ * Drops all bad checksum frames, until a valid one is found. ++ * Returns the length of found skb, or 0 if none is found. ++ */ ++static unsigned int first_packet_length(struct sock *sk) ++{ ++ struct sk_buff_head list_kill, *rcvq = &sk->sk_receive_queue; ++ struct sk_buff *skb; ++ unsigned int res; ++ ++ __skb_queue_head_init(&list_kill); ++ ++ spin_lock_bh(&rcvq->lock); ++ while ((skb = skb_peek(rcvq)) != NULL && ++ udp_lib_checksum_complete(skb)) { ++ UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, ++ IS_UDPLITE(sk)); ++ __skb_unlink(skb, rcvq); ++ __skb_queue_tail(&list_kill, skb); ++ } ++ res = skb ? skb->len : 0; ++ spin_unlock_bh(&rcvq->lock); ++ ++ if (!skb_queue_empty(&list_kill)) { ++ lock_sock(sk); ++ __skb_queue_purge(&list_kill); ++ sk_mem_reclaim_partial(sk); ++ release_sock(sk); ++ } ++ return res; ++} ++ + /* + * IOCTL requests applicable to the UDP protocol + */ +@@ -847,21 +883,16 @@ int udp_ioctl(struct sock *sk, int cmd, + + case SIOCINQ: + { +- struct sk_buff *skb; +- unsigned long amount; ++ unsigned int amount = first_packet_length(sk); + +- amount = 0; +- spin_lock_bh(&sk->sk_receive_queue.lock); +- skb = skb_peek(&sk->sk_receive_queue); +- if (skb != NULL) { ++ if (amount) + /* + * We will only return the amount + * of this packet since that is all + * that will be read. + */ +- amount = skb->len - sizeof(struct udphdr); +- } +- spin_unlock_bh(&sk->sk_receive_queue.lock); ++ amount -= sizeof(struct udphdr); ++ + return put_user(amount, (int __user *)arg); + } + +@@ -1525,32 +1556,13 @@ unsigned int udp_poll(struct file *file, + { + unsigned int mask = datagram_poll(file, sock, wait); + struct sock *sk = sock->sk; +- int is_lite = IS_UDPLITE(sk); + + /* Check for false positives due to checksum errors */ +- if ( (mask & POLLRDNORM) && +- !(file->f_flags & O_NONBLOCK) && +- !(sk->sk_shutdown & RCV_SHUTDOWN)){ +- struct sk_buff_head *rcvq = &sk->sk_receive_queue; +- struct sk_buff *skb; +- +- spin_lock_bh(&rcvq->lock); +- while ((skb = skb_peek(rcvq)) != NULL && +- udp_lib_checksum_complete(skb)) { +- UDP_INC_STATS_BH(sock_net(sk), +- UDP_MIB_INERRORS, is_lite); +- __skb_unlink(skb, rcvq); +- kfree_skb(skb); +- } +- spin_unlock_bh(&rcvq->lock); +- +- /* nothing to see, move along */ +- if (skb == NULL) +- mask &= ~(POLLIN | POLLRDNORM); +- } ++ if ((mask & POLLRDNORM) && !(file->f_flags & O_NONBLOCK) && ++ !(sk->sk_shutdown & RCV_SHUTDOWN) && !first_packet_length(sk)) ++ mask &= ~(POLLIN | POLLRDNORM); + + return mask; +- + } + + struct proto udp_prot = { diff --git a/queue-2.6.31/v4l-dvb-13202-smsusb-add-autodetection-support-for-three-additional-hauppauge-usb-ids.patch b/queue-2.6.31/v4l-dvb-13202-smsusb-add-autodetection-support-for-three-additional-hauppauge-usb-ids.patch new file mode 100644 index 00000000000..7d795ae7ed9 --- /dev/null +++ b/queue-2.6.31/v4l-dvb-13202-smsusb-add-autodetection-support-for-three-additional-hauppauge-usb-ids.patch @@ -0,0 +1,37 @@ +From 78c948ab0cc44f9c8ae397d7d9d217bb498bfa2f Mon Sep 17 00:00:00 2001 +From: Michael Krufky +Date: Wed, 21 Oct 2009 18:27:29 -0300 +Subject: V4L/DVB (13202): smsusb: add autodetection support for three additional Hauppauge USB IDs + +From: Michael Krufky + +commit 78c948ab0cc44f9c8ae397d7d9d217bb498bfa2f upstream. + +Add support for three new Hauppauge Device USB IDs: + +2040:b900 +2040:b910 +2040:c000 + +Signed-off-by: Michael Krufky +Signed-off-by: Mauro Carvalho Chehab + +--- + drivers/media/dvb/siano/smsusb.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/media/dvb/siano/smsusb.c ++++ b/drivers/media/dvb/siano/smsusb.c +@@ -529,6 +529,12 @@ struct usb_device_id smsusb_id_table[] = + .driver_info = SMS1XXX_BOARD_SIANO_NICE }, + { USB_DEVICE(0x187f, 0x0301), + .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, ++ { USB_DEVICE(0x2040, 0xb900), ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, ++ { USB_DEVICE(0x2040, 0xb910), ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, ++ { USB_DEVICE(0x2040, 0xc000), ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, + { } /* Terminating entry */ + }; + diff --git a/queue-2.6.31/v4l-dvb-13313-saa7134-add-support-for-force_ts_valid-mode-for-mpeg-ts-input.patch b/queue-2.6.31/v4l-dvb-13313-saa7134-add-support-for-force_ts_valid-mode-for-mpeg-ts-input.patch new file mode 100644 index 00000000000..f0a4cefe81e --- /dev/null +++ b/queue-2.6.31/v4l-dvb-13313-saa7134-add-support-for-force_ts_valid-mode-for-mpeg-ts-input.patch @@ -0,0 +1,53 @@ +From 4007a672abd88091e3cced158ec491d41c0c454c Mon Sep 17 00:00:00 2001 +From: Michael Krufky +Date: Wed, 4 Nov 2009 14:19:35 -0300 +Subject: V4L/DVB (13313): saa7134: add support for FORCE_TS_VALID mode for mpeg ts input + +From: Michael Krufky + +commit 4007a672abd88091e3cced158ec491d41c0c454c upstream. + +When FORCE_TS_VALID mode is enabled, the saa713x will accept MPEG TS input +without requiring TS_VALID set high. This is required for some new boards +to function properly, due to the hardware design implementation. + +The configuration is toggled within the board setup configuration. Boards +that do not have this bit set will function as before with no change. + +Signed-off-by: Michael Krufky +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/video/saa7134/saa7134-ts.c | 6 ++++-- + drivers/media/video/saa7134/saa7134.h | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/media/video/saa7134/saa7134.h ++++ b/drivers/media/video/saa7134/saa7134.h +@@ -355,6 +355,7 @@ struct saa7134_board { + enum saa7134_mpeg_type mpeg; + enum saa7134_mpeg_ts_type ts_type; + unsigned int vid_port_opts; ++ unsigned int ts_force_val:1; + }; + + #define card_has_radio(dev) (NULL != saa7134_boards[dev->board].radio.name) +--- a/drivers/media/video/saa7134/saa7134-ts.c ++++ b/drivers/media/video/saa7134/saa7134-ts.c +@@ -262,11 +262,13 @@ int saa7134_ts_start(struct saa7134_dev + switch (saa7134_boards[dev->board].ts_type) { + case SAA7134_MPEG_TS_PARALLEL: + saa_writeb(SAA7134_TS_SERIAL0, 0x40); +- saa_writeb(SAA7134_TS_PARALLEL, 0xec); ++ saa_writeb(SAA7134_TS_PARALLEL, 0xec | ++ (saa7134_boards[dev->board].ts_force_val << 4)); + break; + case SAA7134_MPEG_TS_SERIAL: + saa_writeb(SAA7134_TS_SERIAL0, 0xd8); +- saa_writeb(SAA7134_TS_PARALLEL, 0x6c); ++ saa_writeb(SAA7134_TS_PARALLEL, 0x6c | ++ (saa7134_boards[dev->board].ts_force_val << 4)); + saa_writeb(SAA7134_TS_PARALLEL_SERIAL, 0xbc); + saa_writeb(SAA7134_TS_SERIAL1, 0x02); + break; diff --git a/queue-2.6.31/v4l-dvb-13314-saa7134-set-ts_force_val-for-the-hauppauge-wintv-hvr-1150.patch b/queue-2.6.31/v4l-dvb-13314-saa7134-set-ts_force_val-for-the-hauppauge-wintv-hvr-1150.patch new file mode 100644 index 00000000000..b58b67c9c46 --- /dev/null +++ b/queue-2.6.31/v4l-dvb-13314-saa7134-set-ts_force_val-for-the-hauppauge-wintv-hvr-1150.patch @@ -0,0 +1,32 @@ +From 22370ef5035f206283505409c9a64a595c5c7320 Mon Sep 17 00:00:00 2001 +From: Michael Krufky +Date: Wed, 4 Nov 2009 14:23:57 -0300 +Subject: V4L/DVB (13314): saa7134: set ts_force_val for the Hauppauge WinTV HVR-1150 + +From: Michael Krufky + +commit 22370ef5035f206283505409c9a64a595c5c7320 upstream. + +The Hauppauge WinTV HVR-1150 retail boards require the FORCE_TS_VALID bit +to be set in order to function properly. This change will work on the early +revisions on the board as well, but the final revision will not function +without this change. + +Signed-off-by: Michael Krufky +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/video/saa7134/saa7134-cards.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/media/video/saa7134/saa7134-cards.c ++++ b/drivers/media/video/saa7134/saa7134-cards.c +@@ -3373,6 +3373,7 @@ struct saa7134_board saa7134_boards[] = + .tuner_config = 3, + .mpeg = SAA7134_MPEG_DVB, + .ts_type = SAA7134_MPEG_TS_SERIAL, ++ .ts_force_val = 1, + .gpiomask = 0x0800100, /* GPIO 21 is an INPUT */ + .inputs = {{ + .name = name_tv, -- 2.47.3