An upcoming change will need to acquire a TypeC port link reference along with an AUX power domain reference when enabling PPS VDD for the port during an AUX transfer. Acquiring the link reference requires holding the TypeC port lock. To allow the PPS VDD code to take this lock itself, acquire the TypeC port lock in the AUX transfer function only after locking PPS and enabling VDD. CC: stable@vger.kernel.org # 6.14+ Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_dp_aux.c | 39 ++++++++++----------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c b/drivers/gpu/drm/i915/display/intel_dp_aux.c index 394326d17e0da..63bd72e537ec3 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c @@ -269,22 +269,6 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp, for (i = 0; i < ARRAY_SIZE(ch_data); i++) ch_data[i] = intel_dp->aux_ch_data_reg(intel_dp, i); - intel_digital_port_lock(encoder); - /* - * Abort transfers on a disconnected port as required by - * DP 1.4a link CTS 4.2.1.5, also avoiding the long AUX - * timeouts that would otherwise happen. - */ - if (!intel_dp_is_edp(intel_dp) && - !intel_digital_port_connected_locked(&dig_port->base)) { - ret = -ENXIO; - goto out_unlock; - } - - aux_domain = intel_aux_power_domain(dig_port); - - aux_wakeref = intel_display_power_get(display, aux_domain); - /* * The PPS state needs to be locked for: * - eDP on all platforms, since AUX transfers on eDP need VDD power @@ -307,6 +291,21 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp, */ vdd = intel_pps_vdd_on_unlocked(intel_dp); + intel_digital_port_lock(encoder); + /* + * Abort transfers on a disconnected port as required by + * DP 1.4a link CTS 4.2.1.5, also avoiding the long AUX + * timeouts that would otherwise happen. + */ + if (!intel_dp_is_edp(intel_dp) && + !intel_digital_port_connected_locked(&dig_port->base)) { + ret = -ENXIO; + goto out_unlock; + } + + aux_domain = intel_aux_power_domain(dig_port); + aux_wakeref = intel_display_power_get(display, aux_domain); + /* * dp aux is extremely sensitive to irq latency, hence request the * lowest possible wakeup latency and so prevent the cpu from going into @@ -450,16 +449,16 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp, out: cpu_latency_qos_update_request(&intel_dp->pm_qos, PM_QOS_DEFAULT_VALUE); + intel_display_power_put_async(display, aux_domain, aux_wakeref); +out_unlock: + intel_digital_port_unlock(encoder); + if (vdd) intel_pps_vdd_off_unlocked(intel_dp, false); if (pps_wakeref) intel_pps_unlock(intel_dp, pps_wakeref); - intel_display_power_put_async(display, aux_domain, aux_wakeref); -out_unlock: - intel_digital_port_unlock(encoder); - return ret; } -- 2.49.1