drm/xe: Convert memory device refcount to s32
The comparison with < 0 suggests that the memory device access should be signed to handle underflow. This makes it work more reliably. As a result, the max refcount is now S32_MAX instead. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
committed by
Rodrigo Vivi
parent
19431b029b
commit
09a68b4a76
@ -351,7 +351,7 @@ void xe_device_mem_access_get(struct xe_device *xe)
|
||||
if (resumed)
|
||||
xe_pm_runtime_put(xe);
|
||||
|
||||
XE_WARN_ON(xe->mem_access.ref == U32_MAX);
|
||||
XE_WARN_ON(xe->mem_access.ref == S32_MAX);
|
||||
}
|
||||
|
||||
void xe_device_mem_access_put(struct xe_device *xe)
|
||||
|
@ -173,7 +173,7 @@ struct xe_device {
|
||||
/** @lock: protect the ref count */
|
||||
struct mutex lock;
|
||||
/** @ref: ref count of memory accesses */
|
||||
u32 ref;
|
||||
s32 ref;
|
||||
/** @hold_rpm: need to put rpm ref back at the end */
|
||||
bool hold_rpm;
|
||||
} mem_access;
|
||||
|
Reference in New Issue
Block a user