This is a note to let you know that I've just added the patch titled drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain() to the 6.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-xe-forcewake-add-a-helper-xe_force_wake_ref_has_.patch and it can be found in the queue-6.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 4edc411449743717e042d52181742d4c1bd84c5b Author: Himal Prasad Ghimiray <himal.prasad.ghimiray@xxxxxxxxx> Date: Mon Oct 14 13:25:38 2024 +0530 drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain() [ Upstream commit 9d62b07027f0710b7af03d78780d0a6c2425bc1e ] The helper xe_force_wake_ref_has_domain() checks if the input domain has been successfully reference-counted and awakened in the reference. v2 - Fix commit message and kernel-doc (Michal) - Remove unnecessary paranthesis (Michal) Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx> Cc: Badal Nilawar <badal.nilawar@xxxxxxxxx> Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@xxxxxxxxx> Reviewed-by: Badal Nilawar <badal.nilawar@xxxxxxxxx> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx> Link: https://patchwork.freedesktop.org/patch/msgid/20241014075601.2324382-4-himal.prasad.ghimiray@xxxxxxxxx Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> Stable-dep-of: 5dce85fecb87 ("drm/xe: Move the coredump registration to the worker thread") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h index a2577672f4e3e..1608a55edc846 100644 --- a/drivers/gpu/drm/xe/xe_force_wake.h +++ b/drivers/gpu/drm/xe/xe_force_wake.h @@ -46,4 +46,20 @@ xe_force_wake_assert_held(struct xe_force_wake *fw, xe_gt_assert(fw->gt, fw->awake_domains & domain); } +/** + * xe_force_wake_ref_has_domain - verifies if the domains are in fw_ref + * @fw_ref : the force_wake reference + * @domain : forcewake domain to verify + * + * This function confirms whether the @fw_ref includes a reference to the + * specified @domain. + * + * Return: true if domain is refcounted. + */ +static inline bool +xe_force_wake_ref_has_domain(unsigned int fw_ref, enum xe_force_wake_domains domain) +{ + return fw_ref & domain; +} + #endif