From: Greg Kroah-Hartman Date: Sun, 8 May 2016 17:04:40 +0000 (+0200) Subject: 4.5-stable patches X-Git-Tag: v3.14.69~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c8b02b73c6cb86bee82e308eb358544ecddd352;p=thirdparty%2Fkernel%2Fstable-queue.git 4.5-stable patches added patches: drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch drm-i915-fake-hdmi-live-status.patch drm-i915-fix-edp-low-vswing-for-broadwell.patch drm-i915-fix-system-resume-if-pci-device-remained-enabled.patch drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch --- diff --git a/queue-4.5/drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch b/queue-4.5/drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch new file mode 100644 index 00000000000..5813ef7f771 --- /dev/null +++ b/queue-4.5/drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch @@ -0,0 +1,111 @@ +From 5eaa60c7109b40f17ac81090bc8b90482da76cd1 Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Mon, 18 Apr 2016 10:04:21 +0300 +Subject: drm/i915/ddi: Fix eDP VDD handling during booting and suspend/resume +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Imre Deak + +commit 5eaa60c7109b40f17ac81090bc8b90482da76cd1 upstream. + +The driver's VDD on/off logic assumes that whenever the VDD is on we +also hold an AUX power domain reference. Since BIOS can leave the VDD on +during booting and resuming and on DDI platforms we won't take a +corresponding power reference, the above assumption won't hold on those +platforms and an eventual delayed VDD off work will do an extraneous AUX +power domain put resulting in a refcount underflow. Fix this the same +way we did this for non-DDI DP encoders: + +commit 6d93c0c41760c0 ("drm/i915: fix VDD state tracking after system +resume") + +At the same time call the DP encoder suspend handler the same way as the +non-DDI DP encoders do to flush any pending VDD off work. Leaving the +work running may cause a HW access where we don't expect this (at a point +where power domains are suspended already). + +While at it remove an unnecessary function call indirection. + +This fixed for me AUX refcount underflow problems on BXT during +suspend/resume. + +CC: Ville Syrjälä +Signed-off-by: Imre Deak +Reviewed-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1460963062-13211-4-git-send-email-imre.deak@intel.com +(cherry picked from commit bf93ba67e9c05882f05b7ca2d773cfc8bf462c2a) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_ddi.c | 10 +++------- + drivers/gpu/drm/i915/intel_dp.c | 4 ++-- + drivers/gpu/drm/i915/intel_drv.h | 2 ++ + 3 files changed, 7 insertions(+), 9 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_ddi.c ++++ b/drivers/gpu/drm/i915/intel_ddi.c +@@ -3260,12 +3260,6 @@ void intel_ddi_get_config(struct intel_e + intel_ddi_clock_get(encoder, pipe_config); + } + +-static void intel_ddi_destroy(struct drm_encoder *encoder) +-{ +- /* HDMI has nothing special to destroy, so we can go with this. */ +- intel_dp_encoder_destroy(encoder); +-} +- + static bool intel_ddi_compute_config(struct intel_encoder *encoder, + struct intel_crtc_state *pipe_config) + { +@@ -3284,7 +3278,8 @@ static bool intel_ddi_compute_config(str + } + + static const struct drm_encoder_funcs intel_ddi_funcs = { +- .destroy = intel_ddi_destroy, ++ .reset = intel_dp_encoder_reset, ++ .destroy = intel_dp_encoder_destroy, + }; + + static struct intel_connector * +@@ -3356,6 +3351,7 @@ void intel_ddi_init(struct drm_device *d + intel_encoder->post_disable = intel_ddi_post_disable; + intel_encoder->get_hw_state = intel_ddi_get_hw_state; + intel_encoder->get_config = intel_ddi_get_config; ++ intel_encoder->suspend = intel_dp_encoder_suspend; + + intel_dig_port->port = port; + intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) & +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -4905,7 +4905,7 @@ void intel_dp_encoder_destroy(struct drm + kfree(intel_dig_port); + } + +-static void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) ++void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) + { + struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base); + +@@ -4947,7 +4947,7 @@ static void intel_edp_panel_vdd_sanitize + edp_panel_vdd_schedule_off(intel_dp); + } + +-static void intel_dp_encoder_reset(struct drm_encoder *encoder) ++void intel_dp_encoder_reset(struct drm_encoder *encoder) + { + struct intel_dp *intel_dp; + +--- a/drivers/gpu/drm/i915/intel_drv.h ++++ b/drivers/gpu/drm/i915/intel_drv.h +@@ -1234,6 +1234,8 @@ void intel_dp_set_link_params(struct int + void intel_dp_start_link_train(struct intel_dp *intel_dp); + void intel_dp_stop_link_train(struct intel_dp *intel_dp); + void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode); ++void intel_dp_encoder_reset(struct drm_encoder *encoder); ++void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder); + void intel_dp_encoder_destroy(struct drm_encoder *encoder); + int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc); + bool intel_dp_compute_config(struct intel_encoder *encoder, diff --git a/queue-4.5/drm-i915-fake-hdmi-live-status.patch b/queue-4.5/drm-i915-fake-hdmi-live-status.patch new file mode 100644 index 00000000000..57a6f70258d --- /dev/null +++ b/queue-4.5/drm-i915-fake-hdmi-live-status.patch @@ -0,0 +1,63 @@ +From 60b3143c7cac7e8d2ca65c0b347466c5776395d1 Mon Sep 17 00:00:00 2001 +From: Shashank Sharma +Date: Thu, 21 Apr 2016 16:48:32 +0530 +Subject: drm/i915: Fake HDMI live status +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Shashank Sharma + +commit 60b3143c7cac7e8d2ca65c0b347466c5776395d1 upstream. + +This patch does the following: +- Fakes live status of HDMI as connected (even if that's not). + While testing certain (monitor + cable) combinations with + various intel platforms, it seems that live status register + doesn't work reliably on some older devices. So limit the + live_status check for HDMI detection, only for platforms + from gen7 onwards. + +V2: restrict faking live_status to certain platforms +V3: (Ville) + - keep the debug message for !live_status case + - fix indentation of comment + - remove "warning" from the debug message + + (Jani) + - Change format of fix details in the commit message + +Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid") +Suggested-by: Ville Syrjala +Signed-off-by: Shashank Sharma +Link: http://patchwork.freedesktop.org/patch/msgid/1461237606-16491-1-git-send-email-shashank.sharma@intel.com +Signed-off-by: Ville Syrjälä +(cherry picked from commit 4f4a8185011773f7520d9916c6857db946e7f9d1) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_hdmi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_hdmi.c ++++ b/drivers/gpu/drm/i915/intel_hdmi.c +@@ -1407,8 +1407,16 @@ intel_hdmi_detect(struct drm_connector * + hdmi_to_dig_port(intel_hdmi)); + } + +- if (!live_status) +- DRM_DEBUG_KMS("Live status not up!"); ++ if (!live_status) { ++ DRM_DEBUG_KMS("HDMI live status down\n"); ++ /* ++ * Live status register is not reliable on all intel platforms. ++ * So consider live_status only for certain platforms, for ++ * others, read EDID to determine presence of sink. ++ */ ++ if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv)) ++ live_status = true; ++ } + + intel_hdmi_unset_edid(connector); + diff --git a/queue-4.5/drm-i915-fix-edp-low-vswing-for-broadwell.patch b/queue-4.5/drm-i915-fix-edp-low-vswing-for-broadwell.patch new file mode 100644 index 00000000000..d106b34c7b5 --- /dev/null +++ b/queue-4.5/drm-i915-fix-edp-low-vswing-for-broadwell.patch @@ -0,0 +1,60 @@ +From 992e7a41f9fcc7bcd10e7d346aee5ed7a2c241cb Mon Sep 17 00:00:00 2001 +From: Mika Kahola +Date: Wed, 20 Apr 2016 15:39:02 +0300 +Subject: drm/i915: Fix eDP low vswing for Broadwell +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Mika Kahola + +commit 992e7a41f9fcc7bcd10e7d346aee5ed7a2c241cb upstream. + +It was noticed on bug #94087 that module parameter +i915.edp_vswing=2 that should override the VBT setting +to use default voltage swing (400 mV) was not applied +for Broadwell. + +This patch provides a fix for this by checking if default +i.e. higher voltage swing is requested to be used and +applies the DDI translations table for DP instead of eDP +(low vswing) table. + +v2: Combine two if statements into one (Jani) +v3: Change dev_priv->edp_low_vswing to use dev_priv->vbt.edp.low_vswing + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94087 +Signed-off-by: Mika Kahola +Link: http://patchwork.freedesktop.org/patch/msgid/1461155942-7749-1-git-send-email-mika.kahola@intel.com +Signed-off-by: Ville Syrjälä +(cherry picked from commit 00983519214b61c1b9371ec2ed55a4dde773e384) +[Jani: s/dev_priv->vbt.edp.low_vswing/dev_priv->edp_low_vswing/ to backport] +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_ddi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_ddi.c ++++ b/drivers/gpu/drm/i915/intel_ddi.c +@@ -464,9 +464,17 @@ static void intel_prepare_ddi_buffers(st + } else if (IS_BROADWELL(dev)) { + ddi_translations_fdi = bdw_ddi_translations_fdi; + ddi_translations_dp = bdw_ddi_translations_dp; +- ddi_translations_edp = bdw_ddi_translations_edp; ++ ++ if (dev_priv->edp_low_vswing) { ++ ddi_translations_edp = bdw_ddi_translations_edp; ++ n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp); ++ } else { ++ ddi_translations_edp = bdw_ddi_translations_dp; ++ n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp); ++ } ++ + ddi_translations_hdmi = bdw_ddi_translations_hdmi; +- n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp); ++ + n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp); + n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi); + hdmi_default_entry = 7; diff --git a/queue-4.5/drm-i915-fix-system-resume-if-pci-device-remained-enabled.patch b/queue-4.5/drm-i915-fix-system-resume-if-pci-device-remained-enabled.patch new file mode 100644 index 00000000000..576347318a9 --- /dev/null +++ b/queue-4.5/drm-i915-fix-system-resume-if-pci-device-remained-enabled.patch @@ -0,0 +1,96 @@ +From dab9a2663f4e688106c041f7cd2797a721382f0a Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Mon, 18 Apr 2016 14:45:54 +0300 +Subject: drm/i915: Fix system resume if PCI device remained enabled +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Imre Deak + +commit dab9a2663f4e688106c041f7cd2797a721382f0a upstream. + +During system resume we depended on pci_enable_device() also putting the +device into PCI D0 state. This won't work if the PCI device was already +enabled but still in D3 state. This is because pci_enable_device() is +refcounted and will not change the HW state if called with a non-zero +refcount. Leaving the device in D3 will make all subsequent device +accesses fail. + +This didn't cause a problem most of the time, since we resumed with an +enable refcount of 0. But it fails at least after module reload because +after that we also happen to leak a PCI device enable reference: During +probing we call drm_get_pci_dev() which will enable the PCI device, but +during device removal drm_put_dev() won't disable it. This is a bug of +its own in DRM core, but without much harm as it only leaves the PCI +device enabled. Fixing it is also a bit more involved, due to DRM +mid-layering and because it affects non-i915 drivers too. The fix in +this patch is valid regardless of the problem in DRM core. + +v2: +- Add a code comment about the relation of this fix to the freeze/thaw + vs. the suspend/resume phases. (Ville) +- Add a code comment about the inconsistent ordering of set power state + and device enable calls. (Chris) + +CC: Ville Syrjälä +CC: Chris Wilson +Signed-off-by: Imre Deak +Reviewed-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1460979954-14503-1-git-send-email-imre.deak@intel.com +(cherry picked from commit 44410cd0bfb26bde9288da34c190cc9267d42a20) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_drv.c | 32 +++++++++++++++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -797,7 +797,7 @@ static int i915_drm_resume(struct drm_de + static int i915_drm_resume_early(struct drm_device *dev) + { + struct drm_i915_private *dev_priv = dev->dev_private; +- int ret = 0; ++ int ret; + + /* + * We have a resume ordering issue with the snd-hda driver also +@@ -808,6 +808,36 @@ static int i915_drm_resume_early(struct + * FIXME: This should be solved with a special hdmi sink device or + * similar so that power domains can be employed. + */ ++ ++ /* ++ * Note that we need to set the power state explicitly, since we ++ * powered off the device during freeze and the PCI core won't power ++ * it back up for us during thaw. Powering off the device during ++ * freeze is not a hard requirement though, and during the ++ * suspend/resume phases the PCI core makes sure we get here with the ++ * device powered on. So in case we change our freeze logic and keep ++ * the device powered we can also remove the following set power state ++ * call. ++ */ ++ ret = pci_set_power_state(dev->pdev, PCI_D0); ++ if (ret) { ++ DRM_ERROR("failed to set PCI D0 power state (%d)\n", ret); ++ goto out; ++ } ++ ++ /* ++ * Note that pci_enable_device() first enables any parent bridge ++ * device and only then sets the power state for this device. The ++ * bridge enabling is a nop though, since bridge devices are resumed ++ * first. The order of enabling power and enabling the device is ++ * imposed by the PCI core as described above, so here we preserve the ++ * same order for the freeze/thaw phases. ++ * ++ * TODO: eventually we should remove pci_disable_device() / ++ * pci_enable_enable_device() from suspend/resume. Due to how they ++ * depend on the device enable refcount we can't anyway depend on them ++ * disabling/enabling the device. ++ */ + if (pci_enable_device(dev->pdev)) { + ret = -EIO; + goto out; diff --git a/queue-4.5/drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch b/queue-4.5/drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch new file mode 100644 index 00000000000..c840de6894c --- /dev/null +++ b/queue-4.5/drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch @@ -0,0 +1,110 @@ +From 4ea3959018d09edfa36a9e7b5ccdbd4ec4b99e49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Wed, 20 Apr 2016 16:43:56 +0300 +Subject: drm/i915: Make RPS EI/thresholds multiple of 25 on SNB-BDW +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit 4ea3959018d09edfa36a9e7b5ccdbd4ec4b99e49 upstream. + +Somehow my SNB GT1 (Dell XPS 8300) gets very unhappy around +GPU hangs if the RPS EI/thresholds aren't suitably aligned. +It seems like scheduling/timer interupts stop working somehow +and things get stuck eg. in usleep_range(). + +I bisected the problem down to +commit 8a5864377b12 ("drm/i915/skl: Restructured the gen6_set_rps_thresholds function") +I observed that before all the values were at least multiples of 25, +but afterwards they are not. And rounding things up to the next multiple +of 25 does seem to help, so lets' do that. I also tried roundup(..., 5) +but that wasn't sufficient. Also I have no idea if we might need this sort of +thing on gen9+ as well. + +These are the original EI/thresholds: + LOW_POWER + GEN6_RP_UP_EI 12500 + GEN6_RP_UP_THRESHOLD 11800 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 21250 + BETWEEN + GEN6_RP_UP_EI 10250 + GEN6_RP_UP_THRESHOLD 9225 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 18750 + HIGH_POWER + GEN6_RP_UP_EI 8000 + GEN6_RP_UP_THRESHOLD 6800 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 15000 + +These are after 8a5864377b12: + LOW_POWER + GEN6_RP_UP_EI 12500 + GEN6_RP_UP_THRESHOLD 11875 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 21250 + BETWEEN + GEN6_RP_UP_EI 10156 + GEN6_RP_UP_THRESHOLD 9140 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 18750 + HIGH_POWER + GEN6_RP_UP_EI 7812 + GEN6_RP_UP_THRESHOLD 6640 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 15000 + +And these are what we have after this patch: + LOW_POWER + GEN6_RP_UP_EI 12500 + GEN6_RP_UP_THRESHOLD 11875 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 21250 + BETWEEN + GEN6_RP_UP_EI 10175 + GEN6_RP_UP_THRESHOLD 9150 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 18750 + HIGH_POWER + GEN6_RP_UP_EI 7825 + GEN6_RP_UP_THRESHOLD 6650 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 15000 + +Cc: Akash Goel +Cc: Chris Wilson +Testcase: igt/kms_pipe_crc_basic/hang-read-crc-pipe-B +Fixes: 8a5864377b12 ("drm/i915/skl: Restructured the gen6_set_rps_thresholds function") +Signed-off-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1461159836-9108-1-git-send-email-ville.syrjala@linux.intel.com +Acked-by: Chris Wilson +Reviewed-by: Patrik Jakobsson +(cherry picked from commit 8a292d016d1cc4938ff14b4df25328230b08a408) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_reg.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/i915_reg.h ++++ b/drivers/gpu/drm/i915/i915_reg.h +@@ -2898,7 +2898,14 @@ enum skl_disp_power_wells { + #define GEN6_RP_STATE_CAP _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998) + #define BXT_RP_STATE_CAP _MMIO(0x138170) + +-#define INTERVAL_1_28_US(us) (((us) * 100) >> 7) ++/* ++ * Make these a multiple of magic 25 to avoid SNB (eg. Dell XPS ++ * 8300) freezing up around GPU hangs. Looks as if even ++ * scheduling/timer interrupts start misbehaving if the RPS ++ * EI/thresholds are "bad", leading to a very sluggish or even ++ * frozen machine. ++ */ ++#define INTERVAL_1_28_US(us) roundup(((us) * 100) >> 7, 25) + #define INTERVAL_1_33_US(us) (((us) * 3) >> 2) + #define INTERVAL_0_833_US(us) (((us) * 6) / 5) + #define GT_INTERVAL_FROM_US(dev_priv, us) (IS_GEN9(dev_priv) ? \ diff --git a/queue-4.5/series b/queue-4.5/series index c313f713931..f32d7dba6db 100644 --- a/queue-4.5/series +++ b/queue-4.5/series @@ -80,3 +80,8 @@ iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch iio-ak8975-fix-maybe-uninitialized-warning.patch drm-radeon-make-sure-vertical-front-porch-is-at-least-1.patch drm-i915-avoid-stalling-on-pending-flips-for-legacy-cursor-updates.patch +drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch +drm-i915-fix-system-resume-if-pci-device-remained-enabled.patch +drm-i915-fix-edp-low-vswing-for-broadwell.patch +drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch +drm-i915-fake-hdmi-live-status.patch