Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -10
+10 -10
drivers/gpu/drm/i915/display/intel_dp.c
··· 3879 3879 if (ret < 0) 3880 3880 return ret; 3881 3881 /* Wait for PCON to be FRL Ready */ 3882 - wait_for(is_active = drm_dp_pcon_is_frl_ready(&intel_dp->aux) == true, TIMEOUT_FRL_READY_MS); 3883 - 3884 - if (!is_active) 3885 - return -ETIMEDOUT; 3882 + ret = poll_timeout_us(is_active = drm_dp_pcon_is_frl_ready(&intel_dp->aux), 3883 + is_active, 3884 + 1000, TIMEOUT_FRL_READY_MS * 1000, false); 3885 + if (ret) 3886 + return ret; 3886 3887 3887 3888 ret = drm_dp_pcon_frl_configure_1(&intel_dp->aux, max_frl_bw, 3888 3889 DP_PCON_ENABLE_SEQUENTIAL_LINK); ··· 3900 3899 * Wait for FRL to be completed 3901 3900 * Check if the HDMI Link is up and active. 3902 3901 */ 3903 - wait_for(is_active = 3904 - intel_dp_pcon_is_frl_trained(intel_dp, max_frl_bw_mask, &frl_trained_mask), 3905 - TIMEOUT_HDMI_LINK_ACTIVE_MS); 3906 - 3907 - if (!is_active) 3908 - return -ETIMEDOUT; 3902 + ret = poll_timeout_us(is_active = intel_dp_pcon_is_frl_trained(intel_dp, max_frl_bw_mask, &frl_trained_mask), 3903 + is_active, 3904 + 1000, TIMEOUT_HDMI_LINK_ACTIVE_MS * 1000, false); 3905 + if (ret) 3906 + return ret; 3909 3907 3910 3908 frl_trained: 3911 3909 drm_dbg(display->drm, "FRL_TRAINED_MASK = %u\n", frl_trained_mask);