drm/xe: Fix NPD when saving default context
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 28 May 2025 21:42:22 +0000 (14:42 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 29 May 2025 00:44:28 +0000 (17:44 -0700)
commit33a46dab18c92da612778b115a600578fa4d42e1
tree4d82c7b1ac9447a4c47dc8b7b5ca5791fae76eaf
parentef818481d9fbaf3483dde0d1faa565a016810de3
drm/xe: Fix NPD when saving default context

xef is only valid if it's a job from userspace.  For in-kernel jobs it
causes a NPD like below:

        <4> [] RIP: 0010:xe_sched_job_create+0xbd/0x390 [xe]
...
        <4> [] Call Trace:
        <4> []  <TASK>
        <4> []  __xe_bb_create_job+0xa2/0x240 [xe]
        <4> []  ? find_held_lock+0x31/0x90
        <4> []  ? xa_find_after+0x12c/0x250
        <4> []  xe_bb_create_job+0x6e/0x380 [xe]
        <4> []  ? xa_find_after+0x136/0x250
        <4> []  ? __drm_dev_dbg+0x7d/0xb0
        <4> []  xe_gt_record_default_lrcs+0x542/0xb00 [xe]

Since drm_file starts with 1 for the unique id, just use 0 for the
in-kernel jobs.

Fixes: 2956554823ce ("drm/sched: Store the drm client_id in drm_sched_fence")
Cc: Christian König <christian.koenig@amd.com>
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Cc: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20250528-fix-sched-v1-1-c042ef23ff8b@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_sched_job.c