From: Greg Kroah-Hartman Date: Mon, 26 Aug 2013 12:45:33 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.0.94~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2a9d604e02de024290f6c79d445ce9c003a9eeb;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: drm-i915-invalidate-tlbs-for-the-rings-after-a-reset.patch 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.4/drm-i915-invalidate-tlbs-for-the-rings-after-a-reset.patch b/queue-3.4/drm-i915-invalidate-tlbs-for-the-rings-after-a-reset.patch new file mode 100644 index 00000000000..7a9144a5eef --- /dev/null +++ b/queue-3.4/drm-i915-invalidate-tlbs-for-the-rings-after-a-reset.patch @@ -0,0 +1,65 @@ +From 884020bf3d2a3787a1cc6df902e98e0eec60330b Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Tue, 6 Aug 2013 19:01:14 +0100 +Subject: drm/i915: Invalidate TLBs for the rings after a reset + +From: Chris Wilson + +commit 884020bf3d2a3787a1cc6df902e98e0eec60330b upstream. + +After any "soft gfx reset" we must manually invalidate the TLBs +associated with each ring. Empirically, it seems that a +suspend/resume or D3-D0 cycle count as a "soft reset". The symptom is +that the hardware would fail to note the new address for its status +page, and so it would continue to write the shadow registers and +breadcrumbs into the old physical address (now used by something +completely different, scary). Whereas the driver would read the new +status page and never see any progress, it would appear that the GPU +hung immediately upon resume. + +Based on a patch by naresh kumar kachhi + +Reported-by: Thiago Macieira +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64725 +Signed-off-by: Chris Wilson +Tested-by: Thiago Macieira +Signed-off-by: Daniel Vetter +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_reg.h | 2 ++ + drivers/gpu/drm/i915/intel_ringbuffer.c | 12 ++++++++++++ + 2 files changed, 14 insertions(+) + +--- a/drivers/gpu/drm/i915/i915_reg.h ++++ b/drivers/gpu/drm/i915/i915_reg.h +@@ -502,6 +502,8 @@ + will not assert AGPBUSY# and will only + be delivered when out of C3. */ + #define INSTPM_FORCE_ORDERING (1<<7) /* GEN6+ */ ++#define INSTPM_TLB_INVALIDATE (1<<9) ++#define INSTPM_SYNC_FLUSH (1<<5) + #define ACTHD 0x020c8 + #define FW_BLC 0x020d8 + #define FW_BLC2 0x020dc +--- a/drivers/gpu/drm/i915/intel_ringbuffer.c ++++ b/drivers/gpu/drm/i915/intel_ringbuffer.c +@@ -767,6 +767,18 @@ void intel_ring_setup_status_page(struct + + I915_WRITE(mmio, (u32)ring->status_page.gfx_addr); + POSTING_READ(mmio); ++ ++ /* Flush the TLB for this page */ ++ if (INTEL_INFO(dev)->gen >= 6) { ++ u32 reg = RING_INSTPM(ring->mmio_base); ++ I915_WRITE(reg, ++ _MASKED_BIT_ENABLE(INSTPM_TLB_INVALIDATE | ++ INSTPM_SYNC_FLUSH)); ++ if (wait_for((I915_READ(reg) & INSTPM_SYNC_FLUSH) == 0, ++ 1000)) ++ DRM_ERROR("%s: wait for SyncFlush to complete for TLB invalidation timed out\n", ++ ring->name); ++ } + } + + static int diff --git a/queue-3.4/nilfs2-fix-issue-with-counting-number-of-bio-requests-for-bio_eopnotsupp-error-detection.patch b/queue-3.4/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.4/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.4/nilfs2-remove-double-bio_put-in-nilfs_end_bio_write-for-bio_eopnotsupp-error.patch b/queue-3.4/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.4/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.4/of-fdt-fix-memory-initialization-for-expanded-dt.patch b/queue-3.4/of-fdt-fix-memory-initialization-for-expanded-dt.patch new file mode 100644 index 00000000000..e8df9bfe8d9 --- /dev/null +++ b/queue-3.4/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 +@@ -390,6 +390,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.4/series b/queue-3.4/series index fcb054863ac..2d290bccd65 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -1,2 +1,8 @@ workqueue-fix-possible-stall-on-try_to_grab_pending-of-a-delayed-work-item.patch workqueue-consider-work-function-when-searching-for-busy-work-items.patch +zd1201-do-not-use-stack-as-urb-transfer_buffer.patch +xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch +drm-i915-invalidate-tlbs-for-the-rings-after-a-reset.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.4/xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch b/queue-3.4/xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch new file mode 100644 index 00000000000..66835c15c7b --- /dev/null +++ b/queue-3.4/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 +@@ -324,7 +324,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.4/zd1201-do-not-use-stack-as-urb-transfer_buffer.patch b/queue-3.4/zd1201-do-not-use-stack-as-urb-transfer_buffer.patch new file mode 100644 index 00000000000..9e9351796e1 --- /dev/null +++ b/queue-3.4/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;