From: Greg Kroah-Hartman Date: Tue, 7 Feb 2012 01:26:32 +0000 (-0800) Subject: 3.2-stable patches X-Git-Tag: v3.0.21~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1954c9efd69e79b6c0074010e014a0823eb0b31;p=thirdparty%2Fkernel%2Fstable-queue.git 3.2-stable patches added patches: 8139cp-fix-missing-napi_gro_flush.patch drm-i915-check-acthd-of-all-rings.patch drm-i915-convert-force_wake_get-to-func-pointer-in-the-gpu-reset-code.patch drm-i915-displayport-hot-remove-notification-to-audio-driver.patch drm-i915-fix-tv-out-refresh-rate.patch drm-i915-handle-3rd-pipe.patch drm-i915-hdmi-hot-remove-notification-to-audio-driver.patch drm-i915-protect-force_wake_-get-put-with-the-gt_lock.patch ecryptfs-infinite-loop-due-to-overflow-in-ecryptfs_write.patch udf-mark-lvid-buffer-as-uptodate-before-marking-it-dirty.patch --- diff --git a/queue-3.2/8139cp-fix-missing-napi_gro_flush.patch b/queue-3.2/8139cp-fix-missing-napi_gro_flush.patch new file mode 100644 index 00000000000..09202bf80d9 --- /dev/null +++ b/queue-3.2/8139cp-fix-missing-napi_gro_flush.patch @@ -0,0 +1,31 @@ +From b189e810619a676e6b931a942a3e8387f3d39c21 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?fran=C3=A7ois=20romieu?= +Date: Sun, 8 Jan 2012 13:41:33 +0000 +Subject: 8139cp: fix missing napi_gro_flush. + +From: Francois Romieu + +commit b189e810619a676e6b931a942a3e8387f3d39c21 upstream. + +The driver uses __napi_complete and napi_gro_receive. Without it, the +driver hits the BUG_ON(n->gro_list) assertion hard in __napi_complete. + +Signed-off-by: Francois Romieu +Tested-by: Marin Glibic +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/realtek/8139cp.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/realtek/8139cp.c ++++ b/drivers/net/ethernet/realtek/8139cp.c +@@ -563,6 +563,7 @@ rx_next: + if (cpr16(IntrStatus) & cp_rx_intr_mask) + goto rx_status_loop; + ++ napi_gro_flush(napi); + spin_lock_irqsave(&cp->lock, flags); + __napi_complete(napi); + cpw16_f(IntrMask, cp_intr_mask); diff --git a/queue-3.2/drm-i915-check-acthd-of-all-rings.patch b/queue-3.2/drm-i915-check-acthd-of-all-rings.patch new file mode 100644 index 00000000000..3efe6b64ee8 --- /dev/null +++ b/queue-3.2/drm-i915-check-acthd-of-all-rings.patch @@ -0,0 +1,89 @@ +From 097354eb14fa94d31a09c64d640643f58e4a5a9a Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Sun, 27 Nov 2011 18:58:17 +0100 +Subject: drm/i915: check ACTHD of all rings + +From: Daniel Vetter + +commit 097354eb14fa94d31a09c64d640643f58e4a5a9a upstream. + +Otherwise hangcheck spuriously fires when running blitter/bsd-only +workloads. + +Contrary to a similar patch by Ben Widawsky this does not check +INSTDONE of the other rings. Chris Wilson implied that in a failure to +detect a hang, most likely because INSTDONE was fluctuating. Thus only +check ACTHD, which as far as I know is rather reliable. Also, blitter +and bsd rings can't launch complex tasks from a single instruction +(like 3D_PRIM on the render with complex or even infinite shaders). + +This fixes spurious gpu hang detection when running +tests/gem_hangcheck_forcewake on snb/ivb. + +Signed-Off-by: Daniel Vetter +Reviewed-by: Chris Wilson +Signed-off-by: Keith Packard +Signed-off-by: Eugeni Dodonov +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/gpu/drm/i915/i915_drv.h | 2 ++ + drivers/gpu/drm/i915/i915_irq.c | 13 ++++++++++--- + 2 files changed, 12 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_drv.h ++++ b/drivers/gpu/drm/i915/i915_drv.h +@@ -337,6 +337,8 @@ typedef struct drm_i915_private { + struct timer_list hangcheck_timer; + int hangcheck_count; + uint32_t last_acthd; ++ uint32_t last_acthd_bsd; ++ uint32_t last_acthd_blt; + uint32_t last_instdone; + uint32_t last_instdone1; + +--- a/drivers/gpu/drm/i915/i915_irq.c ++++ b/drivers/gpu/drm/i915/i915_irq.c +@@ -1669,7 +1669,7 @@ void i915_hangcheck_elapsed(unsigned lon + { + struct drm_device *dev = (struct drm_device *)data; + drm_i915_private_t *dev_priv = dev->dev_private; +- uint32_t acthd, instdone, instdone1; ++ uint32_t acthd, instdone, instdone1, acthd_bsd, acthd_blt; + bool err = false; + + if (!i915_enable_hangcheck) +@@ -1686,16 +1686,21 @@ void i915_hangcheck_elapsed(unsigned lon + } + + if (INTEL_INFO(dev)->gen < 4) { +- acthd = I915_READ(ACTHD); + instdone = I915_READ(INSTDONE); + instdone1 = 0; + } else { +- acthd = I915_READ(ACTHD_I965); + instdone = I915_READ(INSTDONE_I965); + instdone1 = I915_READ(INSTDONE1); + } ++ acthd = intel_ring_get_active_head(&dev_priv->ring[RCS]); ++ acthd_bsd = HAS_BSD(dev) ? ++ intel_ring_get_active_head(&dev_priv->ring[VCS]) : 0; ++ acthd_blt = HAS_BLT(dev) ? ++ intel_ring_get_active_head(&dev_priv->ring[BCS]) : 0; + + if (dev_priv->last_acthd == acthd && ++ dev_priv->last_acthd_bsd == acthd_bsd && ++ dev_priv->last_acthd_blt == acthd_blt && + dev_priv->last_instdone == instdone && + dev_priv->last_instdone1 == instdone1) { + if (dev_priv->hangcheck_count++ > 1) { +@@ -1727,6 +1732,8 @@ void i915_hangcheck_elapsed(unsigned lon + dev_priv->hangcheck_count = 0; + + dev_priv->last_acthd = acthd; ++ dev_priv->last_acthd_bsd = acthd_bsd; ++ dev_priv->last_acthd_blt = acthd_blt; + dev_priv->last_instdone = instdone; + dev_priv->last_instdone1 = instdone1; + } diff --git a/queue-3.2/drm-i915-convert-force_wake_get-to-func-pointer-in-the-gpu-reset-code.patch b/queue-3.2/drm-i915-convert-force_wake_get-to-func-pointer-in-the-gpu-reset-code.patch new file mode 100644 index 00000000000..74bda1786fa --- /dev/null +++ b/queue-3.2/drm-i915-convert-force_wake_get-to-func-pointer-in-the-gpu-reset-code.patch @@ -0,0 +1,39 @@ +From 8109021313c7a3d8947677391ce6ab9cd0bb1d28 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Fri, 13 Jan 2012 16:20:06 -0800 +Subject: drm/i915: convert force_wake_get to func pointer in the gpu reset code + +From: Daniel Vetter + +commit 8109021313c7a3d8947677391ce6ab9cd0bb1d28 upstream. + +This was forgotten in the original multi-threaded forcewake +conversion: + +commit 8d715f0024f64ad1b1be85d8c081cf577944c847 +Author: Keith Packard +Date: Fri Nov 18 20:39:01 2011 -0800 + + drm/i915: add multi-threaded forcewake support + +Signed-Off-by: Daniel Vetter +Reviewed-by: Eugeni Dodonov +Signed-off-by: Keith Packard +Signed-off-by: Eugeni Dodonov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_drv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -645,7 +645,7 @@ int i915_reset(struct drm_device *dev, u + ret = gen6_do_reset(dev, flags); + /* If reset with a user forcewake, try to restore */ + if (atomic_read(&dev_priv->forcewake_count)) +- __gen6_gt_force_wake_get(dev_priv); ++ dev_priv->display.force_wake_get(dev_priv); + break; + case 5: + ret = ironlake_do_reset(dev, flags); diff --git a/queue-3.2/drm-i915-displayport-hot-remove-notification-to-audio-driver.patch b/queue-3.2/drm-i915-displayport-hot-remove-notification-to-audio-driver.patch new file mode 100644 index 00000000000..767a0546e34 --- /dev/null +++ b/queue-3.2/drm-i915-displayport-hot-remove-notification-to-audio-driver.patch @@ -0,0 +1,37 @@ +From 832afda6a7d7235ef0e09f4ec46736861540da6d Mon Sep 17 00:00:00 2001 +From: Wu Fengguang +Date: Fri, 9 Dec 2011 20:42:21 +0800 +Subject: drm/i915: DisplayPort hot remove notification to audio driver + +From: Wu Fengguang + +commit 832afda6a7d7235ef0e09f4ec46736861540da6d upstream. + +On DP monitor hot remove, clear DP_AUDIO_OUTPUT_ENABLE accordingly, +so that the audio driver will receive hot plug events and take action +to refresh its device state and ELD contents. + +Note that the DP_AUDIO_OUTPUT_ENABLE bit may be enabled or disabled +only when the link training is complete and set to "Normal". + +Tested OK for both hot plug/remove and DPMS on/off. + +Signed-off-by: Wu Fengguang +Signed-off-by: Keith Packard +Signed-off-by: Eugeni Dodonov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_dp.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -1926,6 +1926,7 @@ intel_dp_link_down(struct intel_dp *inte + intel_wait_for_vblank(dev, to_intel_crtc(crtc)->pipe); + } + ++ DP &= ~DP_AUDIO_OUTPUT_ENABLE; + I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); + POSTING_READ(intel_dp->output_reg); + msleep(intel_dp->panel_power_down_delay); diff --git a/queue-3.2/drm-i915-fix-tv-out-refresh-rate.patch b/queue-3.2/drm-i915-fix-tv-out-refresh-rate.patch new file mode 100644 index 00000000000..1cb55e48aca --- /dev/null +++ b/queue-3.2/drm-i915-fix-tv-out-refresh-rate.patch @@ -0,0 +1,96 @@ +From 23bd15ec662344dc10e9918fdd0dbc58bc71526d Mon Sep 17 00:00:00 2001 +From: Rodrigo Vivi +Date: Wed, 14 Dec 2011 21:10:06 -0200 +Subject: drm/i915: Fix TV Out refresh rate. + +From: Rodrigo Vivi + +commit 23bd15ec662344dc10e9918fdd0dbc58bc71526d upstream. + +TV Out refresh rate was half of the specification for almost all modes. +Due to this reason pixel clock was so low for some modes causing flickering screen. + +Signed-off-by: Rodrigo Vivi +Reviewed-by: Jesse Barnes +Signed-off-by: Keith Packard +Signed-off-by: Eugeni Dodonov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_tv.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_tv.c ++++ b/drivers/gpu/drm/i915/intel_tv.c +@@ -417,7 +417,7 @@ static const struct tv_mode tv_modes[] = + { + .name = "NTSC-M", + .clock = 108000, +- .refresh = 29970, ++ .refresh = 59940, + .oversample = TV_OVERSAMPLE_8X, + .component_only = 0, + /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ +@@ -460,7 +460,7 @@ static const struct tv_mode tv_modes[] = + { + .name = "NTSC-443", + .clock = 108000, +- .refresh = 29970, ++ .refresh = 59940, + .oversample = TV_OVERSAMPLE_8X, + .component_only = 0, + /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 4.43MHz */ +@@ -502,7 +502,7 @@ static const struct tv_mode tv_modes[] = + { + .name = "NTSC-J", + .clock = 108000, +- .refresh = 29970, ++ .refresh = 59940, + .oversample = TV_OVERSAMPLE_8X, + .component_only = 0, + +@@ -545,7 +545,7 @@ static const struct tv_mode tv_modes[] = + { + .name = "PAL-M", + .clock = 108000, +- .refresh = 29970, ++ .refresh = 59940, + .oversample = TV_OVERSAMPLE_8X, + .component_only = 0, + +@@ -589,7 +589,7 @@ static const struct tv_mode tv_modes[] = + /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */ + .name = "PAL-N", + .clock = 108000, +- .refresh = 25000, ++ .refresh = 50000, + .oversample = TV_OVERSAMPLE_8X, + .component_only = 0, + +@@ -634,7 +634,7 @@ static const struct tv_mode tv_modes[] = + /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */ + .name = "PAL", + .clock = 108000, +- .refresh = 25000, ++ .refresh = 50000, + .oversample = TV_OVERSAMPLE_8X, + .component_only = 0, + +@@ -821,7 +821,7 @@ static const struct tv_mode tv_modes[] = + { + .name = "1080i@50Hz", + .clock = 148800, +- .refresh = 25000, ++ .refresh = 50000, + .oversample = TV_OVERSAMPLE_2X, + .component_only = 1, + +@@ -847,7 +847,7 @@ static const struct tv_mode tv_modes[] = + { + .name = "1080i@60Hz", + .clock = 148800, +- .refresh = 30000, ++ .refresh = 60000, + .oversample = TV_OVERSAMPLE_2X, + .component_only = 1, + diff --git a/queue-3.2/drm-i915-handle-3rd-pipe.patch b/queue-3.2/drm-i915-handle-3rd-pipe.patch new file mode 100644 index 00000000000..63558e13e93 --- /dev/null +++ b/queue-3.2/drm-i915-handle-3rd-pipe.patch @@ -0,0 +1,35 @@ +From 07c1e8c1462fa7324de4c36ae9e55da2abd79cee Mon Sep 17 00:00:00 2001 +From: Eugeni Dodonov +Date: Sat, 7 Jan 2012 23:40:35 -0200 +Subject: drm/i915: handle 3rd pipe + +From: Eugeni Dodonov + +commit 07c1e8c1462fa7324de4c36ae9e55da2abd79cee upstream. + +We don't need to check 3rd pipe specifically, as it shares PLL with some +other one. + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41977 +Signed-off-by: Eugeni Dodonov +Reviewed-by: Jesse Barnes +Signed-off-by: Keith Packard +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_suspend.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/i915/i915_suspend.c ++++ b/drivers/gpu/drm/i915/i915_suspend.c +@@ -34,6 +34,10 @@ static bool i915_pipe_enabled(struct drm + struct drm_i915_private *dev_priv = dev->dev_private; + u32 dpll_reg; + ++ /* On IVB, 3rd pipe shares PLL with another one */ ++ if (pipe > 1) ++ return false; ++ + if (HAS_PCH_SPLIT(dev)) + dpll_reg = (pipe == PIPE_A) ? _PCH_DPLL_A : _PCH_DPLL_B; + else diff --git a/queue-3.2/drm-i915-hdmi-hot-remove-notification-to-audio-driver.patch b/queue-3.2/drm-i915-hdmi-hot-remove-notification-to-audio-driver.patch new file mode 100644 index 00000000000..946b072ffac --- /dev/null +++ b/queue-3.2/drm-i915-hdmi-hot-remove-notification-to-audio-driver.patch @@ -0,0 +1,51 @@ +From 2deed761188d7480eb5f7efbfe7aa77f09322ed8 Mon Sep 17 00:00:00 2001 +From: Wu Fengguang +Date: Fri, 9 Dec 2011 20:42:20 +0800 +Subject: drm/i915: HDMI hot remove notification to audio driver + +From: Wu Fengguang + +commit 2deed761188d7480eb5f7efbfe7aa77f09322ed8 upstream. + +On HDMI monitor hot remove, clear SDVO_AUDIO_ENABLE accordingly, so that +the audio driver will receive hot plug events and take action to refresh +its device state and ELD contents. + +The cleared SDVO_AUDIO_ENABLE bit needs to be restored to prevent losing +HDMI audio after DPMS on. + +CC: Wang Zhenyu +Signed-off-by: Wu Fengguang +Signed-off-by: Keith Packard +Signed-off-by: Eugeni Dodonov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_hdmi.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_hdmi.c ++++ b/drivers/gpu/drm/i915/intel_hdmi.c +@@ -269,6 +269,10 @@ static void intel_hdmi_dpms(struct drm_e + struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); + u32 temp; ++ u32 enable_bits = SDVO_ENABLE; ++ ++ if (intel_hdmi->has_audio) ++ enable_bits |= SDVO_AUDIO_ENABLE; + + temp = I915_READ(intel_hdmi->sdvox_reg); + +@@ -281,9 +285,9 @@ static void intel_hdmi_dpms(struct drm_e + } + + if (mode != DRM_MODE_DPMS_ON) { +- temp &= ~SDVO_ENABLE; ++ temp &= ~enable_bits; + } else { +- temp |= SDVO_ENABLE; ++ temp |= enable_bits; + } + + I915_WRITE(intel_hdmi->sdvox_reg, temp); diff --git a/queue-3.2/drm-i915-protect-force_wake_-get-put-with-the-gt_lock.patch b/queue-3.2/drm-i915-protect-force_wake_-get-put-with-the-gt_lock.patch new file mode 100644 index 00000000000..ed254c890ff --- /dev/null +++ b/queue-3.2/drm-i915-protect-force_wake_-get-put-with-the-gt_lock.patch @@ -0,0 +1,154 @@ +From 9f1f46a45a681d357d1ceedecec3671a5ae957f4 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Wed, 14 Dec 2011 13:57:03 +0100 +Subject: drm/i915: protect force_wake_(get|put) with the gt_lock + +From: Daniel Vetter + +commit 9f1f46a45a681d357d1ceedecec3671a5ae957f4 upstream. + +The problem this patch solves is that the forcewake accounting +necessary for register reads is protected by dev->struct_mutex. But the +hangcheck and error_capture code need to access registers without +grabbing this mutex because we hold it while waiting for the gpu. +So a new lock is required. Because currently the error_state capture +is called from the error irq handler and the hangcheck code runs from +a timer, it needs to be an irqsafe spinlock (note that the registers +used by the irq handler (neglecting the error handling part) only uses +registers that don't need the forcewake dance). + +We could tune this down to a normal spinlock when we rework the +error_state capture and hangcheck code to run from a workqueue. But +we don't have any read in a fastpath that needs forcewake, so I've +decided to not care much about overhead. + +This prevents tests/gem_hangcheck_forcewake from i-g-t from killing my +snb on recent kernels - something must have slightly changed the +timings. On previous kernels it only trigger a WARN about the broken +locking. + +v2: Drop the previous patch for the register writes. + +v3: Improve the commit message per Chris Wilson's suggestions. + +Signed-Off-by: Daniel Vetter +Reviewed-by: Chris Wilson +Reviewed-by: Eugeni Dodonov +Signed-off-by: Keith Packard +Signed-off-by: Eugeni Dodonov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_debugfs.c | 8 ++++++-- + drivers/gpu/drm/i915/i915_dma.c | 1 + + drivers/gpu/drm/i915/i915_drv.c | 18 ++++++++++++------ + drivers/gpu/drm/i915/i915_drv.h | 10 +++++++--- + 4 files changed, 26 insertions(+), 11 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_debugfs.c ++++ b/drivers/gpu/drm/i915/i915_debugfs.c +@@ -1314,9 +1314,13 @@ static int i915_gen6_forcewake_count_inf + struct drm_info_node *node = (struct drm_info_node *) m->private; + struct drm_device *dev = node->minor->dev; + struct drm_i915_private *dev_priv = dev->dev_private; ++ unsigned forcewake_count; + +- seq_printf(m, "forcewake count = %d\n", +- atomic_read(&dev_priv->forcewake_count)); ++ spin_lock_irq(&dev_priv->gt_lock); ++ forcewake_count = dev_priv->forcewake_count; ++ spin_unlock_irq(&dev_priv->gt_lock); ++ ++ seq_printf(m, "forcewake count = %u\n", forcewake_count); + + return 0; + } +--- a/drivers/gpu/drm/i915/i915_dma.c ++++ b/drivers/gpu/drm/i915/i915_dma.c +@@ -2042,6 +2042,7 @@ int i915_driver_load(struct drm_device * + if (!IS_I945G(dev) && !IS_I945GM(dev)) + pci_enable_msi(dev->pdev); + ++ spin_lock_init(&dev_priv->gt_lock); + spin_lock_init(&dev_priv->irq_lock); + spin_lock_init(&dev_priv->error_lock); + spin_lock_init(&dev_priv->rps_lock); +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -368,11 +368,12 @@ void __gen6_gt_force_wake_mt_get(struct + */ + void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) + { +- WARN_ON(!mutex_is_locked(&dev_priv->dev->struct_mutex)); ++ unsigned long irqflags; + +- /* Forcewake is atomic in case we get in here without the lock */ +- if (atomic_add_return(1, &dev_priv->forcewake_count) == 1) ++ spin_lock_irqsave(&dev_priv->gt_lock, irqflags); ++ if (dev_priv->forcewake_count++ == 0) + dev_priv->display.force_wake_get(dev_priv); ++ spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); + } + + void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) +@@ -392,10 +393,12 @@ void __gen6_gt_force_wake_mt_put(struct + */ + void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) + { +- WARN_ON(!mutex_is_locked(&dev_priv->dev->struct_mutex)); ++ unsigned long irqflags; + +- if (atomic_dec_and_test(&dev_priv->forcewake_count)) ++ spin_lock_irqsave(&dev_priv->gt_lock, irqflags); ++ if (--dev_priv->forcewake_count == 0) + dev_priv->display.force_wake_put(dev_priv); ++ spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); + } + + void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv) +@@ -626,6 +629,7 @@ int i915_reset(struct drm_device *dev, u + * need to + */ + bool need_display = true; ++ unsigned long irqflags; + int ret; + + if (!i915_try_reset) +@@ -644,8 +648,10 @@ int i915_reset(struct drm_device *dev, u + case 6: + ret = gen6_do_reset(dev, flags); + /* If reset with a user forcewake, try to restore */ +- if (atomic_read(&dev_priv->forcewake_count)) ++ spin_lock_irqsave(&dev_priv->gt_lock, irqflags); ++ if (dev_priv->forcewake_count) + dev_priv->display.force_wake_get(dev_priv); ++ spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); + break; + case 5: + ret = ironlake_do_reset(dev, flags); +--- a/drivers/gpu/drm/i915/i915_drv.h ++++ b/drivers/gpu/drm/i915/i915_drv.h +@@ -286,7 +286,13 @@ typedef struct drm_i915_private { + int relative_constants_mode; + + void __iomem *regs; +- u32 gt_fifo_count; ++ /** gt_fifo_count and the subsequent register write are synchronized ++ * with dev->struct_mutex. */ ++ unsigned gt_fifo_count; ++ /** forcewake_count is protected by gt_lock */ ++ unsigned forcewake_count; ++ /** gt_lock is also taken in irq contexts. */ ++ struct spinlock gt_lock; + + struct intel_gmbus { + struct i2c_adapter adapter; +@@ -738,8 +744,6 @@ typedef struct drm_i915_private { + + struct drm_property *broadcast_rgb_property; + struct drm_property *force_audio_property; +- +- atomic_t forcewake_count; + } drm_i915_private_t; + + enum i915_cache_level { diff --git a/queue-3.2/ecryptfs-infinite-loop-due-to-overflow-in-ecryptfs_write.patch b/queue-3.2/ecryptfs-infinite-loop-due-to-overflow-in-ecryptfs_write.patch new file mode 100644 index 00000000000..c63b7b8b38e --- /dev/null +++ b/queue-3.2/ecryptfs-infinite-loop-due-to-overflow-in-ecryptfs_write.patch @@ -0,0 +1,48 @@ +From 684a3ff7e69acc7c678d1a1394fe9e757993fd34 Mon Sep 17 00:00:00 2001 +From: Li Wang +Date: Thu, 19 Jan 2012 09:44:36 +0800 +Subject: eCryptfs: Infinite loop due to overflow in ecryptfs_write() + +From: Li Wang + +commit 684a3ff7e69acc7c678d1a1394fe9e757993fd34 upstream. + +ecryptfs_write() can enter an infinite loop when truncating a file to a +size larger than 4G. This only happens on architectures where size_t is +represented by 32 bits. + +This was caused by a size_t overflow due to it incorrectly being used to +store the result of a calculation which uses potentially large values of +type loff_t. + +[tyhicks@canonical.com: rewrite subject and commit message] +Signed-off-by: Li Wang +Signed-off-by: Yunchuan Wen +Reviewed-by: Cong Wang +Signed-off-by: Tyler Hicks +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ecryptfs/read_write.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/ecryptfs/read_write.c ++++ b/fs/ecryptfs/read_write.c +@@ -130,7 +130,7 @@ int ecryptfs_write(struct inode *ecryptf + pgoff_t ecryptfs_page_idx = (pos >> PAGE_CACHE_SHIFT); + size_t start_offset_in_page = (pos & ~PAGE_CACHE_MASK); + size_t num_bytes = (PAGE_CACHE_SIZE - start_offset_in_page); +- size_t total_remaining_bytes = ((offset + size) - pos); ++ loff_t total_remaining_bytes = ((offset + size) - pos); + + if (fatal_signal_pending(current)) { + rc = -EINTR; +@@ -141,7 +141,7 @@ int ecryptfs_write(struct inode *ecryptf + num_bytes = total_remaining_bytes; + if (pos < offset) { + /* remaining zeros to write, up to destination offset */ +- size_t total_remaining_zeros = (offset - pos); ++ loff_t total_remaining_zeros = (offset - pos); + + if (num_bytes > total_remaining_zeros) + num_bytes = total_remaining_zeros; diff --git a/queue-3.2/series b/queue-3.2/series index 9b16e757a3c..5198f05b6cb 100644 --- a/queue-3.2/series +++ b/queue-3.2/series @@ -35,3 +35,13 @@ drm-radeon-kms-fix-travis-panel-setup.patch sched-rt-fix-task-stack-corruption-under-__arch_want_interrupts_on_ctxsw.patch pm-hibernate-thaw-processes-in-snapshot_create_image-ioctl-test-path.patch pm-hibernate-thaw-kernel-threads-in-snapshot_create_image-ioctl-path.patch +8139cp-fix-missing-napi_gro_flush.patch +udf-mark-lvid-buffer-as-uptodate-before-marking-it-dirty.patch +drm-i915-hdmi-hot-remove-notification-to-audio-driver.patch +drm-i915-displayport-hot-remove-notification-to-audio-driver.patch +drm-i915-check-acthd-of-all-rings.patch +drm-i915-fix-tv-out-refresh-rate.patch +drm-i915-handle-3rd-pipe.patch +drm-i915-convert-force_wake_get-to-func-pointer-in-the-gpu-reset-code.patch +drm-i915-protect-force_wake_-get-put-with-the-gt_lock.patch +ecryptfs-infinite-loop-due-to-overflow-in-ecryptfs_write.patch diff --git a/queue-3.2/udf-mark-lvid-buffer-as-uptodate-before-marking-it-dirty.patch b/queue-3.2/udf-mark-lvid-buffer-as-uptodate-before-marking-it-dirty.patch new file mode 100644 index 00000000000..00c9e46aae2 --- /dev/null +++ b/queue-3.2/udf-mark-lvid-buffer-as-uptodate-before-marking-it-dirty.patch @@ -0,0 +1,37 @@ +From 853a0c25baf96b028de1654bea1e0c8857eadf3d Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 23 Dec 2011 11:53:07 +0100 +Subject: udf: Mark LVID buffer as uptodate before marking it dirty + +From: Jan Kara + +commit 853a0c25baf96b028de1654bea1e0c8857eadf3d upstream. + +When we hit EIO while writing LVID, the buffer uptodate bit is cleared. +This then results in an anoying warning from mark_buffer_dirty() when we +write the buffer again. So just set uptodate flag unconditionally. + +Reviewed-by: Namjae Jeon +Signed-off-by: Jan Kara +Cc: Dave Jones +Signed-off-by: Greg Kroah-Hartman + +--- + fs/udf/super.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/fs/udf/super.c ++++ b/fs/udf/super.c +@@ -1799,6 +1799,12 @@ static void udf_close_lvid(struct super_ + le16_to_cpu(lvid->descTag.descCRCLength))); + + lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag); ++ /* ++ * We set buffer uptodate unconditionally here to avoid spurious ++ * warnings from mark_buffer_dirty() when previous EIO has marked ++ * the buffer as !uptodate ++ */ ++ set_buffer_uptodate(bh); + mark_buffer_dirty(bh); + sbi->s_lvid_dirty = 0; + mutex_unlock(&sbi->s_alloc_mutex);