]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/display: Add w/a to reset PHY before link training in verify_link_cap
authorGeorge Shen <george.shen@amd.com>
Tue, 17 Dec 2019 19:34:33 +0000 (14:34 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Jan 2020 19:15:17 +0000 (14:15 -0500)
[Why]
PHY will sometimes be in bad state on hotplugging display from USB-C
dongle.

[How]
Add additional calls to disable and then enable PHY before link training
starts during verify_link_cap.

Signed-off-by: George Shen <george.shen@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c

index e415f7730f43ce7ec32da71936ed48223a5bf2c8..75dc387bbb2b6d8905994dbc9e0667c9169043f1 100644 (file)
@@ -1892,6 +1892,16 @@ bool dp_verify_link_cap(
        /* disable PHY done possible by BIOS, will be done by driver itself */
        dp_disable_link_phy(link, link->connector_signal);
 
+       /* Temporary Renoir-specific workaround for SWDEV-215184;
+        * PHY will sometimes be in bad state on hotplugging display from certain USB-C dongle,
+        * so add extra cycle of enabling and disabling the PHY before first link training.
+        */
+       if (link->link_enc->features.flags.bits.DP_IS_USB_C &&
+                       link->dc->debug.usbc_combo_phy_reset_wa) {
+               dp_enable_link_phy(link, link->connector_signal, dp_cs_id, cur);
+               dp_disable_link_phy(link, link->connector_signal);
+       }
+
        dp_cs_id = get_clock_source_id(link);
 
        /* link training starts with the maximum common settings
index ecd2257de80bacddfdaa552921b6232b57f03997..8c7ff9e322f105604cb2f9f81d31f11ab25c3fd9 100644 (file)
@@ -421,6 +421,7 @@ struct dc_debug_options {
        bool disable_dram_clock_change_vactive_support;
        bool validate_dml_output;
        bool enable_dmcub_surface_flip;
+       bool usbc_combo_phy_reset_wa;
 };
 
 struct dc_debug_data {
index f1ec3448c0c061d8282968795b45b7aaf2b651ee..0c02120311b62d6a0da6ec4b8c77af4ef3a4d700 100644 (file)
@@ -835,7 +835,8 @@ static const struct dc_debug_options debug_defaults_drv = {
                .scl_reset_length10 = true,
                .sanity_checks = true,
                .disable_48mhz_pwrdwn = false,
-               .nv12_iflip_vm_wa = true
+               .nv12_iflip_vm_wa = true,
+               .usbc_combo_phy_reset_wa = true
 };
 
 static const struct dc_debug_options debug_defaults_diags = {