Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 00/10] drm/i915: Stop the intel_de_wait_custom() abuse
Date: Thu, 06 Nov 2025 19:05:20 +0200	[thread overview]
Message-ID: <677633ec46f1835f2f0aceecb1411191fbb1c648@intel.com> (raw)
In-Reply-To: <aQzIZzjEqNyP872A@intel.com>

On Thu, 06 Nov 2025, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Nov 06, 2025 at 05:43:12PM +0200, Jani Nikula wrote:
>> On Thu, 06 Nov 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >
>> > Get rid of all the custom fast vs. slow intel_de_wait_custom()
>> > timeouts that have started to spread like a cancer recently.
>> >
>> > The eventual aim is to get rid of the fast vs. slow timeout
>> > stuff entirely and switch over to poll_timeout_us()...
>> 
>> Are you planning on still having intel_de_wait_something_something, or
>> do you mean using poll_timeout_us() directly?
>> 
>> I think I like the intel_de_* wait helpers, but just a coherent small
>> set, and everything beyond that should use poll_timeout_us() instead of
>> adding obscure helpers for one-off cases.
>
> Yeah, I think the helpers are fairly nice for the common stuff so
> I guess we should keep them. But not too many, so probably just
> intel_de_wait_{,for_set,for_clear}_us().
>
> My current branch has both _us() and _ms() versions of those, but
> as discussed in the meeting we should probably just go for _us()
> eventually. I think I'll want to have the _ms() stuff around for
> a while though since it makes some of the mechanical conversions
> easier.

I think that's fine.

> I also haven't quite figured out is what to do about the poll
> interval for poll_timeout_us(). I was thinking of starting with
> something simple like 'interval=max(timeout/8+1,100)' and then
> try to capture some data on how many iterations we end up in
> at least some of the more important places (eg. AUX, PPS, etc).
> I suppose in the worst case we might need custom intervals in
> some places, but I'm hoping some kind of generic approach works
> well enough for most stuff.

I think I pretty much winged it when I was doing the conversions... for
most stuff it's not really super important, as long as it's somewhat
proportional to the timeout.

The downside of poll_timeout_us() is that it's not trivial for us to
change the interval e.g. to some automatic exponential backoff with a
max. I like how __xe_mmio_wait32() has that, but I very much dislike how
it has no cap, and you know how exponential functions behave.

Maybe we could pass a negative as sleep_us to poll_timeout_us() to do
some magic...

BR,
Jani.




-- 
Jani Nikula, Intel

  reply	other threads:[~2025-11-06 17:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06 15:20 [PATCH v2 00/10] drm/i915: Stop the intel_de_wait_custom() abuse Ville Syrjala
2025-11-06 15:20 ` [PATCH v2 01/10] drm/i915/cx0: Print the correct timeout Ville Syrjala
2025-11-06 15:32   ` Jani Nikula
2025-11-06 15:54     ` Ville Syrjälä
2025-11-06 15:20 ` [PATCH v2 02/10] drm/i915/cx0: Nuke extraneous timeout debugs Ville Syrjala
2025-11-06 15:33   ` Jani Nikula
2025-11-06 15:20 ` [PATCH v2 03/10] drm/i915/ltphy: " Ville Syrjala
2025-11-06 15:34   ` Jani Nikula
2025-11-06 15:20 ` [PATCH v2 04/10] drm/i915/cx0: Replace XELPDP_PORT_POWERDOWN_UPDATE_TIMEOUT_US with XELPDP_PORT_POWERDOWN_UPDATE_TIMEOUT_MS Ville Syrjala
2025-11-06 15:37   ` Jani Nikula
2025-11-06 15:20 ` [PATCH v2 05/10] drm/i915/cx0: Get rid of XELPDP_MSGBUS_TIMEOUT_FAST_US Ville Syrjala
2025-11-06 15:20 ` [PATCH v2 06/10] drm/i915/cx0: s/XELPDP_MSGBUS_TIMEOUT_SLOW/XELPDP_MSGBUS_TIMEOUT_MS/ Ville Syrjala
2025-11-06 15:20 ` [PATCH v2 07/10] drm/i915/cx0: s/XELPDP_PORT_RESET_END_TIMEOUT/XELPDP_PORT_RESET_END_TIMEOUT_US/ Ville Syrjala
2025-11-06 15:38   ` Jani Nikula
2025-11-06 15:52   ` [PATCH v3 07/10] drm/i915/cx0: s/XELPDP_PORT_RESET_END_TIMEOUT/XELPDP_PORT_RESET_END_TIMEOUT_MS/ Ville Syrjala
2025-11-06 15:20 ` [PATCH v2 08/10] drm/i915/ltphy: Nuke bogus weird timeouts Ville Syrjala
2025-11-06 15:41   ` Jani Nikula
2025-11-06 15:20 ` [PATCH v2 09/10] drm/i915/hdcp: Use the default 2 usec fast polling timeout Ville Syrjala
2025-11-06 15:20 ` [PATCH v2 10/10] drm/i915/pmdemand: " Ville Syrjala
2025-11-06 15:43 ` [PATCH v2 00/10] drm/i915: Stop the intel_de_wait_custom() abuse Jani Nikula
2025-11-06 16:10   ` Ville Syrjälä
2025-11-06 17:05     ` Jani Nikula [this message]
2025-11-06 18:16 ` ✓ i915.CI.BAT: success for drm/i915: Stop the intel_de_wait_custom() abuse (rev2) Patchwork
2025-11-06 18:22 ` ✓ i915.CI.BAT: success for drm/i915: Stop the intel_de_wait_custom() abuse (rev3) Patchwork
2025-11-07 12:16 ` ✓ i915.CI.Full: " Patchwork
2025-11-07 18:44 ` [PATCH v2 00/10] drm/i915: Stop the intel_de_wait_custom() abuse Ville Syrjälä

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=677633ec46f1835f2f0aceecb1411191fbb1c648@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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