From: Greg Kroah-Hartman Date: Fri, 10 Mar 2023 11:48:07 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v6.1.17~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42d18c0cb5a8236e43986615f93c9c5b8c3f6cdf;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: drm-display-dp_mst-fix-down-message-handling-after-a-packet-reception-error.patch drm-display-dp_mst-fix-down-up-message-handling-after-sink-disconnect.patch drm-display-dp_mst-fix-payload-addition-on-a-disconnected-sink.patch drm-i915-dp_mst-add-the-mst-topology-state-for-modesetted-crtcs.patch drm-i915-fix-system-suspend-without-fbdev-being-initialized.patch --- diff --git a/queue-6.1/drm-display-dp_mst-fix-down-message-handling-after-a-packet-reception-error.patch b/queue-6.1/drm-display-dp_mst-fix-down-message-handling-after-a-packet-reception-error.patch new file mode 100644 index 00000000000..326e631580b --- /dev/null +++ b/queue-6.1/drm-display-dp_mst-fix-down-message-handling-after-a-packet-reception-error.patch @@ -0,0 +1,38 @@ +From 1241aedb6b5c7a5a8ad73e5eb3a41cfe18a3e00e Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Wed, 14 Dec 2022 20:42:57 +0200 +Subject: drm/display/dp_mst: Fix down message handling after a packet reception error + +From: Imre Deak + +commit 1241aedb6b5c7a5a8ad73e5eb3a41cfe18a3e00e upstream. + +After an error during receiving a packet for a multi-packet DP MST +sideband message, the state tracking which packets have been received +already is not reset. This prevents the reception of subsequent down +messages (due to the pending message not yet completed with an +end-of-message-transfer packet). + +Fix the above by resetting the reception state after a packet error. + +Cc: Lyude Paul +Cc: # v3.17+ +Signed-off-by: Imre Deak +Reviewed-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20221214184258.2869417-2-imre.deak@intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c +@@ -3859,7 +3859,7 @@ static int drm_dp_mst_handle_down_rep(st + struct drm_dp_sideband_msg_rx *msg = &mgr->down_rep_recv; + + if (!drm_dp_get_one_sb_msg(mgr, false, &mstb)) +- goto out; ++ goto out_clear_reply; + + /* Multi-packet message transmission, don't clear the reply */ + if (!msg->have_eomt) diff --git a/queue-6.1/drm-display-dp_mst-fix-down-up-message-handling-after-sink-disconnect.patch b/queue-6.1/drm-display-dp_mst-fix-down-up-message-handling-after-sink-disconnect.patch new file mode 100644 index 00000000000..fa5f9fab2cd --- /dev/null +++ b/queue-6.1/drm-display-dp_mst-fix-down-up-message-handling-after-sink-disconnect.patch @@ -0,0 +1,45 @@ +From 1d082618bbf3b6755b8cc68c0a8122af2842d593 Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Wed, 14 Dec 2022 20:42:56 +0200 +Subject: drm/display/dp_mst: Fix down/up message handling after sink disconnect + +From: Imre Deak + +commit 1d082618bbf3b6755b8cc68c0a8122af2842d593 upstream. + +If the sink gets disconnected during receiving a multi-packet DP MST AUX +down-reply/up-request sideband message, the state keeping track of which +packets have been received already is not reset. This results in a failed +sanity check for the subsequent message packet received after a sink is +reconnected (due to the pending message not yet completed with an +end-of-message-transfer packet), indicated by the + +"sideband msg set header failed" + +error. + +Fix the above by resetting the up/down message reception state after a +disconnect event. + +Cc: Lyude Paul +Cc: # v3.17+ +Signed-off-by: Imre Deak +Reviewed-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20221214184258.2869417-1-imre.deak@intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/display/drm_dp_mst_topology.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c +@@ -3644,6 +3644,9 @@ int drm_dp_mst_topology_mgr_set_mst(stru + drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0); + ret = 0; + mgr->payload_id_table_cleared = false; ++ ++ memset(&mgr->down_rep_recv, 0, sizeof(mgr->down_rep_recv)); ++ memset(&mgr->up_req_recv, 0, sizeof(mgr->up_req_recv)); + } + + out_unlock: diff --git a/queue-6.1/drm-display-dp_mst-fix-payload-addition-on-a-disconnected-sink.patch b/queue-6.1/drm-display-dp_mst-fix-payload-addition-on-a-disconnected-sink.patch new file mode 100644 index 00000000000..dce0d971db6 --- /dev/null +++ b/queue-6.1/drm-display-dp_mst-fix-payload-addition-on-a-disconnected-sink.patch @@ -0,0 +1,52 @@ +From 33f960e23c29d113fe3193e0bdc19ac4f3776f20 Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Wed, 14 Dec 2022 20:42:58 +0200 +Subject: drm/display/dp_mst: Fix payload addition on a disconnected sink + +From: Imre Deak + +commit 33f960e23c29d113fe3193e0bdc19ac4f3776f20 upstream. + +If an MST stream is enabled on a disconnected sink, the payload for the +stream is not created and the MST manager's payload count/next start VC +slot is not updated. Since the payload's start VC slot may still contain +a valid value (!= -1) the subsequent disabling of such a stream could +cause an incorrect decrease of the payload count/next start VC slot in +drm_dp_remove_payload() and hence later payload additions will fail. + +Fix the above by marking the payload as invalid in the above case, so +that it's skipped during payload removal. While at it add a debug print +for this case. + +Cc: Lyude Paul +Cc: # v6.1+ +Signed-off-by: Imre Deak +Reviewed-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20221214184258.2869417-3-imre.deak@intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/display/drm_dp_mst_topology.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c +index 01350510244f..5861b0a6247b 100644 +--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c +@@ -3309,8 +3309,13 @@ int drm_dp_add_payload_part1(struct drm_dp_mst_topology_mgr *mgr, + int ret; + + port = drm_dp_mst_topology_get_port_validated(mgr, payload->port); +- if (!port) ++ if (!port) { ++ drm_dbg_kms(mgr->dev, ++ "VCPI %d for port %p not in topology, not creating a payload\n", ++ payload->vcpi, payload->port); ++ payload->vc_start_slot = -1; + return 0; ++ } + + if (mgr->payload_count == 0) + mgr->next_start_slot = mst_state->start_slot; +-- +2.39.2 + diff --git a/queue-6.1/drm-i915-dp_mst-add-the-mst-topology-state-for-modesetted-crtcs.patch b/queue-6.1/drm-i915-dp_mst-add-the-mst-topology-state-for-modesetted-crtcs.patch new file mode 100644 index 00000000000..4c66ce2114b --- /dev/null +++ b/queue-6.1/drm-i915-dp_mst-add-the-mst-topology-state-for-modesetted-crtcs.patch @@ -0,0 +1,142 @@ +From 326b1e792ff08b4d8ecb9605aec98e4e5feef56e Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Mon, 6 Feb 2023 13:48:53 +0200 +Subject: drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Imre Deak + +commit 326b1e792ff08b4d8ecb9605aec98e4e5feef56e upstream. + +Add the MST topology for a CRTC to the atomic state if the driver +needs to force a modeset on the CRTC after the encoder compute config +functions are called. + +Later the MST encoder's disable hook also adds the state, but that isn't +guaranteed to work (since in that hook getting the state may fail, which +can't be handled there). This should fix that, while a later patch fixes +the use of the MST state in the disable hook. + +v2: Add missing forward struct declartions, caught by hdrtest. +v3: Factor out intel_dp_mst_add_topology_state_for_connector() used + later in the patchset. + +Cc: Lyude Paul +Cc: Ville Syrjälä +Cc: stable@vger.kernel.org # 6.1 +Reviewed-by: Ville Syrjälä # v2 +Reviewed-by: Lyude Paul +Acked-by: Lyude Paul +Acked-by: Daniel Vetter +Acked-by: Wayne Lin +Acked-by: Jani Nikula +Signed-off-by: Imre Deak +Link: https://patchwork.freedesktop.org/patch/msgid/20230206114856.2665066-1-imre.deak@intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/display/intel_display.c | 4 + + drivers/gpu/drm/i915/display/intel_dp_mst.c | 61 +++++++++++++++++++++++++++ + drivers/gpu/drm/i915/display/intel_dp_mst.h | 4 + + 3 files changed, 69 insertions(+) + +--- a/drivers/gpu/drm/i915/display/intel_display.c ++++ b/drivers/gpu/drm/i915/display/intel_display.c +@@ -5969,6 +5969,10 @@ int intel_modeset_all_pipes(struct intel + if (ret) + return ret; + ++ ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc); ++ if (ret) ++ return ret; ++ + ret = intel_atomic_add_affected_planes(state, crtc); + if (ret) + return ret; +--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c ++++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c +@@ -1003,3 +1003,64 @@ bool intel_dp_mst_is_slave_trans(const s + return crtc_state->mst_master_transcoder != INVALID_TRANSCODER && + crtc_state->mst_master_transcoder != crtc_state->cpu_transcoder; + } ++ ++/** ++ * intel_dp_mst_add_topology_state_for_connector - add MST topology state for a connector ++ * @state: atomic state ++ * @connector: connector to add the state for ++ * @crtc: the CRTC @connector is attached to ++ * ++ * Add the MST topology state for @connector to @state. ++ * ++ * Returns 0 on success, negative error code on failure. ++ */ ++static int ++intel_dp_mst_add_topology_state_for_connector(struct intel_atomic_state *state, ++ struct intel_connector *connector, ++ struct intel_crtc *crtc) ++{ ++ struct drm_dp_mst_topology_state *mst_state; ++ ++ if (!connector->mst_port) ++ return 0; ++ ++ mst_state = drm_atomic_get_mst_topology_state(&state->base, ++ &connector->mst_port->mst_mgr); ++ if (IS_ERR(mst_state)) ++ return PTR_ERR(mst_state); ++ ++ mst_state->pending_crtc_mask |= drm_crtc_mask(&crtc->base); ++ ++ return 0; ++} ++ ++/** ++ * intel_dp_mst_add_topology_state_for_crtc - add MST topology state for a CRTC ++ * @state: atomic state ++ * @crtc: CRTC to add the state for ++ * ++ * Add the MST topology state for @crtc to @state. ++ * ++ * Returns 0 on success, negative error code on failure. ++ */ ++int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state, ++ struct intel_crtc *crtc) ++{ ++ struct drm_connector *_connector; ++ struct drm_connector_state *conn_state; ++ int i; ++ ++ for_each_new_connector_in_state(&state->base, _connector, conn_state, i) { ++ struct intel_connector *connector = to_intel_connector(_connector); ++ int ret; ++ ++ if (conn_state->crtc != &crtc->base) ++ continue; ++ ++ ret = intel_dp_mst_add_topology_state_for_connector(state, connector, crtc); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} +--- a/drivers/gpu/drm/i915/display/intel_dp_mst.h ++++ b/drivers/gpu/drm/i915/display/intel_dp_mst.h +@@ -8,6 +8,8 @@ + + #include + ++struct intel_atomic_state; ++struct intel_crtc; + struct intel_crtc_state; + struct intel_digital_port; + struct intel_dp; +@@ -18,5 +20,7 @@ int intel_dp_mst_encoder_active_links(st + bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state); + bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state); + bool intel_dp_mst_source_support(struct intel_dp *intel_dp); ++int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state, ++ struct intel_crtc *crtc); + + #endif /* __INTEL_DP_MST_H__ */ diff --git a/queue-6.1/drm-i915-fix-system-suspend-without-fbdev-being-initialized.patch b/queue-6.1/drm-i915-fix-system-suspend-without-fbdev-being-initialized.patch new file mode 100644 index 00000000000..ca91ecc47b3 --- /dev/null +++ b/queue-6.1/drm-i915-fix-system-suspend-without-fbdev-being-initialized.patch @@ -0,0 +1,102 @@ +From 8038510b1fe443ffbc0e356db5f47cbb8678a594 Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Wed, 8 Feb 2023 13:42:57 +0200 +Subject: drm/i915: Fix system suspend without fbdev being initialized + +From: Imre Deak + +commit 8038510b1fe443ffbc0e356db5f47cbb8678a594 upstream. + +If fbdev is not initialized for some reason - in practice on platforms +without display - suspending fbdev should be skipped during system +suspend, fix this up. While at it add an assert that suspending fbdev +only happens with the display present. + +This fixes the following: + +[ 91.227923] PM: suspend entry (s2idle) +[ 91.254598] Filesystems sync: 0.025 seconds +[ 91.270518] Freezing user space processes +[ 91.272266] Freezing user space processes completed (elapsed 0.001 seconds) +[ 91.272686] OOM killer disabled. +[ 91.272872] Freezing remaining freezable tasks +[ 91.274295] Freezing remaining freezable tasks completed (elapsed 0.001 seconds) +[ 91.659622] BUG: kernel NULL pointer dereference, address: 00000000000001c8 +[ 91.659981] #PF: supervisor write access in kernel mode +[ 91.660252] #PF: error_code(0x0002) - not-present page +[ 91.660511] PGD 0 P4D 0 +[ 91.660647] Oops: 0002 [#1] PREEMPT SMP NOPTI +[ 91.660875] CPU: 4 PID: 917 Comm: bash Not tainted 6.2.0-rc7+ #54 +[ 91.661185] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20221117gitfff6d81270b5-9.fc37 unknown +[ 91.661680] RIP: 0010:mutex_lock+0x19/0x30 +[ 91.661914] Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 53 48 89 fb e8 62 d3 ff ff 31 c0 65 48 8b 14 25 00 15 03 00 48 0f b1 13 75 06 5b c3 cc cc cc cc 48 89 df 5b eb b4 0f 1f 40 +[ 91.662840] RSP: 0018:ffffa1e8011ffc08 EFLAGS: 00010246 +[ 91.663087] RAX: 0000000000000000 RBX: 00000000000001c8 RCX: 0000000000000000 +[ 91.663440] RDX: ffff8be455eb0000 RSI: 0000000000000001 RDI: 00000000000001c8 +[ 91.663802] RBP: ffff8be459440000 R08: ffff8be459441f08 R09: ffffffff8e1432c0 +[ 91.664167] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001 +[ 91.664532] R13: 00000000000001c8 R14: 0000000000000000 R15: ffff8be442f4fb20 +[ 91.664905] FS: 00007f28ffc16740(0000) GS:ffff8be4bb900000(0000) knlGS:0000000000000000 +[ 91.665334] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 91.665626] CR2: 00000000000001c8 CR3: 0000000114926006 CR4: 0000000000770ee0 +[ 91.665988] PKRU: 55555554 +[ 91.666131] Call Trace: +[ 91.666265] +[ 91.666381] intel_fbdev_set_suspend+0x97/0x1b0 [i915] +[ 91.666738] i915_drm_suspend+0xb9/0x100 [i915] +[ 91.667029] pci_pm_suspend+0x78/0x170 +[ 91.667234] ? __pfx_pci_pm_suspend+0x10/0x10 +[ 91.667461] dpm_run_callback+0x47/0x150 +[ 91.667673] __device_suspend+0x10a/0x4e0 +[ 91.667880] dpm_suspend+0x134/0x270 +[ 91.668069] dpm_suspend_start+0x79/0x80 +[ 91.668272] suspend_devices_and_enter+0x11b/0x890 +[ 91.668526] pm_suspend.cold+0x270/0x2fc +[ 91.668737] state_store+0x46/0x90 +[ 91.668916] kernfs_fop_write_iter+0x11b/0x200 +[ 91.669153] vfs_write+0x1e1/0x3a0 +[ 91.669336] ksys_write+0x53/0xd0 +[ 91.669510] do_syscall_64+0x58/0xc0 +[ 91.669699] ? syscall_exit_to_user_mode_prepare+0x18e/0x1c0 +[ 91.669980] ? syscall_exit_to_user_mode_prepare+0x18e/0x1c0 +[ 91.670278] ? syscall_exit_to_user_mode+0x17/0x40 +[ 91.670524] ? do_syscall_64+0x67/0xc0 +[ 91.670717] ? __irq_exit_rcu+0x3d/0x140 +[ 91.670931] entry_SYSCALL_64_after_hwframe+0x72/0xdc +[ 91.671202] RIP: 0033:0x7f28ffd14284 + +v2: CC stable. (Jani) + +Fixes: f8cc091e0530 ("drm/i915/fbdev: suspend HPD before fbdev unregistration") +References: https://gitlab.freedesktop.org/drm/intel/-/issues/8015 +Reported-and-tested-by: iczero +Cc: Andrzej Hajda +Cc: iczero +Cc: # v6.1+ +Reviewed-by: Jani Nikula +Signed-off-by: Imre Deak +Link: https://patchwork.freedesktop.org/patch/msgid/20230208114300.3123934-2-imre.deak@intel.com +(cherry picked from commit 9542d708409a41449e99c9a464deb5e062c4bee2) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/display/intel_fbdev.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/display/intel_fbdev.c ++++ b/drivers/gpu/drm/i915/display/intel_fbdev.c +@@ -624,7 +624,13 @@ void intel_fbdev_set_suspend(struct drm_ + struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; + struct fb_info *info; + +- if (!ifbdev || !ifbdev->vma) ++ if (!ifbdev) ++ return; ++ ++ if (drm_WARN_ON(&dev_priv->drm, !HAS_DISPLAY(dev_priv))) ++ return; ++ ++ if (!ifbdev->vma) + goto set_suspend; + + info = ifbdev->helper.fbdev; diff --git a/queue-6.1/series b/queue-6.1/series index d77b0d97165..78a84ec43ea 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -186,3 +186,8 @@ vdpa-ifcvf-ifcvf_request_irq-works-on-ifcvf_hw.patch vdpa-ifcvf-manage-ifcvf_hw-in-the-mgmt_dev.patch vdpa-ifcvf-allocate-the-adapter-in-dev_add.patch drm-display-dp_mst-add-drm_atomic_get_old_mst_topology_state.patch +drm-display-dp_mst-fix-down-up-message-handling-after-sink-disconnect.patch +drm-display-dp_mst-fix-down-message-handling-after-a-packet-reception-error.patch +drm-display-dp_mst-fix-payload-addition-on-a-disconnected-sink.patch +drm-i915-dp_mst-add-the-mst-topology-state-for-modesetted-crtcs.patch +drm-i915-fix-system-suspend-without-fbdev-being-initialized.patch