mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-21 11:25:22 -04:00
drm/i915/dp: use generic poll_timeout_us() instead of wait_for()
Prefer generic poll helpers over i915 custom helpers. The functional change is losing the exponentially growing sleep of wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us. Use an arbitrary constant 1 ms sleep instead. The timeouts remain, being 500 ms or 1000 ms depending on the case. Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Link: https://lore.kernel.org/r/83d3417d4e5af1db13eb4c6eaa48b5f9c12caeb4.1756383233.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -3879,10 +3879,11 @@ static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* Wait for PCON to be FRL Ready */
|
||||
wait_for(is_active = drm_dp_pcon_is_frl_ready(&intel_dp->aux) == true, TIMEOUT_FRL_READY_MS);
|
||||
|
||||
if (!is_active)
|
||||
return -ETIMEDOUT;
|
||||
ret = poll_timeout_us(is_active = drm_dp_pcon_is_frl_ready(&intel_dp->aux),
|
||||
is_active,
|
||||
1000, TIMEOUT_FRL_READY_MS * 1000, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = drm_dp_pcon_frl_configure_1(&intel_dp->aux, max_frl_bw,
|
||||
DP_PCON_ENABLE_SEQUENTIAL_LINK);
|
||||
@@ -3899,12 +3900,11 @@ static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp)
|
||||
* Wait for FRL to be completed
|
||||
* Check if the HDMI Link is up and active.
|
||||
*/
|
||||
wait_for(is_active =
|
||||
intel_dp_pcon_is_frl_trained(intel_dp, max_frl_bw_mask, &frl_trained_mask),
|
||||
TIMEOUT_HDMI_LINK_ACTIVE_MS);
|
||||
|
||||
if (!is_active)
|
||||
return -ETIMEDOUT;
|
||||
ret = poll_timeout_us(is_active = intel_dp_pcon_is_frl_trained(intel_dp, max_frl_bw_mask, &frl_trained_mask),
|
||||
is_active,
|
||||
1000, TIMEOUT_HDMI_LINK_ACTIVE_MS * 1000, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
frl_trained:
|
||||
drm_dbg(display->drm, "FRL_TRAINED_MASK = %u\n", frl_trained_mask);
|
||||
|
||||
Reference in New Issue
Block a user