Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] drm/xe: build failure in xe_sync_entry_add_deps() from unupdated unwrap macro --
commit 146e2d47d9ca285371ff56e4898f49f8978c4427 Author: Christian König <[email protected]> dma-buf: improve robustness of dma_fence_unwrap_for_each v2 This commit reworks dma_fence_unwrap_for_each() to manage its cursor internally with a __cleanup(dma_fence_unwrap_cleanup) attribute and updates callers to drop the explicit cursor argument. > diff --git a/include/linux/dma-fence-unwrap.h > b/include/linux/dma-fence-unwrap.h > index 7bfacdf79de21..31f9fdeddf286 100644 > --- a/include/linux/dma-fence-unwrap.h > +++ b/include/linux/dma-fence-unwrap.h [ ... ] > @@ -32,27 +31,49 @@ struct dma_fence_unwrap { [ ... ] > /** > * dma_fence_unwrap_for_each - iterate over all fences in containers > * @fence: current fence > - * @cursor: current position inside the containers > * @head: starting point for the iterator > * > * Unwrap dma_fence_chain and dma_fence_array containers and deep dive into > all > * potential fences in them. If @head is just a normal fence only that one is > * returned. > + * > + * Keeps a reference to the current chain node to ensure that the data > structure > + * can't be freed while iterating over the fences in it. This reference is > + * automatically dropped when breaking out of the loop which will eventually > + * free up the current fence element. > */ > -#define dma_fence_unwrap_for_each(fence, cursor, head) > \ > - for (fence = dma_fence_unwrap_first(head, cursor); fence; \ > - fence = dma_fence_unwrap_next(cursor)) > +#define dma_fence_unwrap_for_each(fence, head) \ > + __dma_fence_unwrap_for_each(fence, __UNIQUE_ID(cursor), head) [Severity: High] Does changing dma_fence_unwrap_for_each() to take two arguments break the build when CONFIG_DRM_XE is enabled? Although the commit message notes that a conflict with drm-xe-next will be resolved later, this tree already includes 3b8860fe2581 ("drm/xe: Unwrap sync fences before adding them as job dependencies"), which still passes three arguments: drivers/gpu/drm/xe/xe_sync.c:xe_sync_entry_add_deps() { struct dma_fence_unwrap iter; ... dma_fence_unwrap_for_each(fence, &iter, sync->fence) { ... } Compiling drivers/gpu/drm/xe/xe_sync.c fails with a preprocessor error. -- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
