]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/i915/hdcp: use generic poll_timeout_us() instead of __wait_for()
authorJani Nikula <jani.nikula@intel.com>
Thu, 28 Aug 2025 12:20:44 +0000 (15:20 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 4 Sep 2025 11:02:58 +0000 (14:02 +0300)
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, ... 64, and 128 ms in this
particular case.

Use an arbitrary 100 ms sleep instead. The timeout remains at 5000 ms.

Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/bfc9f941ec1628830644f1419d606e3d085aaba0.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_hdcp.c

index e11cf26ed0bfafaa1417a5aca37bda965d98deef..7af3dffa1eb0b86ae61e4e0d3a773260368149dc 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/component.h>
 #include <linux/debugfs.h>
 #include <linux/i2c.h>
+#include <linux/iopoll.h>
 #include <linux/random.h>
 
 #include <drm/display/drm_hdcp_helper.h>
@@ -326,10 +327,9 @@ static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *dig_port,
        bool ksv_ready;
 
        /* Poll for ksv list ready (spec says max time allowed is 5s) */
-       ret = __wait_for(read_ret = shim->read_ksv_ready(dig_port,
-                                                        &ksv_ready),
-                        read_ret || ksv_ready, 5 * 1000 * 1000, 1000,
-                        100 * 1000);
+       ret = poll_timeout_us(read_ret = shim->read_ksv_ready(dig_port, &ksv_ready),
+                             read_ret || ksv_ready,
+                             100 * 1000, 5 * 1000 * 1000, false);
        if (ret)
                return ret;
        if (read_ret)