Re: [PATCH v2 2/3] drm/xe/pcode: Improve PCODE logging using xe_log helper

Umesh Nerlige Ramappa <[email protected]>
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>
On Wed, Aug 12, 2026 at 06:04:52PM +0530, Mallesh Koujalagi wrote:
>Use xe_log helper for PCODE errors instead of drm_err(). This
>adds PCODE component tag, making issues easier to detect and
>track with automated tools.
>
>Signed-off-by: Mallesh Koujalagi <[email protected]>
>---
>v2:
>- s/pcode/PCODE. (Michal)
>- Drop PCODE in xe_log_err.
>---
> drivers/gpu/drm/xe/xe_pcode.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
>index ccc3bdeed6bb..c69440ea477b 100644
>--- a/drivers/gpu/drm/xe/xe_pcode.c
>+++ b/drivers/gpu/drm/xe/xe_pcode.c
>@@ -14,6 +14,7 @@
> #include "regs/xe_pmt.h"
> #include "xe_assert.h"
> #include "xe_device.h"
>+#include "xe_log.h"
> #include "xe_mmio.h"
> #include "xe_pcode_api.h"
> #include "xe_pm.h"
>@@ -219,8 +220,8 @@ int xe_pcode_request(struct xe_tile *tile, u32 mbox, u32 request,
> 	 * requests, and for any quirks of the PCODE firmware that delays
> 	 * the request completion.
> 	 */
>-	drm_err(&tile_to_xe(tile)->drm,
>-		"PCODE timeout, retrying with preemption disabled\n");
>+	xe_log_err(tile, PCODE, -ETIMEDOUT,
>+		   "Timeout, retrying with preemption disabled\n");
> 	preempt_disable();
> 	ret = pcode_try_request(tile, mbox, request, reply_mask, reply, &status,
> 				true, 50 * 1000, true);

After this code does a retry, there can still be a failure which the 
current code does not log. I think we should use an xe_log_err after the 
retry fails rather than the above. Here's what I mean:

https://patchwork.freedesktop.org/patch/745830/?series=172039&rev=1

Thanks,
Umesh


>@@ -320,8 +321,8 @@ int xe_pcode_ready(struct xe_device *xe, bool locked)
> 		mutex_unlock(&tile->pcode.lock);
>
> 	if (ret)
>-		drm_err(&xe->drm,
>-			"PCODE initialization timedout after: 3 min\n");
>+		xe_log_err(xe, PCODE, ret,
>+			   "Initialization timedout after: 3 min\n");
>
> 	return ret;
> }
>-- 
>2.48.1
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.