Commit 97fd7a7e authored by Thomas Hellström's avatar Thomas Hellström

drm/xe: Annotate mcr_[un]lock()

These functions acquire and release the gt::mcr_lock. Annotate
accordingly.
Fix the corresponding sparse warning.

Fixes: dd08ebf6 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Fixes: fb1d55ef ("drm/xe: Cleanup OPEN_BRACE style issues")
Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240117134048.165425-4-thomas.hellstrom@linux.intel.com
parent 1e5a4dfe
...@@ -480,7 +480,7 @@ static bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt, ...@@ -480,7 +480,7 @@ static bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
* to synchronize with external clients (e.g., firmware), so a semaphore * to synchronize with external clients (e.g., firmware), so a semaphore
* register will also need to be taken. * register will also need to be taken.
*/ */
static void mcr_lock(struct xe_gt *gt) static void mcr_lock(struct xe_gt *gt) __acquires(&gt->mcr_lock)
{ {
struct xe_device *xe = gt_to_xe(gt); struct xe_device *xe = gt_to_xe(gt);
int ret = 0; int ret = 0;
...@@ -500,7 +500,7 @@ static void mcr_lock(struct xe_gt *gt) ...@@ -500,7 +500,7 @@ static void mcr_lock(struct xe_gt *gt)
drm_WARN_ON_ONCE(&xe->drm, ret == -ETIMEDOUT); drm_WARN_ON_ONCE(&xe->drm, ret == -ETIMEDOUT);
} }
static void mcr_unlock(struct xe_gt *gt) static void mcr_unlock(struct xe_gt *gt) __releases(&gt->mcr_lock)
{ {
/* Release hardware semaphore - this is done by writing 1 to the register */ /* Release hardware semaphore - this is done by writing 1 to the register */
if (GRAPHICS_VERx100(gt_to_xe(gt)) >= 1270) if (GRAPHICS_VERx100(gt_to_xe(gt)) >= 1270)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment