From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796222565; b=JzumFJY7djM+nOn+EhsLsaqNv5KeTcQyvvWNyNwUt/UOqua4OWfh8oK6V0QSSOMA4UoN CXb9SAOv80SRq7vTEyFhUWp6hgyVtzzE9tO/EN2mImGRb7OK3MbrXGwn4i38mBhO4dZcE kxG4cOymXRLCvEKLy7IgKRIzgWiyITp02ezt5n1kyx/OVM0KHNb71FRNbXHxJljTHdJg+ WAWWyArHJt50JUHIaadN5DFWp0GdEQqfMU9mqyIoKhEaKt+S11BwXHhPsbrFF9zfQHvMo QL44asYh5r7u81ud6YixZEGQSJOt7WUQf/MBwCZLdMpaplxCxxyQPIci1XAGMEWyItw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796222565; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Krb9tE2NswxnCCGNsIo7qaBrvfBugcmcA1wfCDsxwJ0=; b=UrBdGZA+cCfxn5b0qawP7YITt316hHH3XVqeEK4ik4txjJXKblgL5BWM2oyt6gT+Ls3l luAy0KAmli4NX8oSzZgePbLyCFFy2rHqS4MNPCoDazYrGxfnT62kOF05Uk0LvzRN53IO+ XIfYETnCL7BWUDHgK5eiVYLf31Z2VnWTmdg28/I43vu0XPLndYGT79sPuyJ5XtH17gHAN /i28Dz9xJnSy0z9tEfWzKmM3KcM++XrPlHf4ZTFDimY5fq37YG6dKiRj9bOD+QOmgJ2RX 5H1xLWMqUqadq15Weo8Pc4LMgnzX+BGj5Gn6NqeWWBREwbuznKt3vZ3lHqYMxlKWcJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kRr2DaOg; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18767606A32D for ; Wed, 2 Dec 2026 14:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kRr2DaOg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04B791F00919; Wed, 2 Dec 2026 14:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796222564; bh=Krb9tE2NswxnCCGNsIo7qaBrvfBugcmcA1wfCDsxwJ0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=kRr2DaOgTEwD2rWkFpQqeNuZTtn3EEpEzp0Bp2U44uruVH5BrSfAk/ZxYHQurEkYu T+IIZ1yoelvl3V2Xp1wik0EGYILNk2Rkc44BduG6S21VOG1Uoz/ZkDLRpbZqbHNhIb AhBNfDAcQ7oDU1WGwX/OSteyU34ldC02bgtW86IEFUAeKxJqGgOBubmu+74UNcJpmV NBY6Tdtu3P1i5VrjkAkvTYb3GQORuxsAYOM0/WtBwB4VMXgS5NMcnq3n+tB3/y79Yj 1Q87zAyo639dfFmijVWOt15ExIGE5Z6MuXynsxjEjT7Pxs6R6NHjIWyfdXHP4sGz5z 9K8HhKV0sAJ4w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] dma-buf: improve robustness of dma_fence_unwrap_for_each v2 Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?Q2hyaXN0aWFuIEvDtm5pZw==?= Cc: dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev, "Michael S. Tsirkin" , "Eugenio Perez" In-Reply-To: <20261202143509.6903-1-christian.koenig@amd.com> References: <20261202143509.6903-1-christian.koenig@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 14:42:43 +0000 X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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=C3=B6nig 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-u= nwrap.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 i= nto all > * potential fences in them. If @head is just a normal fence only that o= ne is > * returned. > + * > + * Keeps a reference to the current chain node to ensure that the data s= tructure > + * can't be freed while iterating over the fences in it. This reference = is > + * automatically dropped when breaking out of the loop which will eventu= ally > + * free up the current fence element. > */ > -#define dma_fence_unwrap_for_each(fence, cursor, head) \ > - for (fence =3D dma_fence_unwrap_first(head, cursor); fence; \ > - fence =3D 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202143509.6903= -1-christian.koenig@amd.com?part=3D1