[PATCH] drm/xe: Change pcode timeout to 50msec while polling again
Himal Prasad Ghimiray
himal.prasad.ghimiray at intel.com
Tue May 7 20:07:29 UTC 2024
Polling is initially attempted with timeout_base_ms enabled for
preemption, and if it exceeds this timeframe, another attempt is made
without preemption, allowing an additional 50 ms before timing out.
Display driver can request for timeout of 3 msec, hence modify the
warning condition.
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
---
drivers/gpu/drm/xe/xe_pcode.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
index c010ef16fbf5..ac3a965674c8 100644
--- a/drivers/gpu/drm/xe/xe_pcode.c
+++ b/drivers/gpu/drm/xe/xe_pcode.c
@@ -124,6 +124,8 @@ static int pcode_try_request(struct xe_gt *gt, u32 mbox,
{
int slept, wait = 10;
+ xe_gt_assert(gt, timeout_us > 0);
+
for (slept = 0; slept < timeout_us; slept += wait) {
if (locked)
*status = pcode_mailbox_rw(gt, mbox, &request, NULL, 1, true,
@@ -166,7 +168,7 @@ static int pcode_try_request(struct xe_gt *gt, u32 mbox,
int xe_pcode_request(struct xe_gt *gt, u32 mbox, u32 request,
u32 reply_mask, u32 reply, int timeout_base_ms)
{
- u32 status;
+ u32 status = 0;
int ret;
mutex_lock(>->pcode.lock);
@@ -188,10 +190,10 @@ int xe_pcode_request(struct xe_gt *gt, u32 mbox, u32 request,
*/
drm_err(>_to_xe(gt)->drm,
"PCODE timeout, retrying with preemption disabled\n");
- drm_WARN_ON_ONCE(>_to_xe(gt)->drm, timeout_base_ms > 1);
+ drm_WARN_ON_ONCE(>_to_xe(gt)->drm, timeout_base_ms > 3);
preempt_disable();
ret = pcode_try_request(gt, mbox, request, reply_mask, reply, &status,
- true, timeout_base_ms * 1000, true);
+ true, 50 * 1000, true);
preempt_enable();
out:
--
2.25.1
More information about the Intel-xe
mailing list