intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Nikula, Jani" <jani.nikula@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/dp: convert open-coded timeout to poll_timeout_us()
Date: Wed, 3 Sep 2025 08:53:43 +0000	[thread overview]
Message-ID: <6506684cf2e6906f144233e8a9b92e151fc7fecd.camel@intel.com> (raw)
In-Reply-To: <20250829113311.1930618-1-jani.nikula@intel.com>

On Fri, 2025-08-29 at 14:33 +0300, Jani Nikula wrote:
> Use poll_timeout_us() instead of open-coding the timeout loop.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index bed7cba1ca68..958e48859beb 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -27,6 +27,7 @@
>  
>  #include <linux/export.h>
>  #include <linux/i2c.h>
> +#include <linux/iopoll.h>
>  #include <linux/log2.h>
>  #include <linux/math.h>
>  #include <linux/notifier.h>
> @@ -5662,14 +5663,9 @@ bool
> intel_digital_port_connected_locked(struct intel_encoder *encoder)
>  	intel_wakeref_t wakeref;
>  
>  	with_intel_display_power(display, POWER_DOMAIN_DISPLAY_CORE,
> wakeref) {
> -		unsigned long wait_expires = jiffies +
> msecs_to_jiffies_timeout(4);
> -
> -		do {
> -			is_connected = dig_port->connected(encoder);
> -			if (is_connected || is_glitch_free)
> -				break;
> -			usleep_range(10, 30);
> -		} while (time_before(jiffies, wait_expires));
> +		poll_timeout_us(is_connected = dig_port-
> >connected(encoder),
> +				is_connected || is_glitch_free,
> +				30, 4000, false);
>  	}
>  
>  	return is_connected;


  parent reply	other threads:[~2025-09-03  8:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 11:33 [PATCH] drm/i915/dp: convert open-coded timeout to poll_timeout_us() Jani Nikula
2025-08-29 12:16 ` ✓ i915.CI.BAT: success for " Patchwork
2025-08-29 20:50 ` ✗ i915.CI.Full: failure " Patchwork
2025-09-03  8:53 ` Hogander, Jouni [this message]
2025-09-03  9:32   ` [PATCH] " Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6506684cf2e6906f144233e8a9b92e151fc7fecd.camel@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).