Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
__wait_for(), which used to be 1, 2, 4, and 8 ms in this particular
case.

Use an arbitrary constant 4 ms sleep instead. The timeout remains,
varying between 20 ms and 3000 ms.

Cc: Suraj Kandpal <suraj.kand...@intel.com>
Signed-off-by: Jani Nikula <jani.nik...@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c 
b/drivers/gpu/drm/i915/display/intel_hdmi.c
index cbee628eb26b..09111e6d1d20 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -29,6 +29,7 @@
 #include <linux/delay.h>
 #include <linux/hdmi.h>
 #include <linux/i2c.h>
+#include <linux/iopoll.h>
 #include <linux/slab.h>
 #include <linux/string_helpers.h>
 
@@ -1689,11 +1690,10 @@ intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port 
*dig_port,
        if (timeout < 0)
                return timeout;
 
-       ret = __wait_for(ret = hdcp2_detect_msg_availability(dig_port,
-                                                            msg_id, &msg_ready,
-                                                            &msg_sz),
-                        !ret && msg_ready && msg_sz, timeout * 1000,
-                        1000, 5 * 1000);
+       ret = poll_timeout_us(ret = hdcp2_detect_msg_availability(dig_port, 
msg_id,
+                                                                 &msg_ready, 
&msg_sz),
+                             !ret && msg_ready && msg_sz,
+                             4000, timeout * 1000, false);
        if (ret)
                drm_dbg_kms(display->drm,
                            "msg_id: %d, ret: %d, timeout: %d\n",
-- 
2.47.2

Reply via email to