[PATCH 02/18] drm/i915/hdcp: use generic read_poll_timeout() instead of __wait_for()

Kandpal, Suraj suraj.kandpal at intel.com
Sun Jun 29 13:39:51 UTC 2025


> Subject: [PATCH 02/18] drm/i915/hdcp: use generic read_poll_timeout()
> 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 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 at intel.com>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

LGTM,
Reviewed-by: Suraj Kandpal <suraj.kandpal at intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c
> b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 619ccfc33000..9eeeae03b129 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -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> @@ -324,10 +325,10 @@ 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 = read_poll_timeout(shim->read_ksv_ready, read_ret,
> +				read_ret || ksv_ready,
> +				100 * 1000, 5 * 1000 * 1000, false,
> +				dig_port, &ksv_ready);
>  	if (ret)
>  		return ret;
>  	if (read_ret)
> --
> 2.39.5



More information about the Intel-xe mailing list