FAILED: patch "[PATCH] drm/amdgpu/mst: Stop ignoring error codes and deadlocking" failed to apply to 6.1-stable tree
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Possible dependencies:
7cce4cd628be ("drm/amdgpu/mst: Stop ignoring error codes and deadlocking")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7cce4cd628bee0d0caff7518c377cf8f599aa38f Mon Sep 17 00:00:00 2001
From: Lyude Paul <[email protected]>
Date: Mon, 14 Nov 2022 17:17:52 -0500
Subject: [PATCH] drm/amdgpu/mst: Stop ignoring error codes and deadlocking
It appears that amdgpu makes the mistake of completely ignoring the return values from the DP MST helpers, and instead just returns a simple true/false. In this case, it seems to have come back to bite us because as a result of simply returning false from compute_mst_dsc_configs_for_state(), amdgpu had no way of telling when a deadlock happened from these helpers. This could definitely result in some kernel splats.
V2:
* Address Wayne's comments (fix another bunch of spots where we weren't passing down return codes)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +10 -8
@@ -6539,7 +6539,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state,struct drm_connector_state *new_con_state;struct amdgpu_dm_connector *aconnector;struct dm_connector_state *dm_conn_state; -int i, j; +int i, j, ret;int vcpi, pbn_div, pbn, slot_num =0 ;for_each_new_connector_in_state (state, connector, new_con_state, i) {
@@ -6586,8 +6586,11 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state, dm_conn_state->pbn = pbn; dm_conn_state->vcpi_slots = slot_num; -drm_dp_mst_atomic_enable_dsc (state, aconnector->port, dm_conn_state->pbn, - false); + ret =drm_dp_mst_atomic_enable_dsc (state, aconnector->port, + dm_conn_state->pbn, false); +if (ret <0 ) +return ret; +continue ; }
@@ -9604,10 +9607,9 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,#if defined(CONFIG_DRM_AMD_DC_DCN )if (dc_resource_is_dsc_encoding_supported (dc)) { -if (!pre_validate_dsc (state, &dm_state, vars)) { - ret = -EINVAL ; + ret =pre_validate_dsc (state, &dm_state, vars); +if (ret !=0 ) goto fail; - } }#endif
@@ -9702,9 +9704,9 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, }#if defined(CONFIG_DRM_AMD_DC_DCN ) -if (!compute_mst_dsc_configs_for_state (state, dm_state->context, vars)) { + ret =compute_mst_dsc_configs_for_state (state, dm_state->context, vars); +if (ret) {DRM_DEBUG_DRIVER ("compute_mst_dsc_configs_for_state() failed\n" ); - ret = -EINVAL ; goto fail; }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +131 -104
423 lines not on this page · raw message
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +6 -6
@@ -53,15 +53,15 @@ struct dsc_mst_fairness_vars {struct amdgpu_dm_connector *aconnector; }; -bool compute_mst_dsc_configs_for_state (struct drm_atomic_state *state, -struct dc_state *dc_state, -struct dsc_mst_fairness_vars *vars); +int compute_mst_dsc_configs_for_state (struct drm_atomic_state *state, +struct dc_state *dc_state, +struct dsc_mst_fairness_vars *vars);bool needs_dsc_aux_workaround (struct dc_link *link); -bool pre_validate_dsc (struct drm_atomic_state *state, -struct dm_atomic_state **dm_state_ptr, -struct dsc_mst_fairness_vars *vars); +int pre_validate_dsc (struct drm_atomic_state *state, +struct dm_atomic_state **dm_state_ptr, +struct dsc_mst_fairness_vars *vars); enum dc_status dm_dp_mst_is_port_support_mode( struct amdgpu_dm_connector *aconnector,