]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dma-buf: give examples of error codes to use
authorChristian König <ckoenig.leichtzumerken@gmail.com>
Mon, 26 Aug 2024 12:25:39 +0000 (14:25 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 6 Sep 2024 16:05:58 +0000 (18:05 +0200)
The dma_fence_set_error() function allows to set an error code on a
dma_fence object before it is signaled.

Document some of the potential error codes drivers should use and
especially what they mean.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240826122541.85663-2-christian.koenig@amd.com
include/linux/dma-fence.h

index e06bad467f55ef1befdad569f0a8a37875def383..e7ad819962e3edaac9cdad3b4d2de78a6c705971 100644 (file)
@@ -574,6 +574,12 @@ int dma_fence_get_status(struct dma_fence *fence);
  * rather than success. This must be set before signaling (so that the value
  * is visible before any waiters on the signal callback are woken). This
  * helper exists to help catching erroneous setting of #dma_fence.error.
+ *
+ * Examples of error codes which drivers should use:
+ *
+ * * %-ENODATA  This operation produced no data, no other operation affected.
+ * * %-ECANCELED All operations from the same context have been canceled.
+ * * %-ETIME    Operation caused a timeout and potentially device reset.
  */
 static inline void dma_fence_set_error(struct dma_fence *fence,
                                       int error)