Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe: Ensure caller uses sole domain for xe_force_wake_assert_held

xe_force_wake_assert_held() is designed to confirm a particular
forcewake domain's wakefulness; it doesn't verify the wakefulness of
multiple domains. Make sure the caller doesn't input multiple
domains(XE_FORCEWAKE_ALL) as a parameter.

v2
- use domain != XE_FORCEWAKE_ALL (Michal)

v3
- Add kernel-doc

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240607125741.1407331-1-himal.prasad.ghimiray@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

authored by

Himal Prasad Ghimiray and committed by
Rodrigo Vivi
3541e19d 34385582

+11
+11
drivers/gpu/drm/xe/xe_force_wake.h
··· 28 28 return fw->domains[ffs(domain) - 1].ref; 29 29 } 30 30 31 + /** 32 + * xe_force_wake_assert_held - asserts domain is awake 33 + * @fw : xe_force_wake structure 34 + * @domain: xe_force_wake_domains apart from XE_FORCEWAKE_ALL 35 + * 36 + * xe_force_wake_assert_held() is designed to confirm a particular 37 + * forcewake domain's wakefulness; it doesn't verify the wakefulness of 38 + * multiple domains. Make sure the caller doesn't input multiple 39 + * domains(XE_FORCEWAKE_ALL) as a parameter. 40 + */ 31 41 static inline void 32 42 xe_force_wake_assert_held(struct xe_force_wake *fw, 33 43 enum xe_force_wake_domains domain) 34 44 { 45 + xe_gt_assert(fw->gt, domain != XE_FORCEWAKE_ALL); 35 46 xe_gt_assert(fw->gt, fw->awake_domains & domain); 36 47 } 37 48