From: Greg Kroah-Hartman Date: Mon, 26 Aug 2013 12:45:12 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.94~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bbeec00a11f457b2533acd302a82565394d54e9e;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: nilfs2-fix-issue-with-counting-number-of-bio-requests-for-bio_eopnotsupp-error-detection.patch nilfs2-remove-double-bio_put-in-nilfs_end_bio_write-for-bio_eopnotsupp-error.patch of-fdt-fix-memory-initialization-for-expanded-dt.patch xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch zd1201-do-not-use-stack-as-urb-transfer_buffer.patch --- diff --git a/queue-3.0/nilfs2-fix-issue-with-counting-number-of-bio-requests-for-bio_eopnotsupp-error-detection.patch b/queue-3.0/nilfs2-fix-issue-with-counting-number-of-bio-requests-for-bio_eopnotsupp-error-detection.patch new file mode 100644 index 00000000000..c199e876b72 --- /dev/null +++ b/queue-3.0/nilfs2-fix-issue-with-counting-number-of-bio-requests-for-bio_eopnotsupp-error-detection.patch @@ -0,0 +1,53 @@ +From 4bf93b50fd04118ac7f33a3c2b8a0a1f9fa80bc9 Mon Sep 17 00:00:00 2001 +From: Vyacheslav Dubeyko +Date: Thu, 22 Aug 2013 16:35:45 -0700 +Subject: nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection + +From: Vyacheslav Dubeyko + +commit 4bf93b50fd04118ac7f33a3c2b8a0a1f9fa80bc9 upstream. + +Fix the issue with improper counting number of flying bio requests for +BIO_EOPNOTSUPP error detection case. + +The sb_nbio must be incremented exactly the same number of times as +complete() function was called (or will be called) because +nilfs_segbuf_wait() will call wail_for_completion() for the number of +times set to sb_nbio: + + do { + wait_for_completion(&segbuf->sb_bio_event); + } while (--segbuf->sb_nbio > 0); + +Two functions complete() and wait_for_completion() must be called the +same number of times for the same sb_bio_event. Otherwise, +wait_for_completion() will hang or leak. + +Signed-off-by: Vyacheslav Dubeyko +Cc: Dan Carpenter +Acked-by: Ryusuke Konishi +Tested-by: Ryusuke Konishi +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nilfs2/segbuf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nilfs2/segbuf.c ++++ b/fs/nilfs2/segbuf.c +@@ -376,12 +376,12 @@ static int nilfs_segbuf_submit_bio(struc + bio->bi_private = segbuf; + bio_get(bio); + submit_bio(mode, bio); ++ segbuf->sb_nbio++; + if (bio_flagged(bio, BIO_EOPNOTSUPP)) { + bio_put(bio); + err = -EOPNOTSUPP; + goto failed; + } +- segbuf->sb_nbio++; + bio_put(bio); + + wi->bio = NULL; diff --git a/queue-3.0/nilfs2-remove-double-bio_put-in-nilfs_end_bio_write-for-bio_eopnotsupp-error.patch b/queue-3.0/nilfs2-remove-double-bio_put-in-nilfs_end_bio_write-for-bio_eopnotsupp-error.patch new file mode 100644 index 00000000000..059afa47ac5 --- /dev/null +++ b/queue-3.0/nilfs2-remove-double-bio_put-in-nilfs_end_bio_write-for-bio_eopnotsupp-error.patch @@ -0,0 +1,37 @@ +From 2df37a19c686c2d7c4e9b4ce1505b5141e3e5552 Mon Sep 17 00:00:00 2001 +From: Vyacheslav Dubeyko +Date: Thu, 22 Aug 2013 16:35:44 -0700 +Subject: nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error + +From: Vyacheslav Dubeyko + +commit 2df37a19c686c2d7c4e9b4ce1505b5141e3e5552 upstream. + +Remove double call of bio_put() in nilfs_end_bio_write() for the case of +BIO_EOPNOTSUPP error detection. The issue was found by Dan Carpenter +and he suggests first version of the fix too. + +Signed-off-by: Vyacheslav Dubeyko +Reported-by: Dan Carpenter +Acked-by: Ryusuke Konishi +Tested-by: Ryusuke Konishi +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nilfs2/segbuf.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/fs/nilfs2/segbuf.c ++++ b/fs/nilfs2/segbuf.c +@@ -345,8 +345,7 @@ static void nilfs_end_bio_write(struct b + + if (err == -EOPNOTSUPP) { + set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); +- bio_put(bio); +- /* to be detected by submit_seg_bio() */ ++ /* to be detected by nilfs_segbuf_submit_bio() */ + } + + if (!uptodate) diff --git a/queue-3.0/of-fdt-fix-memory-initialization-for-expanded-dt.patch b/queue-3.0/of-fdt-fix-memory-initialization-for-expanded-dt.patch new file mode 100644 index 00000000000..a78cedbf6c9 --- /dev/null +++ b/queue-3.0/of-fdt-fix-memory-initialization-for-expanded-dt.patch @@ -0,0 +1,52 @@ +From 9e40127526e857fa3f29d51e83277204fbdfc6ba Mon Sep 17 00:00:00 2001 +From: Wladislav Wiebe +Date: Mon, 12 Aug 2013 13:06:53 +0200 +Subject: of: fdt: fix memory initialization for expanded DT + +From: Wladislav Wiebe + +commit 9e40127526e857fa3f29d51e83277204fbdfc6ba upstream. + +Already existing property flags are filled wrong for properties created from +initial FDT. This could cause problems if this DYNAMIC device-tree functions +are used later, i.e. properties are attached/detached/replaced. Simply dumping +flags from the running system show, that some initial static (not allocated via +kzmalloc()) nodes are marked as dynamic. + +I putted some debug extensions to property_proc_show(..) : +.. ++ if (OF_IS_DYNAMIC(pp)) ++ pr_err("DEBUG: xxx : OF_IS_DYNAMIC\n"); ++ if (OF_IS_DETACHED(pp)) ++ pr_err("DEBUG: xxx : OF_IS_DETACHED\n"); + +when you operate on the nodes (e.g.: ~$ cat /proc/device-tree/*some_node*) you +will see that those flags are filled wrong, basically in most cases it will dump +a DYNAMIC or DETACHED status, which is in not true. +(BTW. this OF_IS_DETACHED is a own define for debug purposes which which just +make a test_bit(OF_DETACHED, &x->_flags) + +If nodes are dynamic kernel is allowed to kfree() them. But it will crash +attempting to do so on the nodes from FDT -- they are not allocated via +kzmalloc(). + +Signed-off-by: Wladislav Wiebe +Acked-by: Alexander Sverdlin +Signed-off-by: Rob Herring +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/of/fdt.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -389,6 +389,8 @@ static void __unflatten_device_tree(stru + mem = (unsigned long) + dt_alloc(size + 4, __alignof__(struct device_node)); + ++ memset((void *)mem, 0, size); ++ + ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef); + + pr_debug(" unflattening %lx...\n", mem); diff --git a/queue-3.0/series b/queue-3.0/series index e69de29bb2d..2f2a79fa179 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -0,0 +1,5 @@ +zd1201-do-not-use-stack-as-urb-transfer_buffer.patch +xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch +of-fdt-fix-memory-initialization-for-expanded-dt.patch +nilfs2-remove-double-bio_put-in-nilfs_end_bio_write-for-bio_eopnotsupp-error.patch +nilfs2-fix-issue-with-counting-number-of-bio-requests-for-bio_eopnotsupp-error-detection.patch diff --git a/queue-3.0/xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch b/queue-3.0/xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch new file mode 100644 index 00000000000..ec4cd38de45 --- /dev/null +++ b/queue-3.0/xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch @@ -0,0 +1,43 @@ +From 84ca7a8e45dafb49cd5ca90a343ba033e2885c17 Mon Sep 17 00:00:00 2001 +From: David Vrabel +Date: Thu, 15 Aug 2013 13:21:06 +0100 +Subject: xen/events: initialize local per-cpu mask for all possible events + +From: David Vrabel + +commit 84ca7a8e45dafb49cd5ca90a343ba033e2885c17 upstream. + +The sizeof() argument in init_evtchn_cpu_bindings() is incorrect +resulting in only the first 64 (or 32 in 32-bit guests) ports having +their bindings being initialized to VCPU 0. + +In most cases this does not cause a problem as request_irq() will set +the irq affinity which will set the correct local per-cpu mask. +However, if the request_irq() is called on a VCPU other than 0, there +is a window between the unmasking of the event and the affinity being +set were an event may be lost because it is not locally unmasked on +any VCPU. If request_irq() is called on VCPU 0 then local irqs are +disabled during the window and the race does not occur. + +Fix this by initializing all NR_EVENT_CHANNEL bits in the local +per-cpu masks. + +Signed-off-by: David Vrabel +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/xen/events.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/xen/events.c ++++ b/drivers/xen/events.c +@@ -317,7 +317,7 @@ static void init_evtchn_cpu_bindings(voi + + for_each_possible_cpu(i) + memset(per_cpu(cpu_evtchn_mask, i), +- (i == 0) ? ~0 : 0, sizeof(*per_cpu(cpu_evtchn_mask, i))); ++ (i == 0) ? ~0 : 0, NR_EVENT_CHANNELS/8); + } + + static inline void clear_evtchn(int port) diff --git a/queue-3.0/zd1201-do-not-use-stack-as-urb-transfer_buffer.patch b/queue-3.0/zd1201-do-not-use-stack-as-urb-transfer_buffer.patch new file mode 100644 index 00000000000..9e9351796e1 --- /dev/null +++ b/queue-3.0/zd1201-do-not-use-stack-as-urb-transfer_buffer.patch @@ -0,0 +1,38 @@ +From 1206ff4ff9d2ef7468a355328bc58ac6ebf5be44 Mon Sep 17 00:00:00 2001 +From: Jussi Kivilinna +Date: Tue, 6 Aug 2013 14:28:42 +0300 +Subject: zd1201: do not use stack as URB transfer_buffer + +From: Jussi Kivilinna + +commit 1206ff4ff9d2ef7468a355328bc58ac6ebf5be44 upstream. + +Patch fixes zd1201 not to use stack as URB transfer_buffer. URB buffers need +to be DMA-able, which stack is not. + +Patch is only compile tested. + +Signed-off-by: Jussi Kivilinna +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/zd1201.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/zd1201.c ++++ b/drivers/net/wireless/zd1201.c +@@ -98,10 +98,12 @@ static int zd1201_fw_upload(struct usb_d + goto exit; + + err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4, +- USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT); ++ USB_DIR_IN | 0x40, 0, 0, buf, sizeof(ret), ZD1201_FW_TIMEOUT); + if (err < 0) + goto exit; + ++ memcpy(&ret, buf, sizeof(ret)); ++ + if (ret & 0x80) { + err = -EIO; + goto exit;