Commit e863781a authored by Matthew Auld's avatar Matthew Auld Committed by Lucas De Marchi

drm/xe/ct: fix xa_store() error checking

Looks like we are meant to use xa_err() to extract the error encoded in
the ptr.

Fixes: dd08ebf6 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
Cc: <stable@vger.kernel.org> # v6.8+
Reviewed-by: default avatarBadal Nilawar <badal.nilawar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241001084346.98516-6-matthew.auld@intel.com
(cherry picked from commit 1aa4b7864707886fa40d959483591f3d3937fa28)
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent db7f92af
...@@ -667,16 +667,12 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, ...@@ -667,16 +667,12 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action,
num_g2h = 1; num_g2h = 1;
if (g2h_fence_needs_alloc(g2h_fence)) { if (g2h_fence_needs_alloc(g2h_fence)) {
void *ptr;
g2h_fence->seqno = next_ct_seqno(ct, true); g2h_fence->seqno = next_ct_seqno(ct, true);
ptr = xa_store(&ct->fence_lookup, ret = xa_err(xa_store(&ct->fence_lookup,
g2h_fence->seqno, g2h_fence->seqno, g2h_fence,
g2h_fence, GFP_ATOMIC); GFP_ATOMIC));
if (IS_ERR(ptr)) { if (ret)
ret = PTR_ERR(ptr);
goto out; goto out;
}
} }
seqno = g2h_fence->seqno; seqno = g2h_fence->seqno;
...@@ -879,14 +875,11 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len, ...@@ -879,14 +875,11 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
retry_same_fence: retry_same_fence:
ret = guc_ct_send(ct, action, len, 0, 0, &g2h_fence); ret = guc_ct_send(ct, action, len, 0, 0, &g2h_fence);
if (unlikely(ret == -ENOMEM)) { if (unlikely(ret == -ENOMEM)) {
void *ptr;
/* Retry allocation /w GFP_KERNEL */ /* Retry allocation /w GFP_KERNEL */
ptr = xa_store(&ct->fence_lookup, ret = xa_err(xa_store(&ct->fence_lookup, g2h_fence.seqno,
g2h_fence.seqno, &g2h_fence, GFP_KERNEL));
&g2h_fence, GFP_KERNEL); if (ret)
if (IS_ERR(ptr)) return ret;
return PTR_ERR(ptr);
goto retry_same_fence; goto retry_same_fence;
} else if (unlikely(ret)) { } else if (unlikely(ret)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment