aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4496-drm-amd-display-Spin-for-DMCUB-PHY-init-in-DC.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4496-drm-amd-display-Spin-for-DMCUB-PHY-init-in-DC.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4496-drm-amd-display-Spin-for-DMCUB-PHY-init-in-DC.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4496-drm-amd-display-Spin-for-DMCUB-PHY-init-in-DC.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4496-drm-amd-display-Spin-for-DMCUB-PHY-init-in-DC.patch
new file mode 100644
index 00000000..c4ce7cb3
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4496-drm-amd-display-Spin-for-DMCUB-PHY-init-in-DC.patch
@@ -0,0 +1,62 @@
+From c56c8bc443366b91351ad9f2f248b09fdc6da1da Mon Sep 17 00:00:00 2001
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Date: Tue, 5 Nov 2019 12:51:51 -0500
+Subject: [PATCH 4496/4736] drm/amd/display: Spin for DMCUB PHY init in DC
+
+[Why]
+DCN will hang if we access registers before PHY init is done.
+
+So we need to spin or abort.
+
+[How]
+On hardware with DMCUB running and working we shouldn't time out
+waiting for this to finish and we shouldn't hit the spin cycle.
+
+If there's no hardware support then we should exit out of the function
+early assuming that PHY init was already done elsewhere.
+
+If we hit the timeout then there's likely a bug in firmware or software
+and we need to debug - add errors and asserts as appropriate.
+
+Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
+Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 21 ++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+index 74ffe53eb49d..03e2842cb573 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
++++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+@@ -112,10 +112,23 @@ void dc_dmub_srv_wait_phy_init(struct dc_dmub_srv *dc_dmub_srv)
+ struct dc_context *dc_ctx = dc_dmub_srv->ctx;
+ enum dmub_status status;
+
+- status = dmub_srv_wait_for_phy_init(dmub, 10000000);
+- if (status != DMUB_STATUS_OK) {
+- DC_ERROR("Error waiting for DMUB phy init: status=%d\n",
+- status);
++ for (;;) {
++ /* Wait up to a second for PHY init. */
++ status = dmub_srv_wait_for_phy_init(dmub, 1000000);
++ if (status == DMUB_STATUS_OK)
++ /* Initialization OK */
++ break;
++
++ DC_ERROR("DMCUB PHY init failed: status=%d\n", status);
+ ASSERT(0);
++
++ if (status != DMUB_STATUS_TIMEOUT)
++ /*
++ * Server likely initialized or we don't have
++ * DMCUB HW support - this won't end.
++ */
++ break;
++
++ /* Continue spinning so we don't hang the ASIC. */
+ }
+ }
+--
+2.17.1
+