Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik Poosa <karthik.poosa@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: rodrigo.vivi@intel.com, anshuman.gupta@intel.com,
	badal.nilawar@intel.com, raag.jadav@intel.com,
	riana.tauro@intel.com, sk.anirban@intel.com,
	mallesh.koujalagi@intel.com, soham.purkait@intel.com,
	Karthik Poosa <karthik.poosa@intel.com>
Subject: [PATCH 1/2] drm/xe/pcode: Introduce xe_pcode_read_timeout() API
Date: Wed, 29 Jul 2026 22:45:45 +0530	[thread overview]
Message-ID: <20260729171546.3368457-2-karthik.poosa@intel.com> (raw)
In-Reply-To: <20260729171546.3368457-1-karthik.poosa@intel.com>

Add the xe_pcode_read_timeout() helper to allow callers to specify
custom timeout values for pcode read operations.

Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
---
 drivers/gpu/drm/xe/xe_pcode.c | 11 +++++++++++
 drivers/gpu/drm/xe/xe_pcode.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
index ccc3bdeed6bb..7386113e60b3 100644
--- a/drivers/gpu/drm/xe/xe_pcode.c
+++ b/drivers/gpu/drm/xe/xe_pcode.c
@@ -147,6 +147,17 @@ int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1)
 	return err;
 }
 
+int xe_pcode_read_timeout(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1, u32 timeout_ms)
+{
+	int err;
+
+	mutex_lock(&tile->pcode.lock);
+	err = pcode_mailbox_rw(tile, mbox, val, val1, timeout_ms, true, false);
+	mutex_unlock(&tile->pcode.lock);
+
+	return err;
+}
+
 static int pcode_try_request(struct xe_tile *tile, u32 mbox,
 			     u32 request, u32 reply_mask, u32 reply,
 			     u32 *status, bool atomic, int timeout_us, bool locked)
diff --git a/drivers/gpu/drm/xe/xe_pcode.h b/drivers/gpu/drm/xe/xe_pcode.h
index 8fb3e4ba13a6..c9647c5f305e 100644
--- a/drivers/gpu/drm/xe/xe_pcode.h
+++ b/drivers/gpu/drm/xe/xe_pcode.h
@@ -24,6 +24,7 @@ int xe_pcode_ready(struct xe_device *xe, bool locked);
 int xe_pcode_init_min_freq_table(struct xe_tile *tile, u32 min_gt_freq,
 				 u32 max_gt_freq);
 int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1);
+int xe_pcode_read_timeout(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1, u32 timeout_ms);
 int xe_pcode_write_timeout(struct xe_tile *tile, u32 mbox, u32 val,
 			   int timeout_ms);
 int xe_pcode_write64_timeout(struct xe_tile *tile, u32 mbox, u32 data0,
-- 
2.25.1


  parent reply	other threads:[~2026-07-29 17:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 17:15 [PATCH 0/2] drm/xe: Increase timeout for hwmon power limit mailbox operations Karthik Poosa
2026-07-29 17:14 ` ✓ CI.KUnit: success for " Patchwork
2026-07-29 17:15 ` Karthik Poosa [this message]
2026-08-31  5:32   ` [PATCH 1/2] drm/xe/pcode: Introduce xe_pcode_read_timeout() API Tauro, Riana
2026-08-31  6:50     ` Poosa, Karthik
2026-07-29 17:15 ` [PATCH 2/2] drm/xe/hwmon: Increase timeout for mailbox power limits Karthik Poosa
2026-08-31  5:29   ` Tauro, Riana
2026-08-31  6:54     ` Poosa, Karthik
2026-08-31  7:09       ` Tauro, Riana
2026-08-31  7:41         ` Raag Jadav
2026-08-31 13:58           ` Rodrigo Vivi
2026-08-31 16:27             ` Poosa, Karthik
2026-08-31 16:48               ` Rodrigo Vivi
2026-09-07  8:37                 ` Poosa, Karthik
2026-08-31 13:59   ` Rodrigo Vivi
2026-07-29 18:07 ` ✓ Xe.CI.BAT: success for drm/xe: Increase timeout for hwmon power limit mailbox operations Patchwork
2026-07-29 22:58 ` ✗ Xe.CI.FULL: failure " Patchwork

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=20260729171546.3368457-2-karthik.poosa@intel.com \
    --to=karthik.poosa@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mallesh.koujalagi@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sk.anirban@intel.com \
    --cc=soham.purkait@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