]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe: Work around clang multiple goto-label error
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 11 Sep 2025 08:03:24 +0000 (10:03 +0200)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 18 Sep 2025 06:27:00 +0000 (08:27 +0200)
commit187e16f69de2ba30779b97ba8852b583fd7f5fad
treeb0d7f929456f420f35423337a671b175ea51d910
parentfb3c27a69c4736a9a78bb344b56907f8fb172edc
drm/xe: Work around clang multiple goto-label error

When using drm_exec_retry_on_contention(), clang may consider
all labels for which we take addresses in a function as
potential retry goto targets, although strictly only one
is possible. It will then in some situations generate false
positive errors.

In this case, the compiler, for some architectures, consider the

might_lock(&m->job_mutex);

as a potential goto target from drm_exec_retry_on_contention(),
and errors.

Work around that by moving the xe_validate / drm_exec
transaction to a separate function.

v2:
- New commit message based on analysis of Nathan Chancellor

Fixes: 59eabff2a352 ("drm/xe: Convert xe_bo_create_pin_map() for exhaustive eviction")
Cc: Matthew Brost <matthew.brost@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509101853.nDmyxTEM-lkp@intel.com/
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Link: https://lore.kernel.org/r/20250911080324.180307-1-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/xe/xe_migrate.c