dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alan Previn" <alan.previn.teres.alexis@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/1] drm/xe/pcode: Fix pcode_try_request polling delays
Date: Thu, 05 Nov 2026 15:49:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-199352@kernel.org> (raw)
In-Reply-To: <20261102174608.1279278-2-alan.previn.teres.alexis@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/xe/pcode: syntax error in pcode_try_request() due to misplaced parenthesis
--

commit 3c7a166635d4e14258beaf50fb0fab91cf40aa3f
Author: Alan Previn <alan.previn.teres.alexis@intel.com>

drm/xe/pcode: Fix pcode_try_request polling delays

This commit caps the exponential backoff delay in pcode_try_request() to 100ms
and clamps the wait duration to the maximum allowed udelay value when polling
in atomic context.

> diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
> index 266deecbb100a..d2ed5edf003e3 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.c
> +++ b/drivers/gpu/drm/xe/xe_pcode.c
> @@ -146,6 +146,7 @@ int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val0, u32 *val1)
>  	return err;
>  }
>  
> +#define __XE_PCODE_WAIT_MAX_BACKOFF_100MS (100 * USEC_PER_MSEC)
>  static int pcode_try_request(struct xe_tile *tile, u32 mbox,
>  			     u32 request, u32 reply_mask, u32 reply,
>  			     int *status, bool atomic, int timeout_us, bool locked)
> @@ -164,11 +165,14 @@ static int pcode_try_request(struct xe_tile *tile, u32 mbox,
>  		if ((*status == 0) && ((request & reply_mask) == reply))
>  			return 0;
>  
> -		if (atomic)
> -			udelay(wait);
> -		else
> +		wait = min_t(int, wait << 1, __XE_PCODE_WAIT_MAX_BACKOFF_100MS);
> +		if (atomic) {
> +			/* don't overflow udelay */
> +			wait = min_t(int, wait, (MAX_UDELAY_MS * 1000);
> +			udelay(wait));

[Severity: High]
Does this break compilation of drivers/gpu/drm/xe/xe_pcode.c? In the atomic
branch of pcode_try_request(), the closing parenthesis for min_t() is missing
before the semicolon and appears after udelay(wait) instead:

			wait = min_t(int, wait, (MAX_UDELAY_MS * 1000));
			udelay(wait);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102174608.1279278-2-alan.previn.teres.alexis@intel.com?part=1

  reply	other threads:[~2026-11-05 15:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 17:46 [PATCH 1/1] drm/xe/pcode: Fix pcode_try_request polling delays Alan Previn
2026-11-05 15:49 ` sashiko-bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-10-30 17:30 Alan Previn
2026-10-30 17:38 ` sashiko-bot
2026-11-02 17:40   ` Teres Alexis, Alan Previn

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=sashiko-outbox-199352@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alan.previn.teres.alexis@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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