diff options
| author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2024-05-22 13:00:59 -0400 |
|---|---|---|
| committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2024-05-23 11:52:56 -0400 |
| commit | 46edb0a3eb16cebc2db6f9b6f7c19813d52bfcc9 (patch) | |
| tree | 0c5ac3aa08f2912bd60cd26db318fada0a667a06 /drivers/gpu/drm/xe/xe_pm.h | |
| parent | 40672b792a36894aff3a337b695f6136ee6ac5d4 (diff) | |
| download | linux-next-46edb0a3eb16cebc2db6f9b6f7c19813d52bfcc9.tar.gz linux-next-46edb0a3eb16cebc2db6f9b6f7c19813d52bfcc9.zip | |
drm/xe: Fix xe_pm_runtime_get_if_active return
Current callers of this function are already taking the result
to a boolean and using in an if. It might be a problem because
current function might return negative error codes on failure,
without increasing the reference counter.
In this scenario we could end up with extra 'put' call ending
in unbalanced scenarios.
Let's fix it, while aligning with the current xe_pm_get_if_in_use
style.
Tested-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240522170105.327472-1-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pm.h')
| -rw-r--r-- | drivers/gpu/drm/xe/xe_pm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_pm.h b/drivers/gpu/drm/xe/xe_pm.h index 18b0613fe57b..f694005db278 100644 --- a/drivers/gpu/drm/xe/xe_pm.h +++ b/drivers/gpu/drm/xe/xe_pm.h @@ -29,7 +29,7 @@ int xe_pm_runtime_resume(struct xe_device *xe); void xe_pm_runtime_get(struct xe_device *xe); int xe_pm_runtime_get_ioctl(struct xe_device *xe); void xe_pm_runtime_put(struct xe_device *xe); -int xe_pm_runtime_get_if_active(struct xe_device *xe); +bool xe_pm_runtime_get_if_active(struct xe_device *xe); bool xe_pm_runtime_get_if_in_use(struct xe_device *xe); void xe_pm_runtime_get_noresume(struct xe_device *xe); bool xe_pm_runtime_resume_and_get(struct xe_device *xe); |
