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>
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)
/** @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;