mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-07-27 14:28:05 +00:00
linux-ti33x-psp 3.2: update to 3.2.23
Regenerate all beaglebone patches and add one vfs tracer patch for powertop Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
This commit is contained in:
committed by
Denys Dmytriyenko
parent
751040122d
commit
9bc77dff5f
+298
@@ -0,0 +1,298 @@
|
||||
From e02d361ade75d22d28ce36460954b4bc6439fc74 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Tue, 12 Jun 2012 15:24:40 +0200
|
||||
Subject: [PATCH 01/49] splice: fix racy pipe->buffers uses
|
||||
|
||||
commit 047fe3605235888f3ebcda0c728cb31937eadfe6 upstream.
|
||||
|
||||
Dave Jones reported a kernel BUG at mm/slub.c:3474! triggered
|
||||
by splice_shrink_spd() called from vmsplice_to_pipe()
|
||||
|
||||
commit 35f3d14dbbc5 (pipe: add support for shrinking and growing pipes)
|
||||
added capability to adjust pipe->buffers.
|
||||
|
||||
Problem is some paths don't hold pipe mutex and assume pipe->buffers
|
||||
doesn't change for their duration.
|
||||
|
||||
Fix this by adding nr_pages_max field in struct splice_pipe_desc, and
|
||||
use it in place of pipe->buffers where appropriate.
|
||||
|
||||
splice_shrink_spd() loses its struct pipe_inode_info argument.
|
||||
|
||||
Reported-by: Dave Jones <davej@redhat.com>
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Cc: Jens Axboe <axboe@kernel.dk>
|
||||
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
|
||||
Cc: Tom Herbert <therbert@google.com>
|
||||
Tested-by: Dave Jones <davej@redhat.com>
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
[bwh: Backported to 3.2:
|
||||
- Adjust context in vmsplice_to_pipe()
|
||||
- Update one more call to splice_shrink_spd(), from skb_splice_bits()]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/splice.c | 35 ++++++++++++++++++++---------------
|
||||
include/linux/splice.h | 8 ++++----
|
||||
kernel/relay.c | 5 +++--
|
||||
kernel/trace/trace.c | 6 ++++--
|
||||
mm/shmem.c | 3 ++-
|
||||
net/core/skbuff.c | 3 ++-
|
||||
6 files changed, 35 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/fs/splice.c b/fs/splice.c
|
||||
index 6d0dfb8..014fcb4 100644
|
||||
--- a/fs/splice.c
|
||||
+++ b/fs/splice.c
|
||||
@@ -274,13 +274,16 @@ void spd_release_page(struct splice_pipe_desc *spd, unsigned int i)
|
||||
* Check if we need to grow the arrays holding pages and partial page
|
||||
* descriptions.
|
||||
*/
|
||||
-int splice_grow_spd(struct pipe_inode_info *pipe, struct splice_pipe_desc *spd)
|
||||
+int splice_grow_spd(const struct pipe_inode_info *pipe, struct splice_pipe_desc *spd)
|
||||
{
|
||||
- if (pipe->buffers <= PIPE_DEF_BUFFERS)
|
||||
+ unsigned int buffers = ACCESS_ONCE(pipe->buffers);
|
||||
+
|
||||
+ spd->nr_pages_max = buffers;
|
||||
+ if (buffers <= PIPE_DEF_BUFFERS)
|
||||
return 0;
|
||||
|
||||
- spd->pages = kmalloc(pipe->buffers * sizeof(struct page *), GFP_KERNEL);
|
||||
- spd->partial = kmalloc(pipe->buffers * sizeof(struct partial_page), GFP_KERNEL);
|
||||
+ spd->pages = kmalloc(buffers * sizeof(struct page *), GFP_KERNEL);
|
||||
+ spd->partial = kmalloc(buffers * sizeof(struct partial_page), GFP_KERNEL);
|
||||
|
||||
if (spd->pages && spd->partial)
|
||||
return 0;
|
||||
@@ -290,10 +293,9 @@ int splice_grow_spd(struct pipe_inode_info *pipe, struct splice_pipe_desc *spd)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-void splice_shrink_spd(struct pipe_inode_info *pipe,
|
||||
- struct splice_pipe_desc *spd)
|
||||
+void splice_shrink_spd(struct splice_pipe_desc *spd)
|
||||
{
|
||||
- if (pipe->buffers <= PIPE_DEF_BUFFERS)
|
||||
+ if (spd->nr_pages_max <= PIPE_DEF_BUFFERS)
|
||||
return;
|
||||
|
||||
kfree(spd->pages);
|
||||
@@ -316,6 +318,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
|
||||
struct splice_pipe_desc spd = {
|
||||
.pages = pages,
|
||||
.partial = partial,
|
||||
+ .nr_pages_max = PIPE_DEF_BUFFERS,
|
||||
.flags = flags,
|
||||
.ops = &page_cache_pipe_buf_ops,
|
||||
.spd_release = spd_release_page,
|
||||
@@ -327,7 +330,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
|
||||
index = *ppos >> PAGE_CACHE_SHIFT;
|
||||
loff = *ppos & ~PAGE_CACHE_MASK;
|
||||
req_pages = (len + loff + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
|
||||
- nr_pages = min(req_pages, pipe->buffers);
|
||||
+ nr_pages = min(req_pages, spd.nr_pages_max);
|
||||
|
||||
/*
|
||||
* Lookup the (hopefully) full range of pages we need.
|
||||
@@ -498,7 +501,7 @@ fill_it:
|
||||
if (spd.nr_pages)
|
||||
error = splice_to_pipe(pipe, &spd);
|
||||
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
+ splice_shrink_spd(&spd);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -599,6 +602,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
|
||||
struct splice_pipe_desc spd = {
|
||||
.pages = pages,
|
||||
.partial = partial,
|
||||
+ .nr_pages_max = PIPE_DEF_BUFFERS,
|
||||
.flags = flags,
|
||||
.ops = &default_pipe_buf_ops,
|
||||
.spd_release = spd_release_page,
|
||||
@@ -609,8 +613,8 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
|
||||
|
||||
res = -ENOMEM;
|
||||
vec = __vec;
|
||||
- if (pipe->buffers > PIPE_DEF_BUFFERS) {
|
||||
- vec = kmalloc(pipe->buffers * sizeof(struct iovec), GFP_KERNEL);
|
||||
+ if (spd.nr_pages_max > PIPE_DEF_BUFFERS) {
|
||||
+ vec = kmalloc(spd.nr_pages_max * sizeof(struct iovec), GFP_KERNEL);
|
||||
if (!vec)
|
||||
goto shrink_ret;
|
||||
}
|
||||
@@ -618,7 +622,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
|
||||
offset = *ppos & ~PAGE_CACHE_MASK;
|
||||
nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
|
||||
|
||||
- for (i = 0; i < nr_pages && i < pipe->buffers && len; i++) {
|
||||
+ for (i = 0; i < nr_pages && i < spd.nr_pages_max && len; i++) {
|
||||
struct page *page;
|
||||
|
||||
page = alloc_page(GFP_USER);
|
||||
@@ -666,7 +670,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
|
||||
shrink_ret:
|
||||
if (vec != __vec)
|
||||
kfree(vec);
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
+ splice_shrink_spd(&spd);
|
||||
return res;
|
||||
|
||||
err:
|
||||
@@ -1616,6 +1620,7 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,
|
||||
struct splice_pipe_desc spd = {
|
||||
.pages = pages,
|
||||
.partial = partial,
|
||||
+ .nr_pages_max = PIPE_DEF_BUFFERS,
|
||||
.flags = flags,
|
||||
.ops = &user_page_pipe_buf_ops,
|
||||
.spd_release = spd_release_page,
|
||||
@@ -1631,13 +1636,13 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,
|
||||
|
||||
spd.nr_pages = get_iovec_page_array(iov, nr_segs, spd.pages,
|
||||
spd.partial, flags & SPLICE_F_GIFT,
|
||||
- pipe->buffers);
|
||||
+ spd.nr_pages_max);
|
||||
if (spd.nr_pages <= 0)
|
||||
ret = spd.nr_pages;
|
||||
else
|
||||
ret = splice_to_pipe(pipe, &spd);
|
||||
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
+ splice_shrink_spd(&spd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/include/linux/splice.h b/include/linux/splice.h
|
||||
index 26e5b61..09a545a 100644
|
||||
--- a/include/linux/splice.h
|
||||
+++ b/include/linux/splice.h
|
||||
@@ -51,7 +51,8 @@ struct partial_page {
|
||||
struct splice_pipe_desc {
|
||||
struct page **pages; /* page map */
|
||||
struct partial_page *partial; /* pages[] may not be contig */
|
||||
- int nr_pages; /* number of pages in map */
|
||||
+ int nr_pages; /* number of populated pages in map */
|
||||
+ unsigned int nr_pages_max; /* pages[] & partial[] arrays size */
|
||||
unsigned int flags; /* splice flags */
|
||||
const struct pipe_buf_operations *ops;/* ops associated with output pipe */
|
||||
void (*spd_release)(struct splice_pipe_desc *, unsigned int);
|
||||
@@ -85,9 +86,8 @@ extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
|
||||
/*
|
||||
* for dynamic pipe sizing
|
||||
*/
|
||||
-extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *);
|
||||
-extern void splice_shrink_spd(struct pipe_inode_info *,
|
||||
- struct splice_pipe_desc *);
|
||||
+extern int splice_grow_spd(const struct pipe_inode_info *, struct splice_pipe_desc *);
|
||||
+extern void splice_shrink_spd(struct splice_pipe_desc *);
|
||||
extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
|
||||
|
||||
extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
|
||||
diff --git a/kernel/relay.c b/kernel/relay.c
|
||||
index b6f803a..a535fc9 100644
|
||||
--- a/kernel/relay.c
|
||||
+++ b/kernel/relay.c
|
||||
@@ -1235,6 +1235,7 @@ static ssize_t subbuf_splice_actor(struct file *in,
|
||||
struct splice_pipe_desc spd = {
|
||||
.pages = pages,
|
||||
.nr_pages = 0,
|
||||
+ .nr_pages_max = PIPE_DEF_BUFFERS,
|
||||
.partial = partial,
|
||||
.flags = flags,
|
||||
.ops = &relay_pipe_buf_ops,
|
||||
@@ -1302,8 +1303,8 @@ static ssize_t subbuf_splice_actor(struct file *in,
|
||||
ret += padding;
|
||||
|
||||
out:
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
- return ret;
|
||||
+ splice_shrink_spd(&spd);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static ssize_t relay_file_splice_read(struct file *in,
|
||||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
|
||||
index 697e49d..7e4edd3 100644
|
||||
--- a/kernel/trace/trace.c
|
||||
+++ b/kernel/trace/trace.c
|
||||
@@ -3456,6 +3456,7 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
|
||||
.pages = pages_def,
|
||||
.partial = partial_def,
|
||||
.nr_pages = 0, /* This gets updated below. */
|
||||
+ .nr_pages_max = PIPE_DEF_BUFFERS,
|
||||
.flags = flags,
|
||||
.ops = &tracing_pipe_buf_ops,
|
||||
.spd_release = tracing_spd_release_pipe,
|
||||
@@ -3527,7 +3528,7 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
|
||||
|
||||
ret = splice_to_pipe(pipe, &spd);
|
||||
out:
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
+ splice_shrink_spd(&spd);
|
||||
return ret;
|
||||
|
||||
out_err:
|
||||
@@ -4017,6 +4018,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
|
||||
struct splice_pipe_desc spd = {
|
||||
.pages = pages_def,
|
||||
.partial = partial_def,
|
||||
+ .nr_pages_max = PIPE_DEF_BUFFERS,
|
||||
.flags = flags,
|
||||
.ops = &buffer_pipe_buf_ops,
|
||||
.spd_release = buffer_spd_release,
|
||||
@@ -4104,7 +4106,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
|
||||
}
|
||||
|
||||
ret = splice_to_pipe(pipe, &spd);
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
+ splice_shrink_spd(&spd);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
diff --git a/mm/shmem.c b/mm/shmem.c
|
||||
index 6c253f7..7a82174 100644
|
||||
--- a/mm/shmem.c
|
||||
+++ b/mm/shmem.c
|
||||
@@ -1359,6 +1359,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
|
||||
struct splice_pipe_desc spd = {
|
||||
.pages = pages,
|
||||
.partial = partial,
|
||||
+ .nr_pages_max = PIPE_DEF_BUFFERS,
|
||||
.flags = flags,
|
||||
.ops = &page_cache_pipe_buf_ops,
|
||||
.spd_release = spd_release_page,
|
||||
@@ -1447,7 +1448,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
|
||||
if (spd.nr_pages)
|
||||
error = splice_to_pipe(pipe, &spd);
|
||||
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
+ splice_shrink_spd(&spd);
|
||||
|
||||
if (error > 0) {
|
||||
*ppos += error;
|
||||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
|
||||
index 2ec200de..af9c3c6 100644
|
||||
--- a/net/core/skbuff.c
|
||||
+++ b/net/core/skbuff.c
|
||||
@@ -1663,6 +1663,7 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
|
||||
struct splice_pipe_desc spd = {
|
||||
.pages = pages,
|
||||
.partial = partial,
|
||||
+ .nr_pages_max = MAX_SKB_FRAGS,
|
||||
.flags = flags,
|
||||
.ops = &sock_pipe_buf_ops,
|
||||
.spd_release = sock_spd_release,
|
||||
@@ -1709,7 +1710,7 @@ done:
|
||||
lock_sock(sk);
|
||||
}
|
||||
|
||||
- splice_shrink_spd(pipe, &spd);
|
||||
+ splice_shrink_spd(&spd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
From fd0fcfd8f28824587f180ccde95c03fca533ab05 Mon Sep 17 00:00:00 2001
|
||||
From: Tao Guo <glorioustao@gmail.com>
|
||||
Date: Wed, 13 Jun 2012 21:17:21 +0200
|
||||
Subject: [PATCH 02/49] umem: fix up unplugging
|
||||
|
||||
commit 32587371ad3db2f9d335de10dbd8cffd4fff5669 upstream.
|
||||
|
||||
Fix a regression introduced by 7eaceaccab5f40 ("block: remove per-queue
|
||||
plugging"). In that patch, Jens removed the whole mm_unplug_device()
|
||||
function, which used to be the trigger to make umem start to work.
|
||||
|
||||
We need to implement unplugging to make umem start to work, or I/O will
|
||||
never be triggered.
|
||||
|
||||
Signed-off-by: Tao Guo <Tao.Guo@emc.com>
|
||||
Cc: Neil Brown <neilb@suse.de>
|
||||
Cc: Jens Axboe <axboe@kernel.dk>
|
||||
Cc: Shaohua Li <shli@kernel.org>
|
||||
Acked-by: NeilBrown <neilb@suse.de>
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/block/umem.c | 40 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 40 insertions(+)
|
||||
|
||||
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
|
||||
index aa27120..9a72277 100644
|
||||
--- a/drivers/block/umem.c
|
||||
+++ b/drivers/block/umem.c
|
||||
@@ -513,6 +513,44 @@ static void process_page(unsigned long data)
|
||||
}
|
||||
}
|
||||
|
||||
+struct mm_plug_cb {
|
||||
+ struct blk_plug_cb cb;
|
||||
+ struct cardinfo *card;
|
||||
+};
|
||||
+
|
||||
+static void mm_unplug(struct blk_plug_cb *cb)
|
||||
+{
|
||||
+ struct mm_plug_cb *mmcb = container_of(cb, struct mm_plug_cb, cb);
|
||||
+
|
||||
+ spin_lock_irq(&mmcb->card->lock);
|
||||
+ activate(mmcb->card);
|
||||
+ spin_unlock_irq(&mmcb->card->lock);
|
||||
+ kfree(mmcb);
|
||||
+}
|
||||
+
|
||||
+static int mm_check_plugged(struct cardinfo *card)
|
||||
+{
|
||||
+ struct blk_plug *plug = current->plug;
|
||||
+ struct mm_plug_cb *mmcb;
|
||||
+
|
||||
+ if (!plug)
|
||||
+ return 0;
|
||||
+
|
||||
+ list_for_each_entry(mmcb, &plug->cb_list, cb.list) {
|
||||
+ if (mmcb->cb.callback == mm_unplug && mmcb->card == card)
|
||||
+ return 1;
|
||||
+ }
|
||||
+ /* Not currently on the callback list */
|
||||
+ mmcb = kmalloc(sizeof(*mmcb), GFP_ATOMIC);
|
||||
+ if (!mmcb)
|
||||
+ return 0;
|
||||
+
|
||||
+ mmcb->card = card;
|
||||
+ mmcb->cb.callback = mm_unplug;
|
||||
+ list_add(&mmcb->cb.list, &plug->cb_list);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
static void mm_make_request(struct request_queue *q, struct bio *bio)
|
||||
{
|
||||
struct cardinfo *card = q->queuedata;
|
||||
@@ -523,6 +561,8 @@ static void mm_make_request(struct request_queue *q, struct bio *bio)
|
||||
*card->biotail = bio;
|
||||
bio->bi_next = NULL;
|
||||
card->biotail = &bio->bi_next;
|
||||
+ if (bio->bi_rw & REQ_SYNC || !mm_check_plugged(card))
|
||||
+ activate(card);
|
||||
spin_unlock_irq(&card->lock);
|
||||
|
||||
return;
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
From 8c92af27a522bcec5dc2ced7b49b8f3f57492b21 Mon Sep 17 00:00:00 2001
|
||||
From: Stone Piao <piaoyun@marvell.com>
|
||||
Date: Wed, 20 Jun 2012 20:21:10 -0700
|
||||
Subject: [PATCH 03/49] mwifiex: fix 11n rx packet drop issue
|
||||
|
||||
commit 925839243dc9aa4ef25305f5afd10ed18258a4ac upstream.
|
||||
|
||||
Currently we check the sequence number of last packet received
|
||||
against start_win. If a sequence hole is detected, start_win is
|
||||
updated to next sequence number.
|
||||
|
||||
Since the rx sequence number is initialized to 0, a corner case
|
||||
exists when BA setup happens immediately after association. As
|
||||
0 is a valid sequence number, start_win gets increased to 1
|
||||
incorrectly. This causes the first packet with sequence number 0
|
||||
being dropped.
|
||||
|
||||
Initialize rx sequence number as 0xffff and skip adjusting
|
||||
start_win if the sequence number remains 0xffff. The sequence
|
||||
number will be updated once the first packet is received.
|
||||
|
||||
Signed-off-by: Stone Piao <piaoyun@marvell.com>
|
||||
Signed-off-by: Avinash Patil <patila@marvell.com>
|
||||
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
|
||||
Signed-off-by: Bing Zhao <bzhao@marvell.com>
|
||||
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/wireless/mwifiex/11n_rxreorder.c | 5 +++--
|
||||
drivers/net/wireless/mwifiex/11n_rxreorder.h | 7 +++++++
|
||||
drivers/net/wireless/mwifiex/wmm.c | 2 ++
|
||||
3 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
|
||||
index 7aa9aa0..39fd4d5 100644
|
||||
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
|
||||
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
|
||||
@@ -267,7 +267,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
|
||||
else
|
||||
last_seq = priv->rx_seq[tid];
|
||||
|
||||
- if (last_seq >= new_node->start_win)
|
||||
+ if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM &&
|
||||
+ last_seq >= new_node->start_win)
|
||||
new_node->start_win = last_seq + 1;
|
||||
|
||||
new_node->win_size = win_size;
|
||||
@@ -611,5 +612,5 @@ void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv)
|
||||
spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags);
|
||||
|
||||
INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr);
|
||||
- memset(priv->rx_seq, 0, sizeof(priv->rx_seq));
|
||||
+ mwifiex_reset_11n_rx_seq_num(priv);
|
||||
}
|
||||
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.h b/drivers/net/wireless/mwifiex/11n_rxreorder.h
|
||||
index 033c8ad..7128baa 100644
|
||||
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.h
|
||||
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.h
|
||||
@@ -37,6 +37,13 @@
|
||||
|
||||
#define ADDBA_RSP_STATUS_ACCEPT 0
|
||||
|
||||
+#define MWIFIEX_DEF_11N_RX_SEQ_NUM 0xffff
|
||||
+
|
||||
+static inline void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv)
|
||||
+{
|
||||
+ memset(priv->rx_seq, 0xff, sizeof(priv->rx_seq));
|
||||
+}
|
||||
+
|
||||
int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *,
|
||||
u16 seqNum,
|
||||
u16 tid, u8 *ta,
|
||||
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
|
||||
index 6c239c3..b94a349 100644
|
||||
--- a/drivers/net/wireless/mwifiex/wmm.c
|
||||
+++ b/drivers/net/wireless/mwifiex/wmm.c
|
||||
@@ -406,6 +406,8 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter)
|
||||
priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE;
|
||||
priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE;
|
||||
|
||||
+ mwifiex_reset_11n_rx_seq_num(priv);
|
||||
+
|
||||
atomic_set(&priv->wmm.tx_pkts_queued, 0);
|
||||
atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID);
|
||||
}
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
From ea7217bde3c1bbcb215d3b67a4308399ac1d574c Mon Sep 17 00:00:00 2001
|
||||
From: Stone Piao <piaoyun@marvell.com>
|
||||
Date: Wed, 20 Jun 2012 20:21:11 -0700
|
||||
Subject: [PATCH 04/49] mwifiex: fix WPS eapol handshake failure
|
||||
|
||||
commit f03ba7e9a24e5e9efaad56bd1713b994ea556b16 upstream.
|
||||
|
||||
After association, STA will go through eapol handshake with WPS
|
||||
enabled AP. It's observed that WPS handshake fails with some 11n
|
||||
AP. The reason for the failure is that the eapol packet is sent
|
||||
via 11n frame aggregation.
|
||||
|
||||
The eapol packet should be sent directly without 11n aggregation.
|
||||
|
||||
This patch fixes the problem by adding WPS session control while
|
||||
dequeuing Tx packets for transmission.
|
||||
|
||||
Signed-off-by: Stone Piao <piaoyun@marvell.com>
|
||||
Signed-off-by: Avinash Patil <patila@marvell.com>
|
||||
Signed-off-by: Bing Zhao <bzhao@marvell.com>
|
||||
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||
[bwh: Backported to 3.2: reformat the if-statement per earlier
|
||||
upstream commit c65a30f35f938b421ac67c34a9e70b0e49e6019a]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/wireless/mwifiex/wmm.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
|
||||
index b94a349..06fcf1e 100644
|
||||
--- a/drivers/net/wireless/mwifiex/wmm.c
|
||||
+++ b/drivers/net/wireless/mwifiex/wmm.c
|
||||
@@ -1211,10 +1211,12 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if (!ptr->is_11n_enabled || mwifiex_is_ba_stream_setup(priv, ptr, tid)
|
||||
- || ((priv->sec_info.wpa_enabled
|
||||
- || priv->sec_info.wpa2_enabled) && !priv->wpa_is_gtk_set)
|
||||
- ) {
|
||||
+ if (!ptr->is_11n_enabled ||
|
||||
+ mwifiex_is_ba_stream_setup(priv, ptr, tid) ||
|
||||
+ priv->wps.session_enable ||
|
||||
+ ((priv->sec_info.wpa_enabled ||
|
||||
+ priv->sec_info.wpa2_enabled) &&
|
||||
+ !priv->wpa_is_gtk_set)) {
|
||||
mwifiex_send_single_packet(priv, ptr, ptr_index, flags);
|
||||
/* ra_list_spinlock has been freed in
|
||||
mwifiex_send_single_packet() */
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
From e7d858dec1d8cf3c283019ff51adae14b8be9388 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Rosenberg <dan.j.rosenberg@gmail.com>
|
||||
Date: Mon, 25 Jun 2012 16:05:27 +0200
|
||||
Subject: [PATCH 05/49] NFC: Prevent multiple buffer overflows in NCI
|
||||
|
||||
commit 67de956ff5dc1d4f321e16cfbd63f5be3b691b43 upstream.
|
||||
|
||||
Fix multiple remotely-exploitable stack-based buffer overflows due to
|
||||
the NCI code pulling length fields directly from incoming frames and
|
||||
copying too much data into statically-sized arrays.
|
||||
|
||||
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
|
||||
Cc: security@kernel.org
|
||||
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
|
||||
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
|
||||
Cc: Samuel Ortiz <sameo@linux.intel.com>
|
||||
Cc: David S. Miller <davem@davemloft.net>
|
||||
Acked-by: Ilan Elias <ilane@ti.com>
|
||||
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
|
||||
[bwh: Backported to 3.2:
|
||||
- Drop changes to parsing of tech B and tech F parameters
|
||||
- Various renaming]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/nfc/nci/ntf.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
|
||||
index 96633f5..12b6a80 100644
|
||||
--- a/net/nfc/nci/ntf.c
|
||||
+++ b/net/nfc/nci/ntf.c
|
||||
@@ -86,7 +86,7 @@ static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev,
|
||||
nfca_poll->sens_res = __le16_to_cpu(*((__u16 *)data));
|
||||
data += 2;
|
||||
|
||||
- nfca_poll->nfcid1_len = *data++;
|
||||
+ nfca_poll->nfcid1_len = min_t(__u8, *data++, sizeof(nfca_poll->nfcid1));
|
||||
|
||||
nfc_dbg("sens_res 0x%x, nfcid1_len %d",
|
||||
nfca_poll->sens_res,
|
||||
@@ -111,7 +111,7 @@ static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev,
|
||||
|
||||
switch (ntf->rf_interface_type) {
|
||||
case NCI_RF_INTERFACE_ISO_DEP:
|
||||
- nfca_poll_iso_dep->rats_res_len = *data++;
|
||||
+ nfca_poll_iso_dep->rats_res_len = min_t(__u8, *data++, 20);
|
||||
if (nfca_poll_iso_dep->rats_res_len > 0) {
|
||||
memcpy(nfca_poll_iso_dep->rats_res,
|
||||
data,
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
From 11f5e090b288e9e933c8b7790626db9a5beef760 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@openwrt.org>
|
||||
Date: Sat, 23 Jun 2012 19:23:31 +0200
|
||||
Subject: [PATCH 06/49] ath9k: fix dynamic WEP related regression
|
||||
|
||||
commit bed3d9c0b71f9afbfec905cb6db3b9f16be29d4d upstream.
|
||||
|
||||
commit 7a532fe7131216a02c81a6c1b1f8632da1195a58
|
||||
ath9k_hw: fix interpretation of the rx KeyMiss flag
|
||||
|
||||
This commit used the rx key miss indication to detect packets that were
|
||||
passed from the hardware without being decrypted, however it seems that
|
||||
this bit is not only undefined in the static WEP case, but also for
|
||||
dynamically allocated WEP keys. This caused a regression when using
|
||||
WEP-LEAP.
|
||||
|
||||
This patch fixes the regression by keeping track of which key indexes
|
||||
refer to CCMP keys and only using the key miss indication for those.
|
||||
|
||||
Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
|
||||
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
||||
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/wireless/ath/ath.h | 1 +
|
||||
drivers/net/wireless/ath/ath9k/recv.c | 3 ++-
|
||||
drivers/net/wireless/ath/key.c | 4 ++++
|
||||
3 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
|
||||
index 0f9ee46..4cc4a8b 100644
|
||||
--- a/drivers/net/wireless/ath/ath.h
|
||||
+++ b/drivers/net/wireless/ath/ath.h
|
||||
@@ -143,6 +143,7 @@ struct ath_common {
|
||||
u32 keymax;
|
||||
DECLARE_BITMAP(keymap, ATH_KEYMAX);
|
||||
DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX);
|
||||
+ DECLARE_BITMAP(ccmp_keymap, ATH_KEYMAX);
|
||||
enum ath_crypt_caps crypt_caps;
|
||||
|
||||
unsigned int clockrate;
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
|
||||
index 2f3aeac..e6d791c 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/recv.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/recv.c
|
||||
@@ -829,7 +829,8 @@ static bool ath9k_rx_accept(struct ath_common *common,
|
||||
* descriptor does contain a valid key index. This has been observed
|
||||
* mostly with CCMP encryption.
|
||||
*/
|
||||
- if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID)
|
||||
+ if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID ||
|
||||
+ !test_bit(rx_stats->rs_keyix, common->ccmp_keymap))
|
||||
rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
|
||||
|
||||
if (!rx_stats->rs_datalen)
|
||||
diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
|
||||
index 4cf7c5e..1ec3fa5 100644
|
||||
--- a/drivers/net/wireless/ath/key.c
|
||||
+++ b/drivers/net/wireless/ath/key.c
|
||||
@@ -556,6 +556,9 @@ int ath_key_config(struct ath_common *common,
|
||||
return -EIO;
|
||||
|
||||
set_bit(idx, common->keymap);
|
||||
+ if (key->cipher == WLAN_CIPHER_SUITE_CCMP)
|
||||
+ set_bit(idx, common->ccmp_keymap);
|
||||
+
|
||||
if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
|
||||
set_bit(idx + 64, common->keymap);
|
||||
set_bit(idx, common->tkip_keymap);
|
||||
@@ -582,6 +585,7 @@ void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
|
||||
return;
|
||||
|
||||
clear_bit(key->hw_key_idx, common->keymap);
|
||||
+ clear_bit(key->hw_key_idx, common->ccmp_keymap);
|
||||
if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
|
||||
return;
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
From fd1f8dc4e31b8daeec0cb785256de7297a06e300 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Tue, 12 Jun 2012 00:47:58 +0200
|
||||
Subject: [PATCH 07/49] NFC: Return from rawsock_release when sk is NULL
|
||||
|
||||
commit 03e934f620101ca2cfc9383bd76172dd3e1f8567 upstream.
|
||||
|
||||
Sasha Levin reported following panic :
|
||||
|
||||
[ 2136.383310] BUG: unable to handle kernel NULL pointer dereference at
|
||||
00000000000003b0
|
||||
[ 2136.384022] IP: [<ffffffff8114e400>] __lock_acquire+0xc0/0x4b0
|
||||
[ 2136.384022] PGD 131c4067 PUD 11c0c067 PMD 0
|
||||
[ 2136.388106] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
|
||||
[ 2136.388106] CPU 1
|
||||
[ 2136.388106] Pid: 24855, comm: trinity-child1 Tainted: G W
|
||||
3.5.0-rc2-sasha-00015-g7b268f7 #374
|
||||
[ 2136.388106] RIP: 0010:[<ffffffff8114e400>] [<ffffffff8114e400>]
|
||||
__lock_acquire+0xc0/0x4b0
|
||||
[ 2136.388106] RSP: 0018:ffff8800130b3ca8 EFLAGS: 00010046
|
||||
[ 2136.388106] RAX: 0000000000000086 RBX: ffff88001186b000 RCX:
|
||||
0000000000000000
|
||||
[ 2136.388106] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
|
||||
0000000000000000
|
||||
[ 2136.388106] RBP: ffff8800130b3d08 R08: 0000000000000001 R09:
|
||||
0000000000000000
|
||||
[ 2136.388106] R10: 0000000000000000 R11: 0000000000000001 R12:
|
||||
0000000000000002
|
||||
[ 2136.388106] R13: 00000000000003b0 R14: 0000000000000000 R15:
|
||||
0000000000000000
|
||||
[ 2136.388106] FS: 00007fa5b1bd4700(0000) GS:ffff88001b800000(0000)
|
||||
knlGS:0000000000000000
|
||||
[ 2136.388106] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
|
||||
[ 2136.388106] CR2: 00000000000003b0 CR3: 0000000011d1f000 CR4:
|
||||
00000000000406e0
|
||||
[ 2136.388106] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
|
||||
0000000000000000
|
||||
[ 2136.388106] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
|
||||
0000000000000400
|
||||
[ 2136.388106] Process trinity-child1 (pid: 24855, threadinfo
|
||||
ffff8800130b2000, task ffff88001186b000)
|
||||
[ 2136.388106] Stack:
|
||||
[ 2136.388106] ffff8800130b3cd8 ffffffff81121785 ffffffff81236774
|
||||
000080d000000001
|
||||
[ 2136.388106] ffff88001b9d6c00 00000000001d6c00 ffffffff130b3d08
|
||||
ffff88001186b000
|
||||
[ 2136.388106] 0000000000000000 0000000000000002 0000000000000000
|
||||
0000000000000000
|
||||
[ 2136.388106] Call Trace:
|
||||
[ 2136.388106] [<ffffffff81121785>] ? sched_clock_local+0x25/0x90
|
||||
[ 2136.388106] [<ffffffff81236774>] ? get_empty_filp+0x74/0x220
|
||||
[ 2136.388106] [<ffffffff8114e97a>] lock_acquire+0x18a/0x1e0
|
||||
[ 2136.388106] [<ffffffff836b37df>] ? rawsock_release+0x4f/0xa0
|
||||
[ 2136.388106] [<ffffffff837c0ef0>] _raw_write_lock_bh+0x40/0x80
|
||||
[ 2136.388106] [<ffffffff836b37df>] ? rawsock_release+0x4f/0xa0
|
||||
[ 2136.388106] [<ffffffff836b37df>] rawsock_release+0x4f/0xa0
|
||||
[ 2136.388106] [<ffffffff8321cfe8>] sock_release+0x18/0x70
|
||||
[ 2136.388106] [<ffffffff8321d069>] sock_close+0x29/0x30
|
||||
[ 2136.388106] [<ffffffff81236bca>] __fput+0x11a/0x2c0
|
||||
[ 2136.388106] [<ffffffff81236d85>] fput+0x15/0x20
|
||||
[ 2136.388106] [<ffffffff8321de34>] sys_accept4+0x1b4/0x200
|
||||
[ 2136.388106] [<ffffffff837c165c>] ? _raw_spin_unlock_irq+0x4c/0x80
|
||||
[ 2136.388106] [<ffffffff837c1669>] ? _raw_spin_unlock_irq+0x59/0x80
|
||||
[ 2136.388106] [<ffffffff837c2565>] ? sysret_check+0x22/0x5d
|
||||
[ 2136.388106] [<ffffffff8321de8b>] sys_accept+0xb/0x10
|
||||
[ 2136.388106] [<ffffffff837c2539>] system_call_fastpath+0x16/0x1b
|
||||
[ 2136.388106] Code: ec 04 00 0f 85 ea 03 00 00 be d5 0b 00 00 48 c7 c7
|
||||
8a c1 40 84 e8 b1 a5 f8 ff 31 c0 e9 d4 03 00 00 66 2e 0f 1f 84 00 00 00
|
||||
00 00 <49> 81 7d 00 60 73 5e 85 b8 01 00 00 00 44 0f 44 e0 83 fe 01 77
|
||||
[ 2136.388106] RIP [<ffffffff8114e400>] __lock_acquire+0xc0/0x4b0
|
||||
[ 2136.388106] RSP <ffff8800130b3ca8>
|
||||
[ 2136.388106] CR2: 00000000000003b0
|
||||
[ 2136.388106] ---[ end trace 6d450e935ee18982 ]---
|
||||
[ 2136.388106] Kernel panic - not syncing: Fatal exception in interrupt
|
||||
|
||||
rawsock_release() should test if sock->sk is NULL before calling
|
||||
sock_orphan()/sock_put()
|
||||
|
||||
Reported-by: Sasha Levin <levinsasha928@gmail.com>
|
||||
Tested-by: Sasha Levin <levinsasha928@gmail.com>
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
|
||||
[bwh: Backported to 3.2: keep using nfc_dbg(), not pr_debug()]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/nfc/rawsock.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
|
||||
index ee7b2b3..7a167fc 100644
|
||||
--- a/net/nfc/rawsock.c
|
||||
+++ b/net/nfc/rawsock.c
|
||||
@@ -52,7 +52,10 @@ static int rawsock_release(struct socket *sock)
|
||||
{
|
||||
struct sock *sk = sock->sk;
|
||||
|
||||
- nfc_dbg("sock=%p", sock);
|
||||
+ nfc_dbg("sock=%p sk=%p", sock, sk);
|
||||
+
|
||||
+ if (!sk)
|
||||
+ return 0;
|
||||
|
||||
sock_orphan(sk);
|
||||
sock_put(sk);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
From a771eb7b20c60a73ec422943dd387fbca27cf94d Mon Sep 17 00:00:00 2001
|
||||
From: Larry Finger <Larry.Finger@lwfinger.net>
|
||||
Date: Mon, 25 Jun 2012 18:01:12 -0500
|
||||
Subject: [PATCH 08/49] rtlwifi: rtl8192cu: New USB IDs
|
||||
|
||||
commit f63d7dabd5da9ef41f28f6d69b29bc084db0ca5a upstream.
|
||||
|
||||
The latest Realtek driver for the RTL8188CU and RTL8192CU chips adds three
|
||||
new USB IDs.
|
||||
|
||||
Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
|
||||
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
|
||||
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
|
||||
index 94a3e17..0302148 100644
|
||||
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
|
||||
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
|
||||
@@ -311,9 +311,11 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
|
||||
{RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
|
||||
{RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
|
||||
{RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/
|
||||
+ {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
|
||||
{RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
|
||||
{RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
|
||||
{RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
|
||||
+ {RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/
|
||||
/* HP - Lite-On ,8188CUS Slim Combo */
|
||||
{RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)},
|
||||
{RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */
|
||||
@@ -355,6 +357,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
|
||||
{RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
|
||||
{RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/
|
||||
{RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
|
||||
+ {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/
|
||||
{RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/
|
||||
{RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/
|
||||
{RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
From f65b74252f667d75391a86a6dee82aefb0e9b983 Mon Sep 17 00:00:00 2001
|
||||
From: Panayiotis Karabassis <panayk@gmail.com>
|
||||
Date: Tue, 26 Jun 2012 23:37:17 +0300
|
||||
Subject: [PATCH 09/49] ath9k: enable serialize_regmode for non-PCIE AR9287
|
||||
|
||||
commit 7508b657967cf664b5aa0f6367d05016e7e3bc2a upstream.
|
||||
|
||||
https://bugzilla.kernel.org/show_bug.cgi?id=42903
|
||||
|
||||
Based on the work of <fynivx@gmail.com>
|
||||
|
||||
Signed-off-by: Panayiotis Karabassis <panayk@gmail.com>
|
||||
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/hw.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
index 6973620..7f97164 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -557,7 +557,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
|
||||
|
||||
if (ah->config.serialize_regmode == SER_REG_MODE_AUTO) {
|
||||
if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCI ||
|
||||
- ((AR_SREV_9160(ah) || AR_SREV_9280(ah)) &&
|
||||
+ ((AR_SREV_9160(ah) || AR_SREV_9280(ah) || AR_SREV_9287(ah)) &&
|
||||
!ah->is_pciexpress)) {
|
||||
ah->config.serialize_regmode =
|
||||
SER_REG_MODE_ON;
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
From 21cdc703702f7ffbf440dc29b68044ac13363078 Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 27 Jun 2012 15:38:56 +0200
|
||||
Subject: [PATCH 10/49] mac80211: correct behaviour on unrecognised action
|
||||
frames
|
||||
|
||||
commit 4b5ebccc40843104d980f0714bc86bfcd5568941 upstream.
|
||||
|
||||
When receiving an "individually addressed" action frame, the
|
||||
receiver is required to return it to the sender. mac80211
|
||||
gets this wrong as it also returns group addressed (mcast)
|
||||
frames to the sender. Fix this and update the reference to
|
||||
the new 802.11 standards version since things were shuffled
|
||||
around significantly.
|
||||
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/mac80211/rx.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
|
||||
index 064d20f..cda4875 100644
|
||||
--- a/net/mac80211/rx.c
|
||||
+++ b/net/mac80211/rx.c
|
||||
@@ -2389,7 +2389,7 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
|
||||
* frames that we didn't handle, including returning unknown
|
||||
* ones. For all other modes we will return them to the sender,
|
||||
* setting the 0x80 bit in the action category, as required by
|
||||
- * 802.11-2007 7.3.1.11.
|
||||
+ * 802.11-2012 9.24.4.
|
||||
* Newer versions of hostapd shall also use the management frame
|
||||
* registration mechanisms, but older ones still use cooked
|
||||
* monitor interfaces so push all frames there.
|
||||
@@ -2399,6 +2399,9 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
|
||||
sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
|
||||
return RX_DROP_MONITOR;
|
||||
|
||||
+ if (is_multicast_ether_addr(mgmt->da))
|
||||
+ return RX_DROP_MONITOR;
|
||||
+
|
||||
/* do not return rejected action frames */
|
||||
if (mgmt->u.action.category & 0x80)
|
||||
return RX_DROP_UNUSABLE;
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
From 8ba42ffb182648185f9f5f924d26cf97b6be721f Mon Sep 17 00:00:00 2001
|
||||
From: "Hebbar, Gururaja" <gururaja.hebbar@ti.com>
|
||||
Date: Tue, 26 Jun 2012 19:25:11 +0530
|
||||
Subject: [PATCH 11/49] ASoC: tlv320aic3x: Fix codec pll configure bug
|
||||
|
||||
commit c9fe573a6584034670c1a55ee8162d623519cbbf upstream.
|
||||
|
||||
In sound/soc/codecs/tlv320aic3x.c
|
||||
|
||||
data = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
|
||||
snd_soc_write(codec, AIC3X_PLL_PROGA_REG,
|
||||
data | (pll_p << PLLP_SHIFT));
|
||||
|
||||
In the above code, pll-p value is OR'ed with previous value without
|
||||
clearing it. Bug is not seen if pll-p value doesn't change across
|
||||
Sampling frequency.
|
||||
|
||||
However on some platforms (like AM335x EVM-SK), pll-p may have different
|
||||
values across different sampling frequencies. In such case, above code
|
||||
configures the pll with a wrong value.
|
||||
Because of this bug, when a audio stream is played with pll value
|
||||
different from previous stream, audio is heard as differently(like its
|
||||
stretched).
|
||||
|
||||
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
|
||||
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
sound/soc/codecs/tlv320aic3x.c | 4 +---
|
||||
sound/soc/codecs/tlv320aic3x.h | 1 +
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
|
||||
index d0dbac1..cdb473c 100644
|
||||
--- a/sound/soc/codecs/tlv320aic3x.c
|
||||
+++ b/sound/soc/codecs/tlv320aic3x.c
|
||||
@@ -963,9 +963,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
|
||||
}
|
||||
|
||||
found:
|
||||
- data = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
|
||||
- snd_soc_write(codec, AIC3X_PLL_PROGA_REG,
|
||||
- data | (pll_p << PLLP_SHIFT));
|
||||
+ snd_soc_update_bits(codec, AIC3X_PLL_PROGA_REG, PLLP_MASK, pll_p);
|
||||
snd_soc_write(codec, AIC3X_OVRF_STATUS_AND_PLLR_REG,
|
||||
pll_r << PLLR_SHIFT);
|
||||
snd_soc_write(codec, AIC3X_PLL_PROGB_REG, pll_j << PLLJ_SHIFT);
|
||||
diff --git a/sound/soc/codecs/tlv320aic3x.h b/sound/soc/codecs/tlv320aic3x.h
|
||||
index 06a1978..16d9999 100644
|
||||
--- a/sound/soc/codecs/tlv320aic3x.h
|
||||
+++ b/sound/soc/codecs/tlv320aic3x.h
|
||||
@@ -166,6 +166,7 @@
|
||||
|
||||
/* PLL registers bitfields */
|
||||
#define PLLP_SHIFT 0
|
||||
+#define PLLP_MASK 7
|
||||
#define PLLQ_SHIFT 3
|
||||
#define PLLR_SHIFT 0
|
||||
#define PLLJ_SHIFT 2
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
From 6d7506b0391c86ac347dce94f2c4642ce126cf45 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Thu, 28 Jun 2012 19:28:57 +0000
|
||||
Subject: [PATCH 12/49] powerpc/xmon: Use cpumask iterator to avoid warning
|
||||
|
||||
commit bc1d7702910c7c7e88eb60b58429dbfe293683ce upstream.
|
||||
|
||||
We have a bug report where the kernel hits a warning in the cpumask
|
||||
code:
|
||||
|
||||
WARNING: at include/linux/cpumask.h:107
|
||||
|
||||
Which is:
|
||||
WARN_ON_ONCE(cpu >= nr_cpumask_bits);
|
||||
|
||||
The backtrace is:
|
||||
cpu_cmd
|
||||
cmds
|
||||
xmon_core
|
||||
xmon
|
||||
die
|
||||
|
||||
xmon is iterating through 0 to NR_CPUS. I'm not sure why we are still
|
||||
open coding this but iterating above nr_cpu_ids is definitely a bug.
|
||||
|
||||
This patch iterates through all possible cpus, in case we issue a
|
||||
system reset and CPUs in an offline state call in.
|
||||
|
||||
Perhaps the old code was trying to handle CPUs that were in the
|
||||
partition but were never started (eg kexec into a kernel with an
|
||||
nr_cpus= boot option). They are going to die way before we get into
|
||||
xmon since we haven't set any kernel state up for them.
|
||||
|
||||
Signed-off-by: Anton Blanchard <anton@samba.org>
|
||||
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
arch/powerpc/xmon/xmon.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
|
||||
index 03a217a..b7e63d8 100644
|
||||
--- a/arch/powerpc/xmon/xmon.c
|
||||
+++ b/arch/powerpc/xmon/xmon.c
|
||||
@@ -975,7 +975,7 @@ static int cpu_cmd(void)
|
||||
/* print cpus waiting or in xmon */
|
||||
printf("cpus stopped:");
|
||||
count = 0;
|
||||
- for (cpu = 0; cpu < NR_CPUS; ++cpu) {
|
||||
+ for_each_possible_cpu(cpu) {
|
||||
if (cpumask_test_cpu(cpu, &cpus_in_xmon)) {
|
||||
if (count == 0)
|
||||
printf(" %x", cpu);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
From af803001738a2e5609dbbe767f8f7a61bef3cf9c Mon Sep 17 00:00:00 2001
|
||||
From: Michael Neuling <mikey@neuling.org>
|
||||
Date: Mon, 25 Jun 2012 13:33:11 +0000
|
||||
Subject: [PATCH 13/49] powerpc/kvm: sldi should be sld
|
||||
|
||||
commit 2f584a146a2965b82fce89b8d2f95dc5cfe468d0 upstream.
|
||||
|
||||
Since we are taking a registers, this should never have been an sldi.
|
||||
Talking to paulus offline, this is the correct fix.
|
||||
|
||||
Was introduced by:
|
||||
commit 19ccb76a1938ab364a412253daec64613acbf3df
|
||||
Author: Paul Mackerras <paulus@samba.org>
|
||||
Date: Sat Jul 23 17:42:46 2011 +1000
|
||||
|
||||
Talking to paulus, this shouldn't be a literal.
|
||||
|
||||
Signed-off-by: Michael Neuling <mikey@neuling.org>
|
||||
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
|
||||
index 44d8829..5e8dc08 100644
|
||||
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
|
||||
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
|
||||
@@ -763,7 +763,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201)
|
||||
lwz r3,VCORE_NAPPING_THREADS(r5)
|
||||
lwz r4,VCPU_PTID(r9)
|
||||
li r0,1
|
||||
- sldi r0,r0,r4
|
||||
+ sld r0,r0,r4
|
||||
andc. r3,r3,r0 /* no sense IPI'ing ourselves */
|
||||
beq 43f
|
||||
mulli r4,r4,PACA_SIZE /* get paca for thread 0 */
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
From 8002ce8e1b7a0ef6b60567ed63ed12fe6780b98a Mon Sep 17 00:00:00 2001
|
||||
From: NeilBrown <neilb@suse.de>
|
||||
Date: Tue, 3 Jul 2012 10:37:30 +1000
|
||||
Subject: [PATCH 14/49] md/raid10: Don't try to recovery unmatched (and
|
||||
unused) chunks.
|
||||
|
||||
commit fc448a18ae6219af9a73257b1fbcd009efab4a81 upstream.
|
||||
|
||||
If a RAID10 has an odd number of chunks - as might happen when there
|
||||
are an odd number of devices - the last chunk has no pair and so is
|
||||
not mirrored. We don't store data there, but when recovering the last
|
||||
device in an array we retry to recover that last chunk from a
|
||||
non-existent location. This results in an error, and the recovery
|
||||
aborts.
|
||||
|
||||
When we get to that last chunk we should just stop - there is nothing
|
||||
more to do anyway.
|
||||
|
||||
This bug has been present since the introduction of RAID10, so the
|
||||
patch is appropriate for any -stable kernel.
|
||||
|
||||
Reported-by: Christian Balzer <chibi@gol.com>
|
||||
Tested-by: Christian Balzer <chibi@gol.com>
|
||||
Signed-off-by: NeilBrown <neilb@suse.de>
|
||||
[bwh: Backported to 3.2: adjust context]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/md/raid10.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
|
||||
index b219449..3b67566 100644
|
||||
--- a/drivers/md/raid10.c
|
||||
+++ b/drivers/md/raid10.c
|
||||
@@ -2436,6 +2436,12 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
|
||||
/* want to reconstruct this device */
|
||||
rb2 = r10_bio;
|
||||
sect = raid10_find_virt(conf, sector_nr, i);
|
||||
+ if (sect >= mddev->resync_max_sectors) {
|
||||
+ /* last stripe is not complete - don't
|
||||
+ * try to recover this sector.
|
||||
+ */
|
||||
+ continue;
|
||||
+ }
|
||||
/* Unless we are doing a full sync, we only need
|
||||
* to recover the block if it is set in the bitmap
|
||||
*/
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
From 2afec61845b4c0bed64c257a0acc2612e1862885 Mon Sep 17 00:00:00 2001
|
||||
From: majianpeng <majianpeng@gmail.com>
|
||||
Date: Tue, 12 Jun 2012 08:31:10 +0800
|
||||
Subject: [PATCH 15/49] md/raid5: Do not add data_offset before call to
|
||||
is_badblock
|
||||
|
||||
commit 6c0544e255dd6582a9899572e120fb55d9f672a4 upstream.
|
||||
|
||||
In chunk_aligned_read() we are adding data_offset before calling
|
||||
is_badblock. But is_badblock also adds data_offset, so that is bad.
|
||||
|
||||
So move the addition of data_offset to after the call to
|
||||
is_badblock.
|
||||
|
||||
This bug was introduced by commit 31c176ecdf3563140e639
|
||||
md/raid5: avoid reading from known bad blocks.
|
||||
which first appeared in 3.0. So that patch is suitable for any
|
||||
-stable kernel from 3.0.y onwards. However it will need minor
|
||||
revision for most of those (as the comment didn't appear until
|
||||
recently).
|
||||
|
||||
Signed-off-by: majianpeng <majianpeng@gmail.com>
|
||||
Signed-off-by: NeilBrown <neilb@suse.de>
|
||||
[bwh: Backported to 3.2: ignored missing comment]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/md/raid5.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
|
||||
index 858fdbb..d423c7e 100644
|
||||
--- a/drivers/md/raid5.c
|
||||
+++ b/drivers/md/raid5.c
|
||||
@@ -3621,7 +3621,6 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio)
|
||||
raid_bio->bi_next = (void*)rdev;
|
||||
align_bi->bi_bdev = rdev->bdev;
|
||||
align_bi->bi_flags &= ~(1 << BIO_SEG_VALID);
|
||||
- align_bi->bi_sector += rdev->data_offset;
|
||||
|
||||
if (!bio_fits_rdev(align_bi) ||
|
||||
is_badblock(rdev, align_bi->bi_sector, align_bi->bi_size>>9,
|
||||
@@ -3632,6 +3631,9 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ /* No reshape active, so we can trust rdev->data_offset */
|
||||
+ align_bi->bi_sector += rdev->data_offset;
|
||||
+
|
||||
spin_lock_irq(&conf->device_lock);
|
||||
wait_event_lock_irq(conf->wait_for_stripe,
|
||||
conf->quiesce == 0,
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
From 1e6a8f24c1ff905a8bae6dd5222bc128eb60f886 Mon Sep 17 00:00:00 2001
|
||||
From: majianpeng <majianpeng@gmail.com>
|
||||
Date: Tue, 3 Jul 2012 12:11:54 +1000
|
||||
Subject: [PATCH 16/49] md/raid5: In ops_run_io, inc nr_pending before calling
|
||||
md_wait_for_blocked_rdev
|
||||
|
||||
commit 1850753d2e6d9ca7856581ca5d3cf09521e6a5d7 upstream.
|
||||
|
||||
In ops_run_io(), the call to md_wait_for_blocked_rdev will decrement
|
||||
nr_pending so we lose the reference we hold on the rdev.
|
||||
So atomic_inc it first to maintain the reference.
|
||||
|
||||
This bug was introduced by commit 73e92e51b7969ef5477d
|
||||
md/raid5. Don't write to known bad block on doubtful devices.
|
||||
|
||||
which appeared in 3.0, so patch is suitable for stable kernels since
|
||||
then.
|
||||
|
||||
Signed-off-by: majianpeng <majianpeng@gmail.com>
|
||||
Signed-off-by: NeilBrown <neilb@suse.de>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/md/raid5.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
|
||||
index d423c7e..6ba4954 100644
|
||||
--- a/drivers/md/raid5.c
|
||||
+++ b/drivers/md/raid5.c
|
||||
@@ -542,6 +542,12 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
|
||||
* a chance*/
|
||||
md_check_recovery(conf->mddev);
|
||||
}
|
||||
+ /*
|
||||
+ * Because md_wait_for_blocked_rdev
|
||||
+ * will dec nr_pending, we must
|
||||
+ * increment it first.
|
||||
+ */
|
||||
+ atomic_inc(&rdev->nr_pending);
|
||||
md_wait_for_blocked_rdev(rdev, conf->mddev);
|
||||
} else {
|
||||
/* Acknowledged bad block - skip the write */
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
From 4c1df6ee8b798576a23b25ab391cd7f3b5835bcd Mon Sep 17 00:00:00 2001
|
||||
From: NeilBrown <neilb@suse.de>
|
||||
Date: Tue, 3 Jul 2012 15:55:33 +1000
|
||||
Subject: [PATCH 17/49] md/raid10: fix failure when trying to repair a read
|
||||
error.
|
||||
|
||||
commit 055d3747dbf00ce85c6872ecca4d466638e80c22 upstream.
|
||||
|
||||
commit 58c54fcca3bac5bf9290cfed31c76e4c4bfbabaf
|
||||
md/raid10: handle further errors during fix_read_error better.
|
||||
|
||||
in 3.1 added "r10_sync_page_io" which takes an IO size in sectors.
|
||||
But we were passing the IO size in bytes!!!
|
||||
This resulting in bio_add_page failing, and empty request being sent
|
||||
down, and a consequent BUG_ON in scsi_lib.
|
||||
|
||||
[fix missing space in error message at same time]
|
||||
|
||||
This fix is suitable for 3.1.y and later.
|
||||
|
||||
Reported-by: Christian Balzer <chibi@gol.com>
|
||||
Signed-off-by: NeilBrown <neilb@suse.de>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/md/raid10.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
|
||||
index 3b67566..7a9eef6 100644
|
||||
--- a/drivers/md/raid10.c
|
||||
+++ b/drivers/md/raid10.c
|
||||
@@ -1919,7 +1919,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
|
||||
if (r10_sync_page_io(rdev,
|
||||
r10_bio->devs[sl].addr +
|
||||
sect,
|
||||
- s<<9, conf->tmppage, WRITE)
|
||||
+ s, conf->tmppage, WRITE)
|
||||
== 0) {
|
||||
/* Well, this device is dead */
|
||||
printk(KERN_NOTICE
|
||||
@@ -1956,7 +1956,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
|
||||
switch (r10_sync_page_io(rdev,
|
||||
r10_bio->devs[sl].addr +
|
||||
sect,
|
||||
- s<<9, conf->tmppage,
|
||||
+ s, conf->tmppage,
|
||||
READ)) {
|
||||
case 0:
|
||||
/* Well, this device is dead */
|
||||
@@ -2119,7 +2119,7 @@ read_more:
|
||||
rdev = conf->mirrors[mirror].rdev;
|
||||
printk_ratelimited(
|
||||
KERN_ERR
|
||||
- "md/raid10:%s: %s: redirecting"
|
||||
+ "md/raid10:%s: %s: redirecting "
|
||||
"sector %llu to another mirror\n",
|
||||
mdname(mddev),
|
||||
bdevname(rdev->bdev, b),
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
From 3426f0a75320d87b4fd5a63263ff4f1a7574fd90 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Date: Sun, 1 Jul 2012 17:09:42 +0200
|
||||
Subject: [PATCH 18/49] drm/i915: kick any firmware framebuffers before
|
||||
claiming the gtt
|
||||
|
||||
commit 9f846a16d213523fbe6daea17e20df6b8ac5a1e5 upstream.
|
||||
|
||||
Especially vesafb likes to map everything as uc- (yikes), and if that
|
||||
mapping hangs around still while we try to map the gtt as wc the
|
||||
kernel will downgrade our request to uc-, resulting in abyssal
|
||||
performance.
|
||||
|
||||
Unfortunately we can't do this as early as readon does (i.e. as the
|
||||
first thing we do when initializing the hw) because our fb/mmio space
|
||||
region moves around on a per-gen basis. So I've had to move it below
|
||||
the gtt initialization, but that seems to work, too. The important
|
||||
thing is that we do this before we set up the gtt wc mapping.
|
||||
|
||||
Now an altogether different question is why people compile their
|
||||
kernels with vesafb enabled, but I guess making things just work isn't
|
||||
bad per se ...
|
||||
|
||||
v2:
|
||||
- s/radeondrmfb/inteldrmfb/
|
||||
- fix up error handling
|
||||
|
||||
v3: Kill #ifdef X86, this is Intel after all. Noticed by Ben Widawsky.
|
||||
|
||||
v4: Jani Nikula complained about the pointless bool primary
|
||||
initialization.
|
||||
|
||||
v5: Don't oops if we can't allocate, noticed by Chris Wilson.
|
||||
|
||||
v6: Resolve conflicts with agp rework and fixup whitespace.
|
||||
|
||||
This is commit e188719a2891f01b3100d in drm-next.
|
||||
|
||||
Backport to 3.5 -fixes queue requested by Dave Airlie - due to grub
|
||||
using vesa on fedora their initrd seems to load vesafb before loading
|
||||
the real kms driver. So tons more people actually experience a
|
||||
dead-slow gpu. Hence also the Cc: stable.
|
||||
|
||||
Reported-and-tested-by: "Kilarski, Bernard R" <bernard.r.kilarski@intel.com>
|
||||
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||
[bwh: Backported to 3.2: adjust context]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/gpu/drm/i915/i915_dma.c | 37 ++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 30 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
|
||||
index c4da951..ca67338 100644
|
||||
--- a/drivers/gpu/drm/i915/i915_dma.c
|
||||
+++ b/drivers/gpu/drm/i915/i915_dma.c
|
||||
@@ -1890,6 +1890,27 @@ ips_ping_for_i915_load(void)
|
||||
}
|
||||
}
|
||||
|
||||
+static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
|
||||
+{
|
||||
+ struct apertures_struct *ap;
|
||||
+ struct pci_dev *pdev = dev_priv->dev->pdev;
|
||||
+ bool primary;
|
||||
+
|
||||
+ ap = alloc_apertures(1);
|
||||
+ if (!ap)
|
||||
+ return;
|
||||
+
|
||||
+ ap->ranges[0].base = dev_priv->dev->agp->base;
|
||||
+ ap->ranges[0].size =
|
||||
+ dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
|
||||
+ primary =
|
||||
+ pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
|
||||
+
|
||||
+ remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
|
||||
+
|
||||
+ kfree(ap);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* i915_driver_load - setup chip and create an initial config
|
||||
* @dev: DRM device
|
||||
@@ -1927,6 +1948,15 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
goto free_priv;
|
||||
}
|
||||
|
||||
+ dev_priv->mm.gtt = intel_gtt_get();
|
||||
+ if (!dev_priv->mm.gtt) {
|
||||
+ DRM_ERROR("Failed to initialize GTT\n");
|
||||
+ ret = -ENODEV;
|
||||
+ goto put_bridge;
|
||||
+ }
|
||||
+
|
||||
+ i915_kick_out_firmware_fb(dev_priv);
|
||||
+
|
||||
/* overlay on gen2 is broken and can't address above 1G */
|
||||
if (IS_GEN2(dev))
|
||||
dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(30));
|
||||
@@ -1950,13 +1980,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
goto put_bridge;
|
||||
}
|
||||
|
||||
- dev_priv->mm.gtt = intel_gtt_get();
|
||||
- if (!dev_priv->mm.gtt) {
|
||||
- DRM_ERROR("Failed to initialize GTT\n");
|
||||
- ret = -ENODEV;
|
||||
- goto out_rmmap;
|
||||
- }
|
||||
-
|
||||
agp_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
|
||||
|
||||
dev_priv->mm.gtt_mapping =
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
From 97bbf28874e2f7467c0d05db53041e556488087a Mon Sep 17 00:00:00 2001
|
||||
From: Mike Snitzer <snitzer@redhat.com>
|
||||
Date: Tue, 3 Jul 2012 12:55:33 +0100
|
||||
Subject: [PATCH 19/49] dm persistent data: fix shadow_info_leak on
|
||||
dm_tm_destroy
|
||||
|
||||
commit 25d7cd6faa7ae6ed2565617c3ee2500ccb8a9f7f upstream.
|
||||
|
||||
Cleanup the shadow table before destroying the transaction manager.
|
||||
|
||||
Reference: leak was identified with kmemleak when running
|
||||
test_discard_random_sectors in the thinp-test-suite.
|
||||
|
||||
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
|
||||
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/md/persistent-data/dm-transaction-manager.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c
|
||||
index 6f8d387..e5902d1 100644
|
||||
--- a/drivers/md/persistent-data/dm-transaction-manager.c
|
||||
+++ b/drivers/md/persistent-data/dm-transaction-manager.c
|
||||
@@ -138,6 +138,9 @@ EXPORT_SYMBOL_GPL(dm_tm_create_non_blocking_clone);
|
||||
|
||||
void dm_tm_destroy(struct dm_transaction_manager *tm)
|
||||
{
|
||||
+ if (!tm->is_clone)
|
||||
+ wipe_shadow_table(tm);
|
||||
+
|
||||
kfree(tm);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dm_tm_destroy);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
From 5ac62b535b410eb5bfbb5457703fd42f5b517088 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Snitzer <snitzer@redhat.com>
|
||||
Date: Tue, 3 Jul 2012 12:55:35 +0100
|
||||
Subject: [PATCH 20/49] dm persistent data: handle space map checker creation
|
||||
failure
|
||||
|
||||
commit 62662303e7f590fdfbb0070ab820a0ad4267c119 upstream.
|
||||
|
||||
If CONFIG_DM_DEBUG_SPACE_MAPS is enabled and dm_sm_checker_create()
|
||||
fails, dm_tm_create_internal() would still return success even though it
|
||||
cleaned up all resources it was supposed to have created. This will
|
||||
lead to a kernel crash:
|
||||
|
||||
general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
|
||||
...
|
||||
RIP: 0010:[<ffffffff81593659>] [<ffffffff81593659>] dm_bufio_get_block_size+0x9/0x20
|
||||
Call Trace:
|
||||
[<ffffffff81599bae>] dm_bm_block_size+0xe/0x10
|
||||
[<ffffffff8159b8b8>] sm_ll_init+0x78/0xd0
|
||||
[<ffffffff8159c1a6>] sm_ll_new_disk+0x16/0xa0
|
||||
[<ffffffff8159c98e>] dm_sm_disk_create+0xfe/0x160
|
||||
[<ffffffff815abf6e>] dm_pool_metadata_open+0x16e/0x6a0
|
||||
[<ffffffff815aa010>] pool_ctr+0x3f0/0x900
|
||||
[<ffffffff8158d565>] dm_table_add_target+0x195/0x450
|
||||
[<ffffffff815904c4>] table_load+0xe4/0x330
|
||||
[<ffffffff815917ea>] ctl_ioctl+0x15a/0x2c0
|
||||
[<ffffffff81591963>] dm_ctl_ioctl+0x13/0x20
|
||||
[<ffffffff8116a4f8>] do_vfs_ioctl+0x98/0x560
|
||||
[<ffffffff8116aa51>] sys_ioctl+0x91/0xa0
|
||||
[<ffffffff81869f52>] system_call_fastpath+0x16/0x1b
|
||||
|
||||
Fix the space map checker code to return an appropriate ERR_PTR and have
|
||||
dm_sm_disk_create() and dm_tm_create_internal() check for it with
|
||||
IS_ERR.
|
||||
|
||||
Reported-by: Vivek Goyal <vgoyal@redhat.com>
|
||||
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
|
||||
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/md/persistent-data/dm-space-map-checker.c | 24 ++++++++++----------
|
||||
drivers/md/persistent-data/dm-space-map-disk.c | 11 ++++++++-
|
||||
.../md/persistent-data/dm-transaction-manager.c | 8 +++++--
|
||||
3 files changed, 28 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/drivers/md/persistent-data/dm-space-map-checker.c b/drivers/md/persistent-data/dm-space-map-checker.c
|
||||
index 50ed53b..6d7c832 100644
|
||||
--- a/drivers/md/persistent-data/dm-space-map-checker.c
|
||||
+++ b/drivers/md/persistent-data/dm-space-map-checker.c
|
||||
@@ -343,25 +343,25 @@ struct dm_space_map *dm_sm_checker_create(struct dm_space_map *sm)
|
||||
int r;
|
||||
struct sm_checker *smc;
|
||||
|
||||
- if (!sm)
|
||||
- return NULL;
|
||||
+ if (IS_ERR_OR_NULL(sm))
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
|
||||
smc = kmalloc(sizeof(*smc), GFP_KERNEL);
|
||||
if (!smc)
|
||||
- return NULL;
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
|
||||
memcpy(&smc->sm, &ops_, sizeof(smc->sm));
|
||||
r = ca_create(&smc->old_counts, sm);
|
||||
if (r) {
|
||||
kfree(smc);
|
||||
- return NULL;
|
||||
+ return ERR_PTR(r);
|
||||
}
|
||||
|
||||
r = ca_create(&smc->counts, sm);
|
||||
if (r) {
|
||||
ca_destroy(&smc->old_counts);
|
||||
kfree(smc);
|
||||
- return NULL;
|
||||
+ return ERR_PTR(r);
|
||||
}
|
||||
|
||||
smc->real_sm = sm;
|
||||
@@ -371,7 +371,7 @@ struct dm_space_map *dm_sm_checker_create(struct dm_space_map *sm)
|
||||
ca_destroy(&smc->counts);
|
||||
ca_destroy(&smc->old_counts);
|
||||
kfree(smc);
|
||||
- return NULL;
|
||||
+ return ERR_PTR(r);
|
||||
}
|
||||
|
||||
r = ca_commit(&smc->old_counts, &smc->counts);
|
||||
@@ -379,7 +379,7 @@ struct dm_space_map *dm_sm_checker_create(struct dm_space_map *sm)
|
||||
ca_destroy(&smc->counts);
|
||||
ca_destroy(&smc->old_counts);
|
||||
kfree(smc);
|
||||
- return NULL;
|
||||
+ return ERR_PTR(r);
|
||||
}
|
||||
|
||||
return &smc->sm;
|
||||
@@ -391,25 +391,25 @@ struct dm_space_map *dm_sm_checker_create_fresh(struct dm_space_map *sm)
|
||||
int r;
|
||||
struct sm_checker *smc;
|
||||
|
||||
- if (!sm)
|
||||
- return NULL;
|
||||
+ if (IS_ERR_OR_NULL(sm))
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
|
||||
smc = kmalloc(sizeof(*smc), GFP_KERNEL);
|
||||
if (!smc)
|
||||
- return NULL;
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
|
||||
memcpy(&smc->sm, &ops_, sizeof(smc->sm));
|
||||
r = ca_create(&smc->old_counts, sm);
|
||||
if (r) {
|
||||
kfree(smc);
|
||||
- return NULL;
|
||||
+ return ERR_PTR(r);
|
||||
}
|
||||
|
||||
r = ca_create(&smc->counts, sm);
|
||||
if (r) {
|
||||
ca_destroy(&smc->old_counts);
|
||||
kfree(smc);
|
||||
- return NULL;
|
||||
+ return ERR_PTR(r);
|
||||
}
|
||||
|
||||
smc->real_sm = sm;
|
||||
diff --git a/drivers/md/persistent-data/dm-space-map-disk.c b/drivers/md/persistent-data/dm-space-map-disk.c
|
||||
index fc469ba..3d0ed53 100644
|
||||
--- a/drivers/md/persistent-data/dm-space-map-disk.c
|
||||
+++ b/drivers/md/persistent-data/dm-space-map-disk.c
|
||||
@@ -290,7 +290,16 @@ struct dm_space_map *dm_sm_disk_create(struct dm_transaction_manager *tm,
|
||||
dm_block_t nr_blocks)
|
||||
{
|
||||
struct dm_space_map *sm = dm_sm_disk_create_real(tm, nr_blocks);
|
||||
- return dm_sm_checker_create_fresh(sm);
|
||||
+ struct dm_space_map *smc;
|
||||
+
|
||||
+ if (IS_ERR_OR_NULL(sm))
|
||||
+ return sm;
|
||||
+
|
||||
+ smc = dm_sm_checker_create_fresh(sm);
|
||||
+ if (IS_ERR(smc))
|
||||
+ dm_sm_destroy(sm);
|
||||
+
|
||||
+ return smc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dm_sm_disk_create);
|
||||
|
||||
diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c
|
||||
index e5902d1..ba54aac 100644
|
||||
--- a/drivers/md/persistent-data/dm-transaction-manager.c
|
||||
+++ b/drivers/md/persistent-data/dm-transaction-manager.c
|
||||
@@ -345,8 +345,10 @@ static int dm_tm_create_internal(struct dm_block_manager *bm,
|
||||
}
|
||||
|
||||
*sm = dm_sm_checker_create(inner);
|
||||
- if (!*sm)
|
||||
+ if (IS_ERR(*sm)) {
|
||||
+ r = PTR_ERR(*sm);
|
||||
goto bad2;
|
||||
+ }
|
||||
|
||||
} else {
|
||||
r = dm_bm_write_lock(dm_tm_get_bm(*tm), sb_location,
|
||||
@@ -365,8 +367,10 @@ static int dm_tm_create_internal(struct dm_block_manager *bm,
|
||||
}
|
||||
|
||||
*sm = dm_sm_checker_create(inner);
|
||||
- if (!*sm)
|
||||
+ if (IS_ERR(*sm)) {
|
||||
+ r = PTR_ERR(*sm);
|
||||
goto bad2;
|
||||
+ }
|
||||
}
|
||||
|
||||
return 0;
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
From d93e7e98bbff07495ac95fd10c02c2e0d5392079 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Snitzer <snitzer@redhat.com>
|
||||
Date: Tue, 3 Jul 2012 12:55:37 +0100
|
||||
Subject: [PATCH 21/49] dm persistent data: fix allocation failure in space
|
||||
map checker init
|
||||
|
||||
commit b0239faaf87c38bb419c9264bf20817438ddc3a9 upstream.
|
||||
|
||||
If CONFIG_DM_DEBUG_SPACE_MAPS is enabled and memory is fragmented and a
|
||||
sufficiently-large metadata device is used in a thin pool then the space
|
||||
map checker will fail to allocate the memory it requires.
|
||||
|
||||
Switch from kmalloc to vmalloc to allow larger virtually contiguous
|
||||
allocations for the space map checker's internal count arrays.
|
||||
|
||||
Reported-by: Vivek Goyal <vgoyal@redhat.com>
|
||||
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
|
||||
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/md/persistent-data/dm-space-map-checker.c | 30 +++++++++++++--------
|
||||
1 file changed, 19 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/drivers/md/persistent-data/dm-space-map-checker.c b/drivers/md/persistent-data/dm-space-map-checker.c
|
||||
index 6d7c832..fc90c11 100644
|
||||
--- a/drivers/md/persistent-data/dm-space-map-checker.c
|
||||
+++ b/drivers/md/persistent-data/dm-space-map-checker.c
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <linux/device-mapper.h>
|
||||
#include <linux/export.h>
|
||||
+#include <linux/vmalloc.h>
|
||||
|
||||
#ifdef CONFIG_DM_DEBUG_SPACE_MAPS
|
||||
|
||||
@@ -89,13 +90,23 @@ static int ca_create(struct count_array *ca, struct dm_space_map *sm)
|
||||
|
||||
ca->nr = nr_blocks;
|
||||
ca->nr_free = nr_blocks;
|
||||
- ca->counts = kzalloc(sizeof(*ca->counts) * nr_blocks, GFP_KERNEL);
|
||||
- if (!ca->counts)
|
||||
- return -ENOMEM;
|
||||
+
|
||||
+ if (!nr_blocks)
|
||||
+ ca->counts = NULL;
|
||||
+ else {
|
||||
+ ca->counts = vzalloc(sizeof(*ca->counts) * nr_blocks);
|
||||
+ if (!ca->counts)
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void ca_destroy(struct count_array *ca)
|
||||
+{
|
||||
+ vfree(ca->counts);
|
||||
+}
|
||||
+
|
||||
static int ca_load(struct count_array *ca, struct dm_space_map *sm)
|
||||
{
|
||||
int r;
|
||||
@@ -126,12 +137,14 @@ static int ca_load(struct count_array *ca, struct dm_space_map *sm)
|
||||
static int ca_extend(struct count_array *ca, dm_block_t extra_blocks)
|
||||
{
|
||||
dm_block_t nr_blocks = ca->nr + extra_blocks;
|
||||
- uint32_t *counts = kzalloc(sizeof(*counts) * nr_blocks, GFP_KERNEL);
|
||||
+ uint32_t *counts = vzalloc(sizeof(*counts) * nr_blocks);
|
||||
if (!counts)
|
||||
return -ENOMEM;
|
||||
|
||||
- memcpy(counts, ca->counts, sizeof(*counts) * ca->nr);
|
||||
- kfree(ca->counts);
|
||||
+ if (ca->counts) {
|
||||
+ memcpy(counts, ca->counts, sizeof(*counts) * ca->nr);
|
||||
+ ca_destroy(ca);
|
||||
+ }
|
||||
ca->nr = nr_blocks;
|
||||
ca->nr_free += extra_blocks;
|
||||
ca->counts = counts;
|
||||
@@ -151,11 +164,6 @@ static int ca_commit(struct count_array *old, struct count_array *new)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void ca_destroy(struct count_array *ca)
|
||||
-{
|
||||
- kfree(ca->counts);
|
||||
-}
|
||||
-
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
struct sm_checker {
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
From 6411ef218c12f6719597631d388f2b13945a5251 Mon Sep 17 00:00:00 2001
|
||||
From: Takashi Iwai <tiwai@suse.de>
|
||||
Date: Tue, 26 Jun 2012 17:35:10 +0200
|
||||
Subject: [PATCH 22/49] ALSA: hda - Fix power-map regression for HP dv6 & co
|
||||
|
||||
commit 6e1c39c6b00d9141a82c231ba7c5e5b1716974b2 upstream.
|
||||
|
||||
The recent fix for power-map controls (commit b0791dda813) caused
|
||||
regressions on some other HP laptops. They have fixed pins but these
|
||||
pins are exposed as jack-detectable. Thus the driver tries to control
|
||||
the power-map dynamically per jack detection where it never gets on.
|
||||
|
||||
This patch adds the check of connection and it assumes the no jack
|
||||
detection is available for fixed pins no matter what pin capability
|
||||
says.
|
||||
|
||||
BugLink: http://bugs.launchpad.net/bugs/1013183
|
||||
Reported-by: Luis Henriques <luis.henriques@canonical.com>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
sound/pci/hda/patch_sigmatel.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
|
||||
index 7b7a516..2b973f5 100644
|
||||
--- a/sound/pci/hda/patch_sigmatel.c
|
||||
+++ b/sound/pci/hda/patch_sigmatel.c
|
||||
@@ -4457,7 +4457,7 @@ static int stac92xx_init(struct hda_codec *codec)
|
||||
AC_PINCTL_IN_EN);
|
||||
for (i = 0; i < spec->num_pwrs; i++) {
|
||||
hda_nid_t nid = spec->pwr_nids[i];
|
||||
- int pinctl, def_conf;
|
||||
+ unsigned int pinctl, def_conf;
|
||||
|
||||
/* power on when no jack detection is available */
|
||||
/* or when the VREF is used for controlling LED */
|
||||
@@ -4484,7 +4484,7 @@ static int stac92xx_init(struct hda_codec *codec)
|
||||
def_conf = get_defcfg_connect(def_conf);
|
||||
/* skip any ports that don't have jacks since presence
|
||||
* detection is useless */
|
||||
- if (def_conf != AC_JACK_PORT_NONE &&
|
||||
+ if (def_conf != AC_JACK_PORT_COMPLEX ||
|
||||
!is_jack_detectable(codec, nid)) {
|
||||
stac_toggle_power_map(codec, nid, 1);
|
||||
continue;
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
From 04098d77869c04c5bf703846783cb89b4297b2bb Mon Sep 17 00:00:00 2001
|
||||
From: Vaibhav Nagarnaik <vnagarnaik@google.com>
|
||||
Date: Thu, 3 May 2012 18:59:52 -0700
|
||||
Subject: [PATCH 23/49] tracing: change CPU ring buffer state from
|
||||
tracing_cpumask
|
||||
|
||||
commit 71babb2705e2203a64c27ede13ae3508a0d2c16c upstream.
|
||||
|
||||
According to Documentation/trace/ftrace.txt:
|
||||
|
||||
tracing_cpumask:
|
||||
|
||||
This is a mask that lets the user only trace
|
||||
on specified CPUS. The format is a hex string
|
||||
representing the CPUS.
|
||||
|
||||
The tracing_cpumask currently doesn't affect the tracing state of
|
||||
per-CPU ring buffers.
|
||||
|
||||
This patch enables/disables CPU recording as its corresponding bit in
|
||||
tracing_cpumask is set/unset.
|
||||
|
||||
Link: http://lkml.kernel.org/r/1336096792-25373-3-git-send-email-vnagarnaik@google.com
|
||||
|
||||
Cc: Frederic Weisbecker <fweisbec@gmail.com>
|
||||
Cc: Ingo Molnar <mingo@redhat.com>
|
||||
Cc: Laurent Chavey <chavey@google.com>
|
||||
Cc: Justin Teravest <teravest@google.com>
|
||||
Cc: David Sharp <dhsharp@google.com>
|
||||
Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
|
||||
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
kernel/trace/trace.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
|
||||
index 7e4edd3..5638104 100644
|
||||
--- a/kernel/trace/trace.c
|
||||
+++ b/kernel/trace/trace.c
|
||||
@@ -2541,10 +2541,12 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf,
|
||||
if (cpumask_test_cpu(cpu, tracing_cpumask) &&
|
||||
!cpumask_test_cpu(cpu, tracing_cpumask_new)) {
|
||||
atomic_inc(&global_trace.data[cpu]->disabled);
|
||||
+ ring_buffer_record_disable_cpu(global_trace.buffer, cpu);
|
||||
}
|
||||
if (!cpumask_test_cpu(cpu, tracing_cpumask) &&
|
||||
cpumask_test_cpu(cpu, tracing_cpumask_new)) {
|
||||
atomic_dec(&global_trace.data[cpu]->disabled);
|
||||
+ ring_buffer_record_enable_cpu(global_trace.buffer, cpu);
|
||||
}
|
||||
}
|
||||
arch_spin_unlock(&ftrace_max_lock);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
From 0b53b4fb097d5d599a3a3fcd0ac10ad140bdf9c4 Mon Sep 17 00:00:00 2001
|
||||
From: Bing Zhao <bzhao@marvell.com>
|
||||
Date: Tue, 3 Jul 2012 20:43:56 -0700
|
||||
Subject: [PATCH 24/49] mwifiex: fix wrong return values in add_virtual_intf()
|
||||
error cases
|
||||
|
||||
commit 858faa57dd9e2b91f3f870fbb1185982e42f5a2b upstream
|
||||
|
||||
backported for linux-3.2.y, linux-3.3.y, linux-3.4.y
|
||||
|
||||
add_virtual_intf() needs to return an ERR_PTR(), instead of NULL,
|
||||
on errors, otherwise cfg80211 will crash.
|
||||
|
||||
Reported-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: Bing Zhao <bzhao@marvell.com>
|
||||
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/wireless/mwifiex/cfg80211.c | 21 +++++++++------------
|
||||
1 file changed, 9 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
|
||||
index 462c710..01dcb1a 100644
|
||||
--- a/drivers/net/wireless/mwifiex/cfg80211.c
|
||||
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
|
||||
@@ -1177,11 +1177,11 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||
void *mdev_priv;
|
||||
|
||||
if (!priv)
|
||||
- return NULL;
|
||||
+ return ERR_PTR(-EFAULT);
|
||||
|
||||
adapter = priv->adapter;
|
||||
if (!adapter)
|
||||
- return NULL;
|
||||
+ return ERR_PTR(-EFAULT);
|
||||
|
||||
switch (type) {
|
||||
case NL80211_IFTYPE_UNSPECIFIED:
|
||||
@@ -1190,7 +1190,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||
if (priv->bss_mode) {
|
||||
wiphy_err(wiphy, "cannot create multiple"
|
||||
" station/adhoc interfaces\n");
|
||||
- return NULL;
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
if (type == NL80211_IFTYPE_UNSPECIFIED)
|
||||
@@ -1208,14 +1208,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||
break;
|
||||
default:
|
||||
wiphy_err(wiphy, "type not supported\n");
|
||||
- return NULL;
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name,
|
||||
ether_setup, 1);
|
||||
if (!dev) {
|
||||
wiphy_err(wiphy, "no memory available for netdevice\n");
|
||||
- goto error;
|
||||
+ priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
dev_net_set(dev, wiphy_net(wiphy));
|
||||
@@ -1240,7 +1241,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||
/* Register network device */
|
||||
if (register_netdevice(dev)) {
|
||||
wiphy_err(wiphy, "cannot register virtual network device\n");
|
||||
- goto error;
|
||||
+ free_netdev(dev);
|
||||
+ priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
|
||||
+ return ERR_PTR(-EFAULT);
|
||||
}
|
||||
|
||||
sema_init(&priv->async_sem, 1);
|
||||
@@ -1252,12 +1255,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||
mwifiex_dev_debugfs_init(priv);
|
||||
#endif
|
||||
return dev;
|
||||
-error:
|
||||
- if (dev && (dev->reg_state == NETREG_UNREGISTERED))
|
||||
- free_netdev(dev);
|
||||
- priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
|
||||
-
|
||||
- return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
From 4d7257d8f5c970ce0f699d893f6050fd8bd11f3c Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Wed, 27 Jun 2012 20:08:44 +0200
|
||||
Subject: [PATCH 25/49] udf: Use 'ret' instead of abusing 'i' in
|
||||
udf_load_logicalvol()
|
||||
|
||||
commit cb14d340ef1737c24125dd663eff77734a482d47 upstream.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/udf/super.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/fs/udf/super.c b/fs/udf/super.c
|
||||
index 87cb24a..eea2bfe 100644
|
||||
--- a/fs/udf/super.c
|
||||
+++ b/fs/udf/super.c
|
||||
@@ -1235,11 +1235,9 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
|
||||
BUG_ON(ident != TAG_IDENT_LVD);
|
||||
lvd = (struct logicalVolDesc *)bh->b_data;
|
||||
|
||||
- i = udf_sb_alloc_partition_maps(sb, le32_to_cpu(lvd->numPartitionMaps));
|
||||
- if (i != 0) {
|
||||
- ret = i;
|
||||
+ ret = udf_sb_alloc_partition_maps(sb, le32_to_cpu(lvd->numPartitionMaps));
|
||||
+ if (ret)
|
||||
goto out_bh;
|
||||
- }
|
||||
|
||||
for (i = 0, offset = 0;
|
||||
i < sbi->s_partitions && offset < le32_to_cpu(lvd->mapTableLength);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
From 0a9d08974ed753d12541081ae062e5f69298d791 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Wed, 27 Jun 2012 20:20:22 +0200
|
||||
Subject: [PATCH 26/49] udf: Avoid run away loop when partition table length
|
||||
is corrupted
|
||||
|
||||
commit adee11b2085bee90bd8f4f52123ffb07882d6256 upstream.
|
||||
|
||||
Check provided length of partition table so that (possibly maliciously)
|
||||
corrupted partition table cannot cause accessing data beyond current buffer.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/udf/super.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/fs/udf/super.c b/fs/udf/super.c
|
||||
index eea2bfe..800e839 100644
|
||||
--- a/fs/udf/super.c
|
||||
+++ b/fs/udf/super.c
|
||||
@@ -1227,6 +1227,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
|
||||
struct genericPartitionMap *gpm;
|
||||
uint16_t ident;
|
||||
struct buffer_head *bh;
|
||||
+ unsigned int table_len;
|
||||
int ret = 0;
|
||||
|
||||
bh = udf_read_tagged(sb, block, block, &ident);
|
||||
@@ -1234,13 +1235,20 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
|
||||
return 1;
|
||||
BUG_ON(ident != TAG_IDENT_LVD);
|
||||
lvd = (struct logicalVolDesc *)bh->b_data;
|
||||
+ table_len = le32_to_cpu(lvd->mapTableLength);
|
||||
+ if (sizeof(*lvd) + table_len > sb->s_blocksize) {
|
||||
+ udf_err(sb, "error loading logical volume descriptor: "
|
||||
+ "Partition table too long (%u > %lu)\n", table_len,
|
||||
+ sb->s_blocksize - sizeof(*lvd));
|
||||
+ goto out_bh;
|
||||
+ }
|
||||
|
||||
ret = udf_sb_alloc_partition_maps(sb, le32_to_cpu(lvd->numPartitionMaps));
|
||||
if (ret)
|
||||
goto out_bh;
|
||||
|
||||
for (i = 0, offset = 0;
|
||||
- i < sbi->s_partitions && offset < le32_to_cpu(lvd->mapTableLength);
|
||||
+ i < sbi->s_partitions && offset < table_len;
|
||||
i++, offset += gpm->partitionMapLength) {
|
||||
struct udf_part_map *map = &sbi->s_partmaps[i];
|
||||
gpm = (struct genericPartitionMap *)
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
From 9db7244bafd8f99123cf5fe816e4961115831ca9 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Wed, 27 Jun 2012 21:23:07 +0200
|
||||
Subject: [PATCH 27/49] udf: Fortify loading of sparing table
|
||||
|
||||
commit 1df2ae31c724e57be9d7ac00d78db8a5dabdd050 upstream.
|
||||
|
||||
Add sanity checks when loading sparing table from disk to avoid accessing
|
||||
unallocated memory or writing to it.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/udf/super.c | 86 ++++++++++++++++++++++++++++++++++----------------------
|
||||
1 file changed, 53 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/fs/udf/super.c b/fs/udf/super.c
|
||||
index 800e839..270e135 100644
|
||||
--- a/fs/udf/super.c
|
||||
+++ b/fs/udf/super.c
|
||||
@@ -56,6 +56,7 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/crc-itu-t.h>
|
||||
+#include <linux/log2.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#include "udf_sb.h"
|
||||
@@ -1217,11 +1218,59 @@ out_bh:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int udf_load_sparable_map(struct super_block *sb,
|
||||
+ struct udf_part_map *map,
|
||||
+ struct sparablePartitionMap *spm)
|
||||
+{
|
||||
+ uint32_t loc;
|
||||
+ uint16_t ident;
|
||||
+ struct sparingTable *st;
|
||||
+ struct udf_sparing_data *sdata = &map->s_type_specific.s_sparing;
|
||||
+ int i;
|
||||
+ struct buffer_head *bh;
|
||||
+
|
||||
+ map->s_partition_type = UDF_SPARABLE_MAP15;
|
||||
+ sdata->s_packet_len = le16_to_cpu(spm->packetLength);
|
||||
+ if (!is_power_of_2(sdata->s_packet_len)) {
|
||||
+ udf_err(sb, "error loading logical volume descriptor: "
|
||||
+ "Invalid packet length %u\n",
|
||||
+ (unsigned)sdata->s_packet_len);
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ if (spm->numSparingTables > 4) {
|
||||
+ udf_err(sb, "error loading logical volume descriptor: "
|
||||
+ "Too many sparing tables (%d)\n",
|
||||
+ (int)spm->numSparingTables);
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < spm->numSparingTables; i++) {
|
||||
+ loc = le32_to_cpu(spm->locSparingTable[i]);
|
||||
+ bh = udf_read_tagged(sb, loc, loc, &ident);
|
||||
+ if (!bh)
|
||||
+ continue;
|
||||
+
|
||||
+ st = (struct sparingTable *)bh->b_data;
|
||||
+ if (ident != 0 ||
|
||||
+ strncmp(st->sparingIdent.ident, UDF_ID_SPARING,
|
||||
+ strlen(UDF_ID_SPARING)) ||
|
||||
+ sizeof(*st) + le16_to_cpu(st->reallocationTableLen) >
|
||||
+ sb->s_blocksize) {
|
||||
+ brelse(bh);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ sdata->s_spar_map[i] = bh;
|
||||
+ }
|
||||
+ map->s_partition_func = udf_get_pblock_spar15;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int udf_load_logicalvol(struct super_block *sb, sector_t block,
|
||||
struct kernel_lb_addr *fileset)
|
||||
{
|
||||
struct logicalVolDesc *lvd;
|
||||
- int i, j, offset;
|
||||
+ int i, offset;
|
||||
uint8_t type;
|
||||
struct udf_sb_info *sbi = UDF_SB(sb);
|
||||
struct genericPartitionMap *gpm;
|
||||
@@ -1283,38 +1332,9 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
|
||||
} else if (!strncmp(upm2->partIdent.ident,
|
||||
UDF_ID_SPARABLE,
|
||||
strlen(UDF_ID_SPARABLE))) {
|
||||
- uint32_t loc;
|
||||
- struct sparingTable *st;
|
||||
- struct sparablePartitionMap *spm =
|
||||
- (struct sparablePartitionMap *)gpm;
|
||||
-
|
||||
- map->s_partition_type = UDF_SPARABLE_MAP15;
|
||||
- map->s_type_specific.s_sparing.s_packet_len =
|
||||
- le16_to_cpu(spm->packetLength);
|
||||
- for (j = 0; j < spm->numSparingTables; j++) {
|
||||
- struct buffer_head *bh2;
|
||||
-
|
||||
- loc = le32_to_cpu(
|
||||
- spm->locSparingTable[j]);
|
||||
- bh2 = udf_read_tagged(sb, loc, loc,
|
||||
- &ident);
|
||||
- map->s_type_specific.s_sparing.
|
||||
- s_spar_map[j] = bh2;
|
||||
-
|
||||
- if (bh2 == NULL)
|
||||
- continue;
|
||||
-
|
||||
- st = (struct sparingTable *)bh2->b_data;
|
||||
- if (ident != 0 || strncmp(
|
||||
- st->sparingIdent.ident,
|
||||
- UDF_ID_SPARING,
|
||||
- strlen(UDF_ID_SPARING))) {
|
||||
- brelse(bh2);
|
||||
- map->s_type_specific.s_sparing.
|
||||
- s_spar_map[j] = NULL;
|
||||
- }
|
||||
- }
|
||||
- map->s_partition_func = udf_get_pblock_spar15;
|
||||
+ if (udf_load_sparable_map(sb, map,
|
||||
+ (struct sparablePartitionMap *)gpm) < 0)
|
||||
+ goto out_bh;
|
||||
} else if (!strncmp(upm2->partIdent.ident,
|
||||
UDF_ID_METADATA,
|
||||
strlen(UDF_ID_METADATA))) {
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
From cb4aa2ef6f748fa3a3e6cd3889153c191e63d48e Mon Sep 17 00:00:00 2001
|
||||
From: Russell King <rmk+kernel@arm.linux.org.uk>
|
||||
Date: Thu, 19 Jan 2012 15:20:58 +0000
|
||||
Subject: [PATCH 28/49] ARM: fix rcu stalls on SMP platforms
|
||||
|
||||
commit 7deabca0acfe02b8e18f59a4c95676012f49a304 upstream.
|
||||
|
||||
We can stall RCU processing on SMP platforms if a CPU sits in its idle
|
||||
loop for a long time. This happens because we don't call irq_enter()
|
||||
and irq_exit() around generic_smp_call_function_interrupt() and
|
||||
friends. Add the necessary calls, and remove the one from within
|
||||
ipi_timer(), so that they're all in a common place.
|
||||
|
||||
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
arch/arm/kernel/smp.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
|
||||
index e10e59a..1d1710e 100644
|
||||
--- a/arch/arm/kernel/smp.c
|
||||
+++ b/arch/arm/kernel/smp.c
|
||||
@@ -471,9 +471,7 @@ static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
|
||||
static void ipi_timer(void)
|
||||
{
|
||||
struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
|
||||
- irq_enter();
|
||||
evt->event_handler(evt);
|
||||
- irq_exit();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
|
||||
@@ -572,7 +570,9 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
|
||||
|
||||
switch (ipinr) {
|
||||
case IPI_TIMER:
|
||||
+ irq_enter();
|
||||
ipi_timer();
|
||||
+ irq_exit();
|
||||
break;
|
||||
|
||||
case IPI_RESCHEDULE:
|
||||
@@ -580,15 +580,21 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
|
||||
break;
|
||||
|
||||
case IPI_CALL_FUNC:
|
||||
+ irq_enter();
|
||||
generic_smp_call_function_interrupt();
|
||||
+ irq_exit();
|
||||
break;
|
||||
|
||||
case IPI_CALL_FUNC_SINGLE:
|
||||
+ irq_enter();
|
||||
generic_smp_call_function_single_interrupt();
|
||||
+ irq_exit();
|
||||
break;
|
||||
|
||||
case IPI_CPU_STOP:
|
||||
+ irq_enter();
|
||||
ipi_cpu_stop(cpu);
|
||||
+ irq_exit();
|
||||
break;
|
||||
|
||||
default:
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
From 9e88f1e8bf3f7dbc0cb410a09c003180052bd7d4 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Wed, 30 May 2012 21:18:10 +0000
|
||||
Subject: [PATCH 29/49] net: sock: validate data_len before allocating skb in
|
||||
sock_alloc_send_pskb()
|
||||
|
||||
[ Upstream commit cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc ]
|
||||
|
||||
We need to validate the number of pages consumed by data_len, otherwise frags
|
||||
array could be overflowed by userspace. So this patch validate data_len and
|
||||
return -EMSGSIZE when data_len may occupies more frags than MAX_SKB_FRAGS.
|
||||
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/core/sock.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/net/core/sock.c b/net/core/sock.c
|
||||
index b23f174..8d095b9 100644
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -1497,6 +1497,11 @@ struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
|
||||
gfp_t gfp_mask;
|
||||
long timeo;
|
||||
int err;
|
||||
+ int npages = (data_len + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
|
||||
+
|
||||
+ err = -EMSGSIZE;
|
||||
+ if (npages > MAX_SKB_FRAGS)
|
||||
+ goto failure;
|
||||
|
||||
gfp_mask = sk->sk_allocation;
|
||||
if (gfp_mask & __GFP_WAIT)
|
||||
@@ -1515,14 +1520,12 @@ struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
|
||||
if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) {
|
||||
skb = alloc_skb(header_len, gfp_mask);
|
||||
if (skb) {
|
||||
- int npages;
|
||||
int i;
|
||||
|
||||
/* No pages, we're done... */
|
||||
if (!data_len)
|
||||
break;
|
||||
|
||||
- npages = (data_len + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
|
||||
skb->truesize += data_len;
|
||||
skb_shinfo(skb)->nr_frags = npages;
|
||||
for (i = 0; i < npages; i++) {
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
From e3e2beb00731e994722f01a1c284e3bcc69264ba Mon Sep 17 00:00:00 2001
|
||||
From: Paul Moore <pmoore@redhat.com>
|
||||
Date: Fri, 1 Jun 2012 05:54:56 +0000
|
||||
Subject: [PATCH 30/49] cipso: handle CIPSO options correctly when NetLabel is
|
||||
disabled
|
||||
|
||||
[ Upstream commit 20e2a86485967c385d7c7befc1646e4d1d39362e ]
|
||||
|
||||
When NetLabel is not enabled, e.g. CONFIG_NETLABEL=n, and the system
|
||||
receives a CIPSO tagged packet it is dropped (cipso_v4_validate()
|
||||
returns non-zero). In most cases this is the correct and desired
|
||||
behavior, however, in the case where we are simply forwarding the
|
||||
traffic, e.g. acting as a network bridge, this becomes a problem.
|
||||
|
||||
This patch fixes the forwarding problem by providing the basic CIPSO
|
||||
validation code directly in ip_options_compile() without the need for
|
||||
the NetLabel or CIPSO code. The new validation code can not perform
|
||||
any of the CIPSO option label/value verification that
|
||||
cipso_v4_validate() does, but it can verify the basic CIPSO option
|
||||
format.
|
||||
|
||||
The behavior when NetLabel is enabled is unchanged.
|
||||
|
||||
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
include/net/cipso_ipv4.h | 29 ++++++++++++++++++++++++++++-
|
||||
1 file changed, 28 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
|
||||
index 9808877..a7a683e 100644
|
||||
--- a/include/net/cipso_ipv4.h
|
||||
+++ b/include/net/cipso_ipv4.h
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <net/netlabel.h>
|
||||
#include <net/request_sock.h>
|
||||
#include <linux/atomic.h>
|
||||
+#include <asm/unaligned.h>
|
||||
|
||||
/* known doi values */
|
||||
#define CIPSO_V4_DOI_UNKNOWN 0x00000000
|
||||
@@ -285,7 +286,33 @@ static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
|
||||
static inline int cipso_v4_validate(const struct sk_buff *skb,
|
||||
unsigned char **option)
|
||||
{
|
||||
- return -ENOSYS;
|
||||
+ unsigned char *opt = *option;
|
||||
+ unsigned char err_offset = 0;
|
||||
+ u8 opt_len = opt[1];
|
||||
+ u8 opt_iter;
|
||||
+
|
||||
+ if (opt_len < 8) {
|
||||
+ err_offset = 1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (get_unaligned_be32(&opt[2]) == 0) {
|
||||
+ err_offset = 2;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ for (opt_iter = 6; opt_iter < opt_len;) {
|
||||
+ if (opt[opt_iter + 1] > (opt_len - opt_iter)) {
|
||||
+ err_offset = opt_iter + 1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ opt_iter += opt[opt_iter + 1];
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ *option = opt + err_offset;
|
||||
+ return err_offset;
|
||||
+
|
||||
}
|
||||
#endif /* CONFIG_NETLABEL */
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
From b5ad3a0c0628afa77ab9de116e252fbac91f6db2 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Thu, 7 Jun 2012 00:07:20 +0000
|
||||
Subject: [PATCH 31/49] net: l2tp_eth: fix kernel panic on rmmod l2tp_eth
|
||||
|
||||
[ Upstream commit a06998b88b1651c5f71c0e35f528bf2057188ead ]
|
||||
|
||||
We must prevent module unloading if some devices are still attached to
|
||||
l2tp_eth driver.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Reported-by: Denys Fedoryshchenko <denys@visp.net.lb>
|
||||
Tested-by: Denys Fedoryshchenko <denys@visp.net.lb>
|
||||
Cc: James Chapman <jchapman@katalix.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/l2tp/l2tp_eth.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
|
||||
index d2726a7..3c55f63 100644
|
||||
--- a/net/l2tp/l2tp_eth.c
|
||||
+++ b/net/l2tp/l2tp_eth.c
|
||||
@@ -167,6 +167,7 @@ static void l2tp_eth_delete(struct l2tp_session *session)
|
||||
if (dev) {
|
||||
unregister_netdev(dev);
|
||||
spriv->dev = NULL;
|
||||
+ module_put(THIS_MODULE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,6 +255,7 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p
|
||||
if (rc < 0)
|
||||
goto out_del_dev;
|
||||
|
||||
+ __module_get(THIS_MODULE);
|
||||
/* Must be done after register_netdev() */
|
||||
strlcpy(session->ifname, dev->name, IFNAMSIZ);
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
From a2ee8c14e43a7432b50a050cd07c06d43caa9314 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Fri, 8 Jun 2012 06:25:00 +0000
|
||||
Subject: [PATCH 32/49] l2tp: fix a race in l2tp_ip_sendmsg()
|
||||
|
||||
[ Upstream commit 4399a4df98a63e30fd16e9d0cecc46ea92269e8f ]
|
||||
|
||||
Commit 081b1b1bb27f (l2tp: fix l2tp_ip_sendmsg() route handling) added
|
||||
a race, in case IP route cache is disabled.
|
||||
|
||||
In this case, we should not do the dst_release(&rt->dst), since it'll
|
||||
free the dst immediately, instead of waiting a RCU grace period.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Cc: James Chapman <jchapman@katalix.com>
|
||||
Cc: Denys Fedoryshchenko <denys@visp.net.lb>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/l2tp/l2tp_ip.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
|
||||
index 2fbbe1f..6c7e609 100644
|
||||
--- a/net/l2tp/l2tp_ip.c
|
||||
+++ b/net/l2tp/l2tp_ip.c
|
||||
@@ -515,10 +515,12 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
|
||||
sk->sk_bound_dev_if);
|
||||
if (IS_ERR(rt))
|
||||
goto no_route;
|
||||
- if (connected)
|
||||
+ if (connected) {
|
||||
sk_setup_caps(sk, &rt->dst);
|
||||
- else
|
||||
- dst_release(&rt->dst); /* safe since we hold rcu_read_lock */
|
||||
+ } else {
|
||||
+ skb_dst_set(skb, &rt->dst);
|
||||
+ goto xmit;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* We dont need to clone dst here, it is guaranteed to not disappear.
|
||||
@@ -526,6 +528,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
|
||||
*/
|
||||
skb_dst_set_noref(skb, &rt->dst);
|
||||
|
||||
+xmit:
|
||||
/* Queue the packet to IP for output */
|
||||
rc = ip_queue_xmit(skb, &inet->cork.fl);
|
||||
rcu_read_unlock();
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
From f13b66c5fac7aa65e68a960806d6c5e97df723eb Mon Sep 17 00:00:00 2001
|
||||
From: stephen hemminger <shemminger@vyatta.com>
|
||||
Date: Wed, 6 Jun 2012 10:01:30 +0000
|
||||
Subject: [PATCH 33/49] sky2: fix checksum bit management on some chips
|
||||
|
||||
[ Upstream commit 5ff0feac88ced864f44adb145142269196fa79d9 ]
|
||||
|
||||
The newer flavors of Yukon II use a different method for receive
|
||||
checksum offload. This is indicated in the driver by the SKY2_HW_NEW_LE
|
||||
flag. On these newer chips, the BMU_ENA_RX_CHKSUM should not be set.
|
||||
|
||||
The driver would get incorrectly toggle the bit, enabling the old
|
||||
checksum logic on these chips and cause a BUG_ON() assertion. If
|
||||
receive checksum was toggled via ethtool.
|
||||
|
||||
Reported-by: Kirill Smelkov <kirr@mns.spb.ru>
|
||||
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/ethernet/marvell/sky2.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
|
||||
index 65c51ff..11ddd838 100644
|
||||
--- a/drivers/net/ethernet/marvell/sky2.c
|
||||
+++ b/drivers/net/ethernet/marvell/sky2.c
|
||||
@@ -4361,10 +4361,12 @@ static int sky2_set_features(struct net_device *dev, u32 features)
|
||||
struct sky2_port *sky2 = netdev_priv(dev);
|
||||
u32 changed = dev->features ^ features;
|
||||
|
||||
- if (changed & NETIF_F_RXCSUM) {
|
||||
- u32 on = features & NETIF_F_RXCSUM;
|
||||
- sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
|
||||
- on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM);
|
||||
+ if ((changed & NETIF_F_RXCSUM) &&
|
||||
+ !(sky2->hw->flags & SKY2_HW_NEW_LE)) {
|
||||
+ sky2_write32(sky2->hw,
|
||||
+ Q_ADDR(rxqaddr[sky2->port], Q_CSR),
|
||||
+ (features & NETIF_F_RXCSUM)
|
||||
+ ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM);
|
||||
}
|
||||
|
||||
if (changed & NETIF_F_RXHASH)
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
From 5588c981e9bc21ca9bd050a8e15feb4adb1215b9 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Thu, 7 Jun 2012 22:59:59 +0000
|
||||
Subject: [PATCH 34/49] be2net: fix a race in be_xmit()
|
||||
|
||||
[ Upstream commit cd8f76c0a0c6fce0b2cf23c9bd0123f91453f46d ]
|
||||
|
||||
As soon as hardware is notified of a transmit, we no longer can assume
|
||||
skb can be dereferenced, as TX completion might have freed the packet.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Cc: Sathya Perla <sathya.perla@emulex.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/ethernet/emulex/benet/be_main.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
|
||||
index bf266a0..36c7c4e 100644
|
||||
--- a/drivers/net/ethernet/emulex/benet/be_main.c
|
||||
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
|
||||
@@ -696,6 +696,8 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
|
||||
|
||||
copied = make_tx_wrbs(adapter, txq, skb, wrb_cnt, dummy_wrb);
|
||||
if (copied) {
|
||||
+ int gso_segs = skb_shinfo(skb)->gso_segs;
|
||||
+
|
||||
/* record the sent skb in the sent_skb table */
|
||||
BUG_ON(txo->sent_skb_list[start]);
|
||||
txo->sent_skb_list[start] = skb;
|
||||
@@ -713,8 +715,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
|
||||
|
||||
be_txq_notify(adapter, txq->id, wrb_cnt);
|
||||
|
||||
- be_tx_stats_update(txo, wrb_cnt, copied,
|
||||
- skb_shinfo(skb)->gso_segs, stopped);
|
||||
+ be_tx_stats_update(txo, wrb_cnt, copied, gso_segs, stopped);
|
||||
} else {
|
||||
txq->head = start;
|
||||
dev_kfree_skb_any(skb);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
From 6e4b4fb46ccc49cacb3258764f2414ecd4fb27a4 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sun, 10 Jun 2012 21:11:57 +0000
|
||||
Subject: [PATCH 35/49] dummy: fix rcu_sched self-detected stalls
|
||||
|
||||
[ Upstream commit 16b0dc29c1af9df341428f4c49ada4f626258082 ]
|
||||
|
||||
Trying to "modprobe dummy numdummies=30000" triggers :
|
||||
|
||||
INFO: rcu_sched self-detected stall on CPU { 8} (t=60000 jiffies)
|
||||
|
||||
After this splat, RTNL is locked and reboot is needed.
|
||||
|
||||
We must call cond_resched() to avoid this, even holding RTNL.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/dummy.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
|
||||
index eeac9ca..68fe73c 100644
|
||||
--- a/drivers/net/dummy.c
|
||||
+++ b/drivers/net/dummy.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <net/rtnetlink.h>
|
||||
#include <linux/u64_stats_sync.h>
|
||||
+#include <linux/sched.h>
|
||||
|
||||
static int numdummies = 1;
|
||||
|
||||
@@ -186,8 +187,10 @@ static int __init dummy_init_module(void)
|
||||
rtnl_lock();
|
||||
err = __rtnl_link_register(&dummy_link_ops);
|
||||
|
||||
- for (i = 0; i < numdummies && !err; i++)
|
||||
+ for (i = 0; i < numdummies && !err; i++) {
|
||||
err = dummy_init_one();
|
||||
+ cond_resched();
|
||||
+ }
|
||||
if (err < 0)
|
||||
__rtnl_link_unregister(&dummy_link_ops);
|
||||
rtnl_unlock();
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
From 218ae95441a945d2a474b2277156749f416b8859 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Tue, 12 Jun 2012 06:03:51 +0000
|
||||
Subject: [PATCH 36/49] bonding: Fix corrupted queue_mapping
|
||||
|
||||
[ Upstream commit 5ee31c6898ea5537fcea160999d60dc63bc0c305 ]
|
||||
|
||||
In the transmit path of the bonding driver, skb->cb is used to
|
||||
stash the skb->queue_mapping so that the bonding device can set its
|
||||
own queue mapping. This value becomes corrupted since the skb->cb is
|
||||
also used in __dev_xmit_skb.
|
||||
|
||||
When transmitting through bonding driver, bond_select_queue is
|
||||
called from dev_queue_xmit. In bond_select_queue the original
|
||||
skb->queue_mapping is copied into skb->cb (via bond_queue_mapping)
|
||||
and skb->queue_mapping is overwritten with the bond driver queue.
|
||||
|
||||
Subsequently in dev_queue_xmit, __dev_xmit_skb is called which writes
|
||||
the packet length into skb->cb, thereby overwriting the stashed
|
||||
queue mappping. In bond_dev_queue_xmit (called from hard_start_xmit),
|
||||
the queue mapping for the skb is set to the stashed value which is now
|
||||
the skb length and hence is an invalid queue for the slave device.
|
||||
|
||||
If we want to save skb->queue_mapping into skb->cb[], best place is to
|
||||
add a field in struct qdisc_skb_cb, to make sure it wont conflict with
|
||||
other layers (eg : Qdiscc, Infiniband...)
|
||||
|
||||
This patchs also makes sure (struct qdisc_skb_cb)->data is aligned on 8
|
||||
bytes :
|
||||
|
||||
netem qdisc for example assumes it can store an u64 in it, without
|
||||
misalignment penalty.
|
||||
|
||||
Note : we only have 20 bytes left in (struct qdisc_skb_cb)->data[].
|
||||
The largest user is CHOKe and it fills it.
|
||||
|
||||
Based on a previous patch from Tom Herbert.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Reported-by: Tom Herbert <therbert@google.com>
|
||||
Cc: John Fastabend <john.r.fastabend@intel.com>
|
||||
Cc: Roland Dreier <roland@kernel.org>
|
||||
Acked-by: Neil Horman <nhorman@tuxdriver.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/net/bonding/bond_main.c | 9 +++++----
|
||||
include/net/sch_generic.h | 7 +++++--
|
||||
2 files changed, 10 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
|
||||
index f65e0b9..1a88e38 100644
|
||||
--- a/drivers/net/bonding/bond_main.c
|
||||
+++ b/drivers/net/bonding/bond_main.c
|
||||
@@ -77,6 +77,7 @@
|
||||
#include <net/route.h>
|
||||
#include <net/net_namespace.h>
|
||||
#include <net/netns/generic.h>
|
||||
+#include <net/pkt_sched.h>
|
||||
#include "bonding.h"
|
||||
#include "bond_3ad.h"
|
||||
#include "bond_alb.h"
|
||||
@@ -382,8 +383,6 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr)
|
||||
return next;
|
||||
}
|
||||
|
||||
-#define bond_queue_mapping(skb) (*(u16 *)((skb)->cb))
|
||||
-
|
||||
/**
|
||||
* bond_dev_queue_xmit - Prepare skb for xmit.
|
||||
*
|
||||
@@ -396,7 +395,9 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
|
||||
{
|
||||
skb->dev = slave_dev;
|
||||
|
||||
- skb->queue_mapping = bond_queue_mapping(skb);
|
||||
+ BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
|
||||
+ sizeof(qdisc_skb_cb(skb)->bond_queue_mapping));
|
||||
+ skb->queue_mapping = qdisc_skb_cb(skb)->bond_queue_mapping;
|
||||
|
||||
if (unlikely(netpoll_tx_running(slave_dev)))
|
||||
bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb);
|
||||
@@ -4151,7 +4152,7 @@ static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb)
|
||||
/*
|
||||
* Save the original txq to restore before passing to the driver
|
||||
*/
|
||||
- bond_queue_mapping(skb) = skb->queue_mapping;
|
||||
+ qdisc_skb_cb(skb)->bond_queue_mapping = skb->queue_mapping;
|
||||
|
||||
if (unlikely(txq >= dev->real_num_tx_queues)) {
|
||||
do {
|
||||
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
|
||||
index 55ce96b..9d7d54a 100644
|
||||
--- a/include/net/sch_generic.h
|
||||
+++ b/include/net/sch_generic.h
|
||||
@@ -220,13 +220,16 @@ struct tcf_proto {
|
||||
|
||||
struct qdisc_skb_cb {
|
||||
unsigned int pkt_len;
|
||||
- unsigned char data[24];
|
||||
+ u16 bond_queue_mapping;
|
||||
+ u16 _pad;
|
||||
+ unsigned char data[20];
|
||||
};
|
||||
|
||||
static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
|
||||
{
|
||||
struct qdisc_skb_cb *qcb;
|
||||
- BUILD_BUG_ON(sizeof(skb->cb) < sizeof(unsigned int) + sz);
|
||||
+
|
||||
+ BUILD_BUG_ON(sizeof(skb->cb) < offsetof(struct qdisc_skb_cb, data) + sz);
|
||||
BUILD_BUG_ON(sizeof(qcb->data) < sz);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
From 7d1a3b73b1d85f034aeb9e5c1e4eb44ce56658be Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
|
||||
Date: Sun, 22 Jan 2012 00:20:40 +0000
|
||||
Subject: [PATCH 37/49] ethtool: allow ETHTOOL_GSSET_INFO for users
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ Upstream commit f80400a26a2e8bff541de12834a1134358bb6642 ]
|
||||
|
||||
Allow ETHTOOL_GSSET_INFO ethtool ioctl() for unprivileged users.
|
||||
ETHTOOL_GSTRINGS is already allowed, but is unusable without this one.
|
||||
|
||||
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
|
||||
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/core/ethtool.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
|
||||
index 2b587ec..2367246 100644
|
||||
--- a/net/core/ethtool.c
|
||||
+++ b/net/core/ethtool.c
|
||||
@@ -1672,6 +1672,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
|
||||
case ETHTOOL_GRXCSUM:
|
||||
case ETHTOOL_GTXCSUM:
|
||||
case ETHTOOL_GSG:
|
||||
+ case ETHTOOL_GSSET_INFO:
|
||||
case ETHTOOL_GSTRINGS:
|
||||
case ETHTOOL_GTSO:
|
||||
case ETHTOOL_GPERMADDR:
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
From 1757946f8c246a1b46bf27d40716d4f78145f4a1 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Tue, 12 Jun 2012 19:30:21 +0000
|
||||
Subject: [PATCH 38/49] netpoll: fix netpoll_send_udp() bugs
|
||||
|
||||
[ Upstream commit 954fba0274058d27c7c07b5ea07c41b3b7477894 ]
|
||||
|
||||
Bogdan Hamciuc diagnosed and fixed following bug in netpoll_send_udp() :
|
||||
|
||||
"skb->len += len;" instead of "skb_put(skb, len);"
|
||||
|
||||
Meaning that _if_ a network driver needs to call skb_realloc_headroom(),
|
||||
only packet headers would be copied, leaving garbage in the payload.
|
||||
|
||||
However the skb_realloc_headroom() must be avoided as much as possible
|
||||
since it requires memory and netpoll tries hard to work even if memory
|
||||
is exhausted (using a pool of preallocated skbs)
|
||||
|
||||
It appears netpoll_send_udp() reserved 16 bytes for the ethernet header,
|
||||
which happens to work for typicall drivers but not all.
|
||||
|
||||
Right thing is to use LL_RESERVED_SPACE(dev)
|
||||
(And also add dev->needed_tailroom of tailroom)
|
||||
|
||||
This patch combines both fixes.
|
||||
|
||||
Many thanks to Bogdan for raising this issue.
|
||||
|
||||
Reported-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Tested-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
|
||||
Cc: Herbert Xu <herbert@gondor.apana.org.au>
|
||||
Cc: Neil Horman <nhorman@tuxdriver.com>
|
||||
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
|
||||
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/core/netpoll.c | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
|
||||
index ab0633f..db4bb7a 100644
|
||||
--- a/net/core/netpoll.c
|
||||
+++ b/net/core/netpoll.c
|
||||
@@ -351,22 +351,23 @@ EXPORT_SYMBOL(netpoll_send_skb_on_dev);
|
||||
|
||||
void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
|
||||
{
|
||||
- int total_len, eth_len, ip_len, udp_len;
|
||||
+ int total_len, ip_len, udp_len;
|
||||
struct sk_buff *skb;
|
||||
struct udphdr *udph;
|
||||
struct iphdr *iph;
|
||||
struct ethhdr *eth;
|
||||
|
||||
udp_len = len + sizeof(*udph);
|
||||
- ip_len = eth_len = udp_len + sizeof(*iph);
|
||||
- total_len = eth_len + ETH_HLEN + NET_IP_ALIGN;
|
||||
+ ip_len = udp_len + sizeof(*iph);
|
||||
+ total_len = ip_len + LL_RESERVED_SPACE(np->dev);
|
||||
|
||||
- skb = find_skb(np, total_len, total_len - len);
|
||||
+ skb = find_skb(np, total_len + np->dev->needed_tailroom,
|
||||
+ total_len - len);
|
||||
if (!skb)
|
||||
return;
|
||||
|
||||
skb_copy_to_linear_data(skb, msg, len);
|
||||
- skb->len += len;
|
||||
+ skb_put(skb, len);
|
||||
|
||||
skb_push(skb, sizeof(*udph));
|
||||
skb_reset_transport_header(skb);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
From 0991f9681e1142099a36959648a920e9ee9dda33 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Graf <tgraf@suug.ch>
|
||||
Date: Mon, 18 Jun 2012 12:08:33 +0000
|
||||
Subject: [PATCH 39/49] ipv6: Move ipv6 proc file registration to end of init
|
||||
order
|
||||
|
||||
[ Upstream commit d189634ecab947c10f6f832258b103d0bbfe73cc ]
|
||||
|
||||
/proc/net/ipv6_route reflects the contents of fib_table_hash. The proc
|
||||
handler is installed in ip6_route_net_init() whereas fib_table_hash is
|
||||
allocated in fib6_net_init() _after_ the proc handler has been installed.
|
||||
|
||||
This opens up a short time frame to access fib_table_hash with its pants
|
||||
down.
|
||||
|
||||
Move the registration of the proc files to a later point in the init
|
||||
order to avoid the race.
|
||||
|
||||
Tested :-)
|
||||
|
||||
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/ipv6/route.c | 41 +++++++++++++++++++++++++++++++----------
|
||||
1 file changed, 31 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
|
||||
index 059b9d9..2e21751 100644
|
||||
--- a/net/ipv6/route.c
|
||||
+++ b/net/ipv6/route.c
|
||||
@@ -2881,10 +2881,6 @@ static int __net_init ip6_route_net_init(struct net *net)
|
||||
net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ;
|
||||
net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40;
|
||||
|
||||
-#ifdef CONFIG_PROC_FS
|
||||
- proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops);
|
||||
- proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
|
||||
-#endif
|
||||
net->ipv6.ip6_rt_gc_expire = 30*HZ;
|
||||
|
||||
ret = 0;
|
||||
@@ -2905,10 +2901,6 @@ out_ip6_dst_ops:
|
||||
|
||||
static void __net_exit ip6_route_net_exit(struct net *net)
|
||||
{
|
||||
-#ifdef CONFIG_PROC_FS
|
||||
- proc_net_remove(net, "ipv6_route");
|
||||
- proc_net_remove(net, "rt6_stats");
|
||||
-#endif
|
||||
kfree(net->ipv6.ip6_null_entry);
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
kfree(net->ipv6.ip6_prohibit_entry);
|
||||
@@ -2917,11 +2909,33 @@ static void __net_exit ip6_route_net_exit(struct net *net)
|
||||
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
|
||||
}
|
||||
|
||||
+static int __net_init ip6_route_net_init_late(struct net *net)
|
||||
+{
|
||||
+#ifdef CONFIG_PROC_FS
|
||||
+ proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops);
|
||||
+ proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
|
||||
+#endif
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __net_exit ip6_route_net_exit_late(struct net *net)
|
||||
+{
|
||||
+#ifdef CONFIG_PROC_FS
|
||||
+ proc_net_remove(net, "ipv6_route");
|
||||
+ proc_net_remove(net, "rt6_stats");
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
static struct pernet_operations ip6_route_net_ops = {
|
||||
.init = ip6_route_net_init,
|
||||
.exit = ip6_route_net_exit,
|
||||
};
|
||||
|
||||
+static struct pernet_operations ip6_route_net_late_ops = {
|
||||
+ .init = ip6_route_net_init_late,
|
||||
+ .exit = ip6_route_net_exit_late,
|
||||
+};
|
||||
+
|
||||
static struct notifier_block ip6_route_dev_notifier = {
|
||||
.notifier_call = ip6_route_dev_notify,
|
||||
.priority = 0,
|
||||
@@ -2971,19 +2985,25 @@ int __init ip6_route_init(void)
|
||||
if (ret)
|
||||
goto xfrm6_init;
|
||||
|
||||
+ ret = register_pernet_subsys(&ip6_route_net_late_ops);
|
||||
+ if (ret)
|
||||
+ goto fib6_rules_init;
|
||||
+
|
||||
ret = -ENOBUFS;
|
||||
if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) ||
|
||||
__rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) ||
|
||||
__rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL))
|
||||
- goto fib6_rules_init;
|
||||
+ goto out_register_late_subsys;
|
||||
|
||||
ret = register_netdevice_notifier(&ip6_route_dev_notifier);
|
||||
if (ret)
|
||||
- goto fib6_rules_init;
|
||||
+ goto out_register_late_subsys;
|
||||
|
||||
out:
|
||||
return ret;
|
||||
|
||||
+out_register_late_subsys:
|
||||
+ unregister_pernet_subsys(&ip6_route_net_late_ops);
|
||||
fib6_rules_init:
|
||||
fib6_rules_cleanup();
|
||||
xfrm6_init:
|
||||
@@ -3002,6 +3022,7 @@ out_kmem_cache:
|
||||
void ip6_route_cleanup(void)
|
||||
{
|
||||
unregister_netdevice_notifier(&ip6_route_dev_notifier);
|
||||
+ unregister_pernet_subsys(&ip6_route_net_late_ops);
|
||||
fib6_rules_cleanup();
|
||||
xfrm6_fini();
|
||||
fib6_gc_cleanup();
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
From e310ae5ff49ec77b2c991cffe288ac766e5f5203 Mon Sep 17 00:00:00 2001
|
||||
From: stephen hemminger <shemminger@vyatta.com>
|
||||
Date: Tue, 26 Jun 2012 05:48:45 +0000
|
||||
Subject: [PATCH 40/49] bridge: Assign rtnl_link_ops to bridge devices created
|
||||
via ioctl (v2)
|
||||
|
||||
[ Upstream commit 149ddd83a92b02c658d6c61f3276eb6500d585e8 ]
|
||||
|
||||
This ensures that bridges created with brctl(8) or ioctl(2) directly
|
||||
also carry IFLA_LINKINFO when dumped over netlink. This also allows
|
||||
to create a bridge with ioctl(2) and delete it with RTM_DELLINK.
|
||||
|
||||
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
||||
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
net/bridge/br_if.c | 1 +
|
||||
net/bridge/br_netlink.c | 2 +-
|
||||
net/bridge/br_private.h | 1 +
|
||||
3 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
|
||||
index f603e5b..f3f75ad 100644
|
||||
--- a/net/bridge/br_if.c
|
||||
+++ b/net/bridge/br_if.c
|
||||
@@ -240,6 +240,7 @@ int br_add_bridge(struct net *net, const char *name)
|
||||
return -ENOMEM;
|
||||
|
||||
dev_net_set(dev, net);
|
||||
+ dev->rtnl_link_ops = &br_link_ops;
|
||||
|
||||
res = register_netdev(dev);
|
||||
if (res)
|
||||
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
|
||||
index a1daf82..cbf9ccd 100644
|
||||
--- a/net/bridge/br_netlink.c
|
||||
+++ b/net/bridge/br_netlink.c
|
||||
@@ -211,7 +211,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static struct rtnl_link_ops br_link_ops __read_mostly = {
|
||||
+struct rtnl_link_ops br_link_ops __read_mostly = {
|
||||
.kind = "bridge",
|
||||
.priv_size = sizeof(struct net_bridge),
|
||||
.setup = br_dev_setup,
|
||||
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
|
||||
index 93264df..b9bba8f 100644
|
||||
--- a/net/bridge/br_private.h
|
||||
+++ b/net/bridge/br_private.h
|
||||
@@ -536,6 +536,7 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr)
|
||||
#endif
|
||||
|
||||
/* br_netlink.c */
|
||||
+extern struct rtnl_link_ops br_link_ops;
|
||||
extern int br_netlink_init(void);
|
||||
extern void br_netlink_fini(void);
|
||||
extern void br_ifinfo_notify(int event, struct net_bridge_port *port);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
From 478ed8ce8490d599e1bb8e79007b85d6a9e7f1a0 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Mason <chris.mason@fusionio.com>
|
||||
Date: Mon, 2 Jul 2012 15:29:53 -0400
|
||||
Subject: [PATCH 41/49] Btrfs: run delayed directory updates during log replay
|
||||
|
||||
commit b6305567e7d31b0bec1b8cb9ec0cadd7f7086f5f upstream.
|
||||
|
||||
While we are resolving directory modifications in the
|
||||
tree log, we are triggering delayed metadata updates to
|
||||
the filesystem btrees.
|
||||
|
||||
This commit forces the delayed updates to run so the
|
||||
replay code can find any modifications done. It stops
|
||||
us from crashing because the directory deleltion replay
|
||||
expects items to be removed immediately from the tree.
|
||||
|
||||
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/btrfs/tree-log.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
|
||||
index 3568374..19b127c 100644
|
||||
--- a/fs/btrfs/tree-log.c
|
||||
+++ b/fs/btrfs/tree-log.c
|
||||
@@ -692,6 +692,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
|
||||
kfree(name);
|
||||
|
||||
iput(inode);
|
||||
+
|
||||
+ btrfs_run_delayed_items(trans, root);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -897,6 +899,7 @@ again:
|
||||
ret = btrfs_unlink_inode(trans, root, dir,
|
||||
inode, victim_name,
|
||||
victim_name_len);
|
||||
+ btrfs_run_delayed_items(trans, root);
|
||||
}
|
||||
kfree(victim_name);
|
||||
ptr = (unsigned long)(victim_ref + 1) + victim_name_len;
|
||||
@@ -1477,6 +1480,9 @@ again:
|
||||
ret = btrfs_unlink_inode(trans, root, dir, inode,
|
||||
name, name_len);
|
||||
BUG_ON(ret);
|
||||
+
|
||||
+ btrfs_run_delayed_items(trans, root);
|
||||
+
|
||||
kfree(name);
|
||||
iput(inode);
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
From 3ef708aec9359ad6b05d8ae43663cf5e73c58e9d Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Layton <jlayton@redhat.com>
|
||||
Date: Mon, 2 Jul 2012 07:24:25 -0400
|
||||
Subject: [PATCH 42/49] cifs: when server doesn't set CAP_LARGE_READ_X, cap
|
||||
default rsize at MaxBufferSize
|
||||
|
||||
commit ec01d738a1691dfc85b96b9f796020267a7be577 upstream.
|
||||
|
||||
When the server doesn't advertise CAP_LARGE_READ_X, then MS-CIFS states
|
||||
that you must cap the size of the read at the client's MaxBufferSize.
|
||||
Unfortunately, testing with many older servers shows that they often
|
||||
can't service a read larger than their own MaxBufferSize.
|
||||
|
||||
Since we can't assume what the server will do in this situation, we must
|
||||
be conservative here for the default. When the server can't do large
|
||||
reads, then assume that it can't satisfy any read larger than its
|
||||
MaxBufferSize either.
|
||||
|
||||
Luckily almost all modern servers can do large reads, so this won't
|
||||
affect them. This is really just for older win9x and OS/2 era servers.
|
||||
Also, note that this patch just governs the default rsize. The admin can
|
||||
always override this if he so chooses.
|
||||
|
||||
Reported-by: David H. Durgee <dhdurgee@acm.org>
|
||||
Signed-off-by: Jeff Layton <jlayton@redhat.com>
|
||||
Signed-off-by: Steven French <sfrench@w500smf.(none)>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/cifs/connect.c | 9 +++------
|
||||
1 file changed, 3 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
|
||||
index 9e0675a..b21670c 100644
|
||||
--- a/fs/cifs/connect.c
|
||||
+++ b/fs/cifs/connect.c
|
||||
@@ -2975,18 +2975,15 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
|
||||
* MS-CIFS indicates that servers are only limited by the client's
|
||||
* bufsize for reads, testing against win98se shows that it throws
|
||||
* INVALID_PARAMETER errors if you try to request too large a read.
|
||||
+ * OS/2 just sends back short reads.
|
||||
*
|
||||
- * If the server advertises a MaxBufferSize of less than one page,
|
||||
- * assume that it also can't satisfy reads larger than that either.
|
||||
- *
|
||||
- * FIXME: Is there a better heuristic for this?
|
||||
+ * If the server doesn't advertise CAP_LARGE_READ_X, then assume that
|
||||
+ * it can't handle a read request larger than its MaxBufferSize either.
|
||||
*/
|
||||
if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_READ_CAP))
|
||||
defsize = CIFS_DEFAULT_IOSIZE;
|
||||
else if (server->capabilities & CAP_LARGE_READ_X)
|
||||
defsize = CIFS_DEFAULT_NON_POSIX_RSIZE;
|
||||
- else if (server->maxBuf >= PAGE_CACHE_SIZE)
|
||||
- defsize = CIFSMaxBufSize;
|
||||
else
|
||||
defsize = server->maxBuf - sizeof(READ_RSP);
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
From 605e639247e5f40be06b013748769bd2cc252e04 Mon Sep 17 00:00:00 2001
|
||||
From: Junxiao Bi <junxiao.bi@oracle.com>
|
||||
Date: Wed, 27 Jun 2012 17:09:55 +0800
|
||||
Subject: [PATCH 43/49] ocfs2: clear unaligned io flag when dio fails
|
||||
|
||||
commit 3e5d3c35a68c9a933bdbdd8685bd1a205b57e806 upstream.
|
||||
|
||||
The unaligned io flag is set in the kiocb when an unaligned
|
||||
dio is issued, it should be cleared even when the dio fails,
|
||||
or it may affect the following io which are using the same
|
||||
kiocb.
|
||||
|
||||
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
|
||||
Signed-off-by: Joel Becker <jlbec@evilplan.org>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/ocfs2/file.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
|
||||
index 6e39668..07ee5b4 100644
|
||||
--- a/fs/ocfs2/file.c
|
||||
+++ b/fs/ocfs2/file.c
|
||||
@@ -2422,8 +2422,10 @@ out_dio:
|
||||
unaligned_dio = 0;
|
||||
}
|
||||
|
||||
- if (unaligned_dio)
|
||||
+ if (unaligned_dio) {
|
||||
+ ocfs2_iocb_clear_unaligned_aio(iocb);
|
||||
atomic_dec(&OCFS2_I(inode)->ip_unaligned_aio);
|
||||
+ }
|
||||
|
||||
out:
|
||||
if (rw_level != -1)
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
From 21dbeb828448f788ffb3590cf6706c074bb1048f Mon Sep 17 00:00:00 2001
|
||||
From: Junxiao Bi <junxiao.bi@oracle.com>
|
||||
Date: Wed, 27 Jun 2012 17:09:54 +0800
|
||||
Subject: [PATCH 44/49] aio: make kiocb->private NUll in init_sync_kiocb()
|
||||
|
||||
commit 2dfd06036ba7ae8e7be2daf5a2fff1dac42390bf upstream.
|
||||
|
||||
Ocfs2 uses kiocb.*private as a flag of unsigned long size. In
|
||||
commit a11f7e6 ocfs2: serialize unaligned aio, the unaligned
|
||||
io flag is involved in it to serialize the unaligned aio. As
|
||||
*private is not initialized in init_sync_kiocb() of do_sync_write(),
|
||||
this unaligned io flag may be unexpectly set in an aligned dio.
|
||||
And this will cause OCFS2_I(inode)->ip_unaligned_aio decreased
|
||||
to -1 in ocfs2_dio_end_io(), thus the following unaligned dio
|
||||
will hang forever at ocfs2_aiodio_wait() in ocfs2_file_aio_write().
|
||||
|
||||
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
|
||||
Acked-by: Jeff Moyer <jmoyer@redhat.com>
|
||||
Signed-off-by: Joel Becker <jlbec@evilplan.org>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
include/linux/aio.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/include/linux/aio.h b/include/linux/aio.h
|
||||
index 2314ad8..b1a520e 100644
|
||||
--- a/include/linux/aio.h
|
||||
+++ b/include/linux/aio.h
|
||||
@@ -140,6 +140,7 @@ struct kiocb {
|
||||
(x)->ki_dtor = NULL; \
|
||||
(x)->ki_obj.tsk = tsk; \
|
||||
(x)->ki_user_data = 0; \
|
||||
+ (x)->private = NULL; \
|
||||
} while (0)
|
||||
|
||||
#define AIO_RING_MAGIC 0xa10a10a1
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
From e48907a3c090265dcbe0965537bbe9b510a1f7ef Mon Sep 17 00:00:00 2001
|
||||
From: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Date: Sat, 9 Jun 2012 19:08:25 +0300
|
||||
Subject: [PATCH 45/49] mtd: cafe_nand: fix an & vs | mistake
|
||||
|
||||
commit 48f8b641297df49021093763a3271119a84990a2 upstream.
|
||||
|
||||
The intent here was clearly to set result to true if the 0x40000000 flag
|
||||
was set. But instead there was a | vs & typo and we always set result
|
||||
to true.
|
||||
|
||||
Artem: check the spec at
|
||||
wiki.laptop.org/images/5/5c/88ALP01_Datasheet_July_2007.pdf
|
||||
and this fix looks correct.
|
||||
|
||||
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
|
||||
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/mtd/nand/cafe_nand.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
|
||||
index 72d3f23..68ecf48 100644
|
||||
--- a/drivers/mtd/nand/cafe_nand.c
|
||||
+++ b/drivers/mtd/nand/cafe_nand.c
|
||||
@@ -102,7 +102,7 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
|
||||
static int cafe_device_ready(struct mtd_info *mtd)
|
||||
{
|
||||
struct cafe_priv *cafe = mtd->priv;
|
||||
- int result = !!(cafe_readl(cafe, NAND_STATUS) | 0x40000000);
|
||||
+ int result = !!(cafe_readl(cafe, NAND_STATUS) & 0x40000000);
|
||||
uint32_t irqs = cafe_readl(cafe, NAND_IRQ);
|
||||
|
||||
cafe_writel(cafe, irqs, NAND_IRQ);
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
From 565460286859b1512972fc637f2c653cf648d622 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Lutomirski <luto@amacapital.net>
|
||||
Date: Thu, 5 Jul 2012 16:00:11 -0700
|
||||
Subject: [PATCH 46/49] mm: Hold a file reference in madvise_remove
|
||||
|
||||
commit 9ab4233dd08036fe34a89c7dc6f47a8bf2eb29eb upstream.
|
||||
|
||||
Otherwise the code races with munmap (causing a use-after-free
|
||||
of the vma) or with close (causing a use-after-free of the struct
|
||||
file).
|
||||
|
||||
The bug was introduced by commit 90ed52ebe481 ("[PATCH] holepunch: fix
|
||||
mmap_sem i_mutex deadlock")
|
||||
|
||||
Cc: Hugh Dickins <hugh@veritas.com>
|
||||
Cc: Miklos Szeredi <mszeredi@suse.cz>
|
||||
Cc: Badari Pulavarty <pbadari@us.ibm.com>
|
||||
Cc: Nick Piggin <npiggin@suse.de>
|
||||
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
|
||||
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
[bwh: Backported to 3.2:
|
||||
- Adjust context
|
||||
- madvise_remove() calls vmtruncate_range(), not do_fallocate()]
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
mm/madvise.c | 16 +++++++++++++---
|
||||
1 file changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/mm/madvise.c b/mm/madvise.c
|
||||
index 74bf193..23d3a6b 100644
|
||||
--- a/mm/madvise.c
|
||||
+++ b/mm/madvise.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <linux/hugetlb.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/ksm.h>
|
||||
+#include <linux/file.h>
|
||||
|
||||
/*
|
||||
* Any behaviour which results in changes to the vma->vm_flags needs to
|
||||
@@ -197,14 +198,16 @@ static long madvise_remove(struct vm_area_struct *vma,
|
||||
struct address_space *mapping;
|
||||
loff_t offset, endoff;
|
||||
int error;
|
||||
+ struct file *f;
|
||||
|
||||
*prev = NULL; /* tell sys_madvise we drop mmap_sem */
|
||||
|
||||
if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB))
|
||||
return -EINVAL;
|
||||
|
||||
- if (!vma->vm_file || !vma->vm_file->f_mapping
|
||||
- || !vma->vm_file->f_mapping->host) {
|
||||
+ f = vma->vm_file;
|
||||
+
|
||||
+ if (!f || !f->f_mapping || !f->f_mapping->host) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -218,9 +221,16 @@ static long madvise_remove(struct vm_area_struct *vma,
|
||||
endoff = (loff_t)(end - vma->vm_start - 1)
|
||||
+ ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
|
||||
|
||||
- /* vmtruncate_range needs to take i_mutex */
|
||||
+ /*
|
||||
+ * vmtruncate_range may need to take i_mutex. We need to
|
||||
+ * explicitly grab a reference because the vma (and hence the
|
||||
+ * vma's reference to the file) can go away as soon as we drop
|
||||
+ * mmap_sem.
|
||||
+ */
|
||||
+ get_file(f);
|
||||
up_read(¤t->mm->mmap_sem);
|
||||
error = vmtruncate_range(mapping->host, offset, endoff);
|
||||
+ fput(f);
|
||||
down_read(¤t->mm->mmap_sem);
|
||||
return error;
|
||||
}
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
From 7b764186beda304507cde2161d84f4e9b16c8ce6 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Rustad <mark.d.rustad@intel.com>
|
||||
Date: Tue, 26 Jun 2012 15:57:30 -0700
|
||||
Subject: [PATCH 47/49] tcm_fc: Resolve suspicious RCU usage warnings
|
||||
|
||||
commit 863555be0c81558b1af277addcf68acb8f778860 upstream.
|
||||
|
||||
Use rcu_dereference_protected to tell rcu that the ft_lport_lock
|
||||
is held during ft_lport_create. This resolved "suspicious RCU usage"
|
||||
warnings when debugging options are turned on.
|
||||
|
||||
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
|
||||
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
|
||||
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/target/tcm_fc/tfc_sess.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c
|
||||
index 3269213..64ddb63 100644
|
||||
--- a/drivers/target/tcm_fc/tfc_sess.c
|
||||
+++ b/drivers/target/tcm_fc/tfc_sess.c
|
||||
@@ -61,7 +61,8 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport)
|
||||
struct ft_tport *tport;
|
||||
int i;
|
||||
|
||||
- tport = rcu_dereference(lport->prov[FC_TYPE_FCP]);
|
||||
+ tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP],
|
||||
+ lockdep_is_held(&ft_lport_lock));
|
||||
if (tport && tport->tpg)
|
||||
return tport;
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
From 7c0f859e15ad91f6d6921970fc9d48f1f7804bf9 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Date: Sat, 7 Jul 2012 10:17:00 -0700
|
||||
Subject: [PATCH 48/49] vfs: make O_PATH file descriptors usable for
|
||||
'fchdir()'
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
commit 332a2e1244bd08b9e3ecd378028513396a004a24 upstream.
|
||||
|
||||
We already use them for openat() and friends, but fchdir() also wants to
|
||||
be able to use O_PATH file descriptors. This should make it comparable
|
||||
to the O_SEARCH of Solaris. In particular, O_PATH allows you to access
|
||||
(not-quite-open) a directory you don't have read persmission to, only
|
||||
execute permission.
|
||||
|
||||
Noticed during development of multithread support for ksh93.
|
||||
|
||||
Reported-by: ольга крыжановская <olga.kryzhanovska@gmail.com>
|
||||
Cc: Al Viro <viro@zeniv.linux.org.uk>
|
||||
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
fs/open.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/fs/open.c b/fs/open.c
|
||||
index 22c41b5..e2b5d51 100644
|
||||
--- a/fs/open.c
|
||||
+++ b/fs/open.c
|
||||
@@ -396,10 +396,10 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
|
||||
{
|
||||
struct file *file;
|
||||
struct inode *inode;
|
||||
- int error;
|
||||
+ int error, fput_needed;
|
||||
|
||||
error = -EBADF;
|
||||
- file = fget(fd);
|
||||
+ file = fget_raw_light(fd, &fput_needed);
|
||||
if (!file)
|
||||
goto out;
|
||||
|
||||
@@ -413,7 +413,7 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
|
||||
if (!error)
|
||||
set_fs_pwd(current->fs, &file->f_path);
|
||||
out_putf:
|
||||
- fput(file);
|
||||
+ fput_light(file, fput_needed);
|
||||
out:
|
||||
return error;
|
||||
}
|
||||
--
|
||||
1.7.10
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From 70aac971ed12a5a23e0b10035df743f2ada81151 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Thu, 12 Jul 2012 04:32:21 +0100
|
||||
Subject: [PATCH 49/49] Linux 3.2.23
|
||||
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 9a7d921..40d1e3b 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 3
|
||||
PATCHLEVEL = 2
|
||||
-SUBLEVEL = 22
|
||||
+SUBLEVEL = 23
|
||||
EXTRAVERSION =
|
||||
NAME = Saber-toothed Squirrel
|
||||
|
||||
--
|
||||
1.7.10
|
||||
|
||||
Reference in New Issue
Block a user