drm/tests: hdmi: Handle drm_kunit_helper_enable_crtc_connector() returning EDEADLK
Subsystems (2)
PATCH 1/1 drm/tests: hdmi: Handle drm_kunit_helper_enable_crtc_connector() returning EDEADLK
Fedora/CentOS/RHEL CI is reporting intermittent failures while running the KUnit tests present in drm_hdmi_state_helper_test.c [1].
While the specific test causing the failure change between runs, all of them are caused by drm_kunit_helper_enable_crtc_connector() returning -EDEADLK. The error trace always follow this structure:
# <test name>: ASSERTION FAILED at
# drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c:<line>
Expected ret == 0, but
ret == -35 (0xffffffffffffffdd)As documented, if the drm_kunit_helper_enable_crtc_connector() function returns -EDEADLK (-35), the entire atomic sequence must be restarted.
Handle this error code for all function calls.
--- .../drm/tests/drm_hdmi_state_helper_test.c | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+)
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +143 -0
@@ -257,10 +257,16 @@ static void drm_test_check_broadcast_rgb_crtc_mode_changed(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -326,10 +332,16 @@ static void drm_test_check_broadcast_rgb_crtc_mode_not_changed(struct kunit *tesdrm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -397,10 +409,16 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -457,10 +475,17 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode_vic_1(struct kunit *test)KUNIT_ASSERT_NOT_NULL (test, mode); crtc = priv->crtc; + +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, mode, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -518,10 +543,16 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -580,10 +611,17 @@ static void drm_test_check_broadcast_rgb_full_cea_mode_vic_1(struct kunit *test)KUNIT_ASSERT_NOT_NULL (test, mode); crtc = priv->crtc; + +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, mode, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -643,10 +681,16 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -705,10 +749,17 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *teKUNIT_ASSERT_NOT_NULL (test, mode); crtc = priv->crtc; + +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, mode, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -870,10 +921,16 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -946,10 +1003,16 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
@@ -1022,10 +1085,16 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1069,10 +1138,16 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1118,10 +1193,16 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1167,10 +1248,16 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1218,10 +1305,16 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 );/* You shouldn't be doing that at home. */
@@ -1292,10 +1385,16 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_rgb(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_EXPECT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1440,10 +1539,16 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422(struct kunitdrm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_EXPECT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1669,10 +1774,17 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); crtc = priv->crtc; + +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, mode, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_EXPECT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1736,10 +1848,16 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test)drm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_EXPECT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1805,10 +1923,16 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *testdrm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_EXPECT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1865,10 +1989,16 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *testdrm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_EXPECT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1927,10 +2057,16 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tesdrm_modeset_acquire_init (&ctx,0 ); +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_EXPECT_EQ (test, ret,0 ); conn_state = conn->state;
@@ -1970,10 +2106,17 @@ static void drm_test_check_disable_connector(struct kunit *test) drm = &priv->drm; crtc = priv->crtc; + +retry_conn_enable: ret =drm_kunit_helper_enable_crtc_connector (test, drm, crtc, conn, preferred, &ctx); +if (ret == -EDEADLK ) { + ret =drm_modeset_backoff (&ctx); +if (!ret) + goto retry_conn_enable; + }KUNIT_ASSERT_EQ (test, ret,0 ); state =drm_kunit_helper_atomic_state_alloc (test, drm, &ctx);
Signature · 1 line
2.51.0
Quoted 7 lines · José Expósito
Fedora/CentOS/RHEL CI is reporting intermittent failures while running the KUnit tests present in
drm_hdmi_state_helper_test.c[1].While the specific test causing the failure change between runs, all of them are caused by
drm_kunit_helper_enable_crtc_connector()returning[ ... ]
Thanks!
Maxime