From d2d6f3409bb2e44c42cf087cf00eb8d6bebd79ab Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 9 Nov 2016 10:00:46 +0100 Subject: [PATCH] remove some broken drm and raid patches for 4.4 --- ...lper-fix-connector-ref-leak-on-error.patch | 45 ----- ...r-the-current-set-of-used-connectors.patch | 155 --------------- ...5-clean-up-ddi-ddc-aux-ch-sanitation.patch | 177 ------------------ queue-4.4/raid10-ignore-discard-error.patch | 58 ------ queue-4.4/series | 4 - 5 files changed, 439 deletions(-) delete mode 100644 queue-4.4/drm-fb-helper-fix-connector-ref-leak-on-error.patch delete mode 100644 queue-4.4/drm-fb-helper-keep-references-for-the-current-set-of-used-connectors.patch delete mode 100644 queue-4.4/drm-i915-clean-up-ddi-ddc-aux-ch-sanitation.patch delete mode 100644 queue-4.4/raid10-ignore-discard-error.patch diff --git a/queue-4.4/drm-fb-helper-fix-connector-ref-leak-on-error.patch b/queue-4.4/drm-fb-helper-fix-connector-ref-leak-on-error.patch deleted file mode 100644 index 2e02d195c98..00000000000 --- a/queue-4.4/drm-fb-helper-fix-connector-ref-leak-on-error.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 7dfcb36a1f17e4c7c7c12b9d8a6902037c7d98dc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Wed, 26 Oct 2016 12:05:52 +0300 -Subject: drm/fb-helper: Fix connector ref leak on error -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit 7dfcb36a1f17e4c7c7c12b9d8a6902037c7d98dc upstream. - -We need to drop the connector references already taken when we -abort in the middle of drm_fb_helper_single_add_all_connectors() - -Cc: Carlos Santa -Cc: Kirill A. Shutemov -Tested-by: Carlos Santa -Tested-by: Kirill A. Shutemov -Signed-off-by: Ville Syrjälä -Reviewed-by: Chris Wilson -Signed-off-by: Daniel Vetter -Link: http://patchwork.freedesktop.org/patch/msgid/1477472755-15288-2-git-send-email-ville.syrjala@linux.intel.com -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/drm_fb_helper.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/drm_fb_helper.c -+++ b/drivers/gpu/drm/drm_fb_helper.c -@@ -124,7 +124,12 @@ int drm_fb_helper_single_add_all_connect - return 0; - fail: - for (i = 0; i < fb_helper->connector_count; i++) { -- kfree(fb_helper->connector_info[i]); -+ struct drm_fb_helper_connector *fb_helper_connector = -+ fb_helper->connector_info[i]; -+ -+ drm_connector_unreference(fb_helper_connector->connector); -+ -+ kfree(fb_helper_connector); - fb_helper->connector_info[i] = NULL; - } - fb_helper->connector_count = 0; diff --git a/queue-4.4/drm-fb-helper-keep-references-for-the-current-set-of-used-connectors.patch b/queue-4.4/drm-fb-helper-keep-references-for-the-current-set-of-used-connectors.patch deleted file mode 100644 index f053a94b8ae..00000000000 --- a/queue-4.4/drm-fb-helper-keep-references-for-the-current-set-of-used-connectors.patch +++ /dev/null @@ -1,155 +0,0 @@ -From a2889606636d135148de101fe3311dfea67baf1c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Wed, 26 Oct 2016 17:41:18 +0300 -Subject: drm/fb-helper: Keep references for the current set of used connectors -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit a2889606636d135148de101fe3311dfea67baf1c upstream. - -The fbdev helper code keeps around two lists of connectors. One is the -list of all connectors it could use, and that list already holds -references for all the connectors. However the other list, or rather -lists, is the one actively being used. That list is tracked per-crtc -and currently doesn't hold any extra references. Let's grab those -extra references to avoid oopsing when the connector vanishes. The -list of all possible connectors should get updated when the hpd happens, -but the list of actively used connectors would not get updated until -the next time the fb-helper picks through the set of possible connectors. -And so we need to hang on to the connectors until that time. - -Since we need to clean up in drm_fb_helper_crtc_free() as well, -let's pull the code to a common place. And while at it let's -pull in up the modeset->mode cleanup in there as well. The case -of modeset->fb is a bit less clear. I'm thinking we should probably -hold a reference to it, but for now I just slapped on a FIXME. - -v2: Cleanup things drm_fb_helper_crtc_free() too (Chris) -v3: Don't leak modeset->connectors (Chris) - -Cc: Chris Wilson -Cc: Carlos Santa -Cc: Kirill A. Shutemov -Tested-by: Carlos Santa (v1) -Tested-by: Kirill A. Shutemov (v1) -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666 -Signed-off-by: Ville Syrjälä -Reviewed-by: Chris Wilson -Signed-off-by: Daniel Vetter -Link: http://patchwork.freedesktop.org/patch/msgid/1477492878-4990-1-git-send-email-ville.syrjala@linux.intel.com -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/drm_fb_helper.c | 57 +++++++++++++++++++++++----------------- - 1 file changed, 33 insertions(+), 24 deletions(-) - ---- a/drivers/gpu/drm/drm_fb_helper.c -+++ b/drivers/gpu/drm/drm_fb_helper.c -@@ -631,6 +631,24 @@ int drm_fb_helper_blank(int blank, struc - } - EXPORT_SYMBOL(drm_fb_helper_blank); - -+static void drm_fb_helper_modeset_release(struct drm_fb_helper *helper, -+ struct drm_mode_set *modeset) -+{ -+ int i; -+ -+ for (i = 0; i < modeset->num_connectors; i++) { -+ drm_connector_unreference(modeset->connectors[i]); -+ modeset->connectors[i] = NULL; -+ } -+ modeset->num_connectors = 0; -+ -+ drm_mode_destroy(helper->dev, modeset->mode); -+ modeset->mode = NULL; -+ -+ /* FIXME should hold a ref? */ -+ modeset->fb = NULL; -+} -+ - static void drm_fb_helper_crtc_free(struct drm_fb_helper *helper) - { - int i; -@@ -638,10 +656,12 @@ static void drm_fb_helper_crtc_free(stru - for (i = 0; i < helper->connector_count; i++) - kfree(helper->connector_info[i]); - kfree(helper->connector_info); -+ - for (i = 0; i < helper->crtc_count; i++) { -- kfree(helper->crtc_info[i].mode_set.connectors); -- if (helper->crtc_info[i].mode_set.mode) -- drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); -+ struct drm_mode_set *modeset = &helper->crtc_info[i].mode_set; -+ -+ drm_fb_helper_modeset_release(helper, modeset); -+ kfree(modeset->connectors); - } - kfree(helper->crtc_info); - } -@@ -1983,7 +2003,6 @@ static void drm_setup_crtcs(struct drm_f - struct drm_fb_helper_crtc **crtcs; - struct drm_display_mode **modes; - struct drm_fb_offset *offsets; -- struct drm_mode_set *modeset; - bool *enabled; - int width, height; - int i; -@@ -2031,45 +2050,35 @@ static void drm_setup_crtcs(struct drm_f - - /* need to set the modesets up here for use later */ - /* fill out the connector<->crtc mappings into the modesets */ -- for (i = 0; i < fb_helper->crtc_count; i++) { -- modeset = &fb_helper->crtc_info[i].mode_set; -- modeset->num_connectors = 0; -- modeset->fb = NULL; -- } -+ for (i = 0; i < fb_helper->crtc_count; i++) -+ drm_fb_helper_modeset_release(fb_helper, -+ &fb_helper->crtc_info[i].mode_set); - - for (i = 0; i < fb_helper->connector_count; i++) { - struct drm_display_mode *mode = modes[i]; - struct drm_fb_helper_crtc *fb_crtc = crtcs[i]; - struct drm_fb_offset *offset = &offsets[i]; -- modeset = &fb_crtc->mode_set; -+ struct drm_mode_set *modeset = &fb_crtc->mode_set; - - if (mode && fb_crtc) { -+ struct drm_connector *connector = -+ fb_helper->connector_info[i]->connector; -+ - DRM_DEBUG_KMS("desired mode %s set on crtc %d (%d,%d)\n", - mode->name, fb_crtc->mode_set.crtc->base.id, offset->x, offset->y); -+ - fb_crtc->desired_mode = mode; - fb_crtc->x = offset->x; - fb_crtc->y = offset->y; -- if (modeset->mode) -- drm_mode_destroy(dev, modeset->mode); - modeset->mode = drm_mode_duplicate(dev, - fb_crtc->desired_mode); -- modeset->connectors[modeset->num_connectors++] = fb_helper->connector_info[i]->connector; -+ drm_connector_reference(connector); -+ modeset->connectors[modeset->num_connectors++] = connector; - modeset->fb = fb_helper->fb; - modeset->x = offset->x; - modeset->y = offset->y; - } - } -- -- /* Clear out any old modes if there are no more connected outputs. */ -- for (i = 0; i < fb_helper->crtc_count; i++) { -- modeset = &fb_helper->crtc_info[i].mode_set; -- if (modeset->num_connectors == 0) { -- BUG_ON(modeset->fb); -- if (modeset->mode) -- drm_mode_destroy(dev, modeset->mode); -- modeset->mode = NULL; -- } -- } - out: - kfree(crtcs); - kfree(modes); diff --git a/queue-4.4/drm-i915-clean-up-ddi-ddc-aux-ch-sanitation.patch b/queue-4.4/drm-i915-clean-up-ddi-ddc-aux-ch-sanitation.patch deleted file mode 100644 index 5c309570beb..00000000000 --- a/queue-4.4/drm-i915-clean-up-ddi-ddc-aux-ch-sanitation.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 0ce140d45a8398b501934ac289aef0eb7f47c596 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Tue, 11 Oct 2016 20:52:47 +0300 -Subject: drm/i915: Clean up DDI DDC/AUX CH sanitation -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit 0ce140d45a8398b501934ac289aef0eb7f47c596 upstream. - -Now that we use the AUX and GMBUS assignment from VBT for all ports, -let's clean up the sanitization of the port information a bit. -Previosuly we only did this for port E, and only complained about a -non-standard assignment for the other ports. But as we know that -non-standard assignments are a fact of life, let's expand the -sanitization to all the ports. - -v2: Include a commit message, fix up the comments a bit -v3: Don't clobber other ports if the current port has no alternate aux ch/ddc pin - -Cc: Maarten Maathuis -Tested-by: Maarten Maathuis -References: https://bugs.freedesktop.org/show_bug.cgi?id=97877 -Signed-off-by: Ville Syrjälä -Link: http://patchwork.freedesktop.org/patch/msgid/1476208368-5710-4-git-send-email-ville.syrjala@linux.intel.com -Reviewed-by: Jim Bride (v2) -(cherry picked from commit 9454fa871edf15c20a0371548b3ec0d6d944a498) -Signed-off-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/i915/intel_bios.c | 122 +++++++++++++++++++++++--------------- - 1 file changed, 77 insertions(+), 45 deletions(-) - ---- a/drivers/gpu/drm/i915/intel_bios.c -+++ b/drivers/gpu/drm/i915/intel_bios.c -@@ -907,6 +907,77 @@ static u8 translate_iboost(u8 val) - return mapping[val]; - } - -+static void sanitize_ddc_pin(struct drm_i915_private *dev_priv, -+ enum port port) -+{ -+ const struct ddi_vbt_port_info *info = -+ &dev_priv->vbt.ddi_port_info[port]; -+ enum port p; -+ -+ if (!info->alternate_ddc_pin) -+ return; -+ -+ for_each_port_masked(p, (1 << port) - 1) { -+ struct ddi_vbt_port_info *i = &dev_priv->vbt.ddi_port_info[p]; -+ -+ if (info->alternate_ddc_pin != i->alternate_ddc_pin) -+ continue; -+ -+ DRM_DEBUG_KMS("port %c trying to use the same DDC pin (0x%x) as port %c, " -+ "disabling port %c DVI/HDMI support\n", -+ port_name(p), i->alternate_ddc_pin, -+ port_name(port), port_name(p)); -+ -+ /* -+ * If we have multiple ports supposedly sharing the -+ * pin, then dvi/hdmi couldn't exist on the shared -+ * port. Otherwise they share the same ddc bin and -+ * system couldn't communicate with them separately. -+ * -+ * Due to parsing the ports in alphabetical order, -+ * a higher port will always clobber a lower one. -+ */ -+ i->supports_dvi = false; -+ i->supports_hdmi = false; -+ i->alternate_ddc_pin = 0; -+ } -+} -+ -+static void sanitize_aux_ch(struct drm_i915_private *dev_priv, -+ enum port port) -+{ -+ const struct ddi_vbt_port_info *info = -+ &dev_priv->vbt.ddi_port_info[port]; -+ enum port p; -+ -+ if (!info->alternate_aux_channel) -+ return; -+ -+ for_each_port_masked(p, (1 << port) - 1) { -+ struct ddi_vbt_port_info *i = &dev_priv->vbt.ddi_port_info[p]; -+ -+ if (info->alternate_aux_channel != i->alternate_aux_channel) -+ continue; -+ -+ DRM_DEBUG_KMS("port %c trying to use the same AUX CH (0x%x) as port %c, " -+ "disabling port %c DP support\n", -+ port_name(p), i->alternate_aux_channel, -+ port_name(port), port_name(p)); -+ -+ /* -+ * If we have multiple ports supposedlt sharing the -+ * aux channel, then DP couldn't exist on the shared -+ * port. Otherwise they share the same aux channel -+ * and system couldn't communicate with them separately. -+ * -+ * Due to parsing the ports in alphabetical order, -+ * a higher port will always clobber a lower one. -+ */ -+ i->supports_dp = false; -+ i->alternate_aux_channel = 0; -+ } -+} -+ - static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port, - const struct bdb_header *bdb) - { -@@ -981,54 +1052,15 @@ static void parse_ddi_port(struct drm_i9 - DRM_DEBUG_KMS("Port %c is internal DP\n", port_name(port)); - - if (is_dvi) { -- if (port == PORT_E) { -- info->alternate_ddc_pin = ddc_pin; -- /* if DDIE share ddc pin with other port, then -- * dvi/hdmi couldn't exist on the shared port. -- * Otherwise they share the same ddc bin and system -- * couldn't communicate with them seperately. */ -- if (ddc_pin == DDC_PIN_B) { -- dev_priv->vbt.ddi_port_info[PORT_B].supports_dvi = 0; -- dev_priv->vbt.ddi_port_info[PORT_B].supports_hdmi = 0; -- } else if (ddc_pin == DDC_PIN_C) { -- dev_priv->vbt.ddi_port_info[PORT_C].supports_dvi = 0; -- dev_priv->vbt.ddi_port_info[PORT_C].supports_hdmi = 0; -- } else if (ddc_pin == DDC_PIN_D) { -- dev_priv->vbt.ddi_port_info[PORT_D].supports_dvi = 0; -- dev_priv->vbt.ddi_port_info[PORT_D].supports_hdmi = 0; -- } -- } else if (ddc_pin == DDC_PIN_B && port != PORT_B) -- DRM_DEBUG_KMS("Unexpected DDC pin for port B\n"); -- else if (ddc_pin == DDC_PIN_C && port != PORT_C) -- DRM_DEBUG_KMS("Unexpected DDC pin for port C\n"); -- else if (ddc_pin == DDC_PIN_D && port != PORT_D) -- DRM_DEBUG_KMS("Unexpected DDC pin for port D\n"); -+ info->alternate_ddc_pin = ddc_pin; -+ -+ sanitize_ddc_pin(dev_priv, port); - } - - if (is_dp) { -- if (port == PORT_E) { -- info->alternate_aux_channel = aux_channel; -- /* if DDIE share aux channel with other port, then -- * DP couldn't exist on the shared port. Otherwise -- * they share the same aux channel and system -- * couldn't communicate with them seperately. */ -- if (aux_channel == DP_AUX_A) -- dev_priv->vbt.ddi_port_info[PORT_A].supports_dp = 0; -- else if (aux_channel == DP_AUX_B) -- dev_priv->vbt.ddi_port_info[PORT_B].supports_dp = 0; -- else if (aux_channel == DP_AUX_C) -- dev_priv->vbt.ddi_port_info[PORT_C].supports_dp = 0; -- else if (aux_channel == DP_AUX_D) -- dev_priv->vbt.ddi_port_info[PORT_D].supports_dp = 0; -- } -- else if (aux_channel == DP_AUX_A && port != PORT_A) -- DRM_DEBUG_KMS("Unexpected AUX channel for port A\n"); -- else if (aux_channel == DP_AUX_B && port != PORT_B) -- DRM_DEBUG_KMS("Unexpected AUX channel for port B\n"); -- else if (aux_channel == DP_AUX_C && port != PORT_C) -- DRM_DEBUG_KMS("Unexpected AUX channel for port C\n"); -- else if (aux_channel == DP_AUX_D && port != PORT_D) -- DRM_DEBUG_KMS("Unexpected AUX channel for port D\n"); -+ info->alternate_aux_channel = aux_channel; -+ -+ sanitize_aux_ch(dev_priv, port); - } - - if (bdb->version >= 158) { diff --git a/queue-4.4/raid10-ignore-discard-error.patch b/queue-4.4/raid10-ignore-discard-error.patch deleted file mode 100644 index 26ba1d612cd..00000000000 --- a/queue-4.4/raid10-ignore-discard-error.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 579ed34f7b751b8add233cba4cf755258dbdd60a Mon Sep 17 00:00:00 2001 -From: Shaohua Li -Date: Thu, 6 Oct 2016 14:13:52 -0700 -Subject: RAID10: ignore discard error - -From: Shaohua Li - -commit 579ed34f7b751b8add233cba4cf755258dbdd60a upstream. - -This is the counterpart of raid10 fix. If a write error occurs, raid10 -will try to rewrite the bio in small chunk size. If the rewrite fails, -raid10 will record the error in bad block. narrow_write_error will -always use WRITE for the bio, but actually it could be a discard. Since -discard bio hasn't payload, write the bio will cause different issues. -But discard error isn't fatal, we can safely ignore it. This is what -this patch does. - -This issue should exist since discard is added, but only exposed with -recent arbitrary bio size feature. - -Cc: Sitsofe Wheeler -Signed-off-by: Shaohua Li -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/raid10.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - ---- a/drivers/md/raid10.c -+++ b/drivers/md/raid10.c -@@ -447,6 +447,9 @@ static void raid10_end_write_request(str - struct r10conf *conf = r10_bio->mddev->private; - int slot, repl; - struct md_rdev *rdev = NULL; -+ bool discard_error; -+ -+ discard_error = bio->bi_error && bio_op(bio) == REQ_OP_DISCARD; - - dev = find_bio_disk(conf, r10_bio, bio, &slot, &repl); - -@@ -460,7 +463,7 @@ static void raid10_end_write_request(str - /* - * this branch is our 'one mirror IO has finished' event handler: - */ -- if (bio->bi_error) { -+ if (bio->bi_error && !discard_error) { - if (repl) - /* Never record new bad blocks to replacement, - * just fail it. -@@ -503,7 +506,7 @@ static void raid10_end_write_request(str - if (is_badblock(rdev, - r10_bio->devs[slot].addr, - r10_bio->sectors, -- &first_bad, &bad_sectors)) { -+ &first_bad, &bad_sectors) && !discard_error) { - bio_put(bio); - if (repl) - r10_bio->devs[slot].repl_bio = IO_MADE_GOOD; diff --git a/queue-4.4/series b/queue-4.4/series index 475acfbfb65..18135f2c830 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -46,13 +46,9 @@ scsi-megaraid_sas-fix-data-integrity-failure-for-jbod-passthrough-devices.patch scsi-scsi_debug-fix-memory-leak-if-lbp-enabled-and-module-is-unloaded.patch scsi-arcmsr-send-synchronize_cache-command-to-firmware.patch mmc-dw_mmc-pltfm-fix-the-potential-null-pointer-dereference.patch -raid10-ignore-discard-error.patch revert-drm-radeon-fix-dp-link-training-issue-with-second-4k-monitor.patch drm-radeon-si_dpm-limit-clocks-on-hd86xx-part.patch drm-radeon-si_dpm-workaround-for-si-kickers.patch drm-radeon-drop-register-readback-in-cayman_cp_int_cntl_setup.patch -drm-fb-helper-fix-connector-ref-leak-on-error.patch -drm-fb-helper-keep-references-for-the-current-set-of-used-connectors.patch drm-dp-mst-check-peer-device-type-before-attempting-edid-read.patch -drm-i915-clean-up-ddi-ddc-aux-ch-sanitation.patch perf-build-fix-traceevent-plugins-build-race.patch -- 2.47.3