From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A28C8606A688 for ; Fri, 4 Dec 2026 17:52:23 +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=TETUSlv5 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16A4F10E18F; Fri, 4 Dec 2026 17:52:18 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 97D7D10E18F for ; Fri, 4 Dec 2026 17:52:11 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 5991D45CDA; Fri, 4 Dec 2026 17:52:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33F771F0093B; Fri, 4 Dec 2026 17:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796406731; bh=4cR421nUTKkFTVIgPbtCclL23kl4yfhFBlE76D+x6KQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=TETUSlv51O09Cl93rhBEwqLarlsYV714Jqp7X19Hm0WLrkeo23hax0Z+jloBsMeG9 ZzeEkGXojOGSWtYE/EG274i4pmiPygRvXk5cxfibCkS77o9rzcwZ1sQl9PffxxPQtt pgC9Upo3z+0hP8wFTREDkiKVDs8EmoVIpkf7BkJsrtkNz2Al1BJ7AEBuGOfI22VD9A nzdQTi2lMTYQ4+5n3H51azLByAg0WZEgHxwI/c+tEI3SEnXLSE2Sp14VX8/UGFYfBZ oMvQ6K4sISVnOU9yHXSh4LSYZnuce8LuR+zir3rQE0pEn4nGgbN30WnXNUmPK0/wHp eIiDoC6Ulmriw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 3/3] accel/rocket: Wait for read fences in rocket_ioctl_prep_bo() To: "Sidong Yang" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261204174009.274509-4-sidong.yang@furiosa.ai> References: <20261204174009.274509-1-sidong.yang@furiosa.ai> <20261204174009.274509-4-sidong.yang@furiosa.ai> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 17:52:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] accel/rocket: Fixes trailer cites wrong commit for rocket_ioctl_prep_bo() -- commit a970bdabf5bfb0b280ea79229cdb58bc77903830 Author: Sidong Yang > accel/rocket: Wait for read fences in rocket_ioctl_prep_bo() > > DRM_IOCTL_ROCKET_PREP_BO begins CPU ownership of a BO and has no > read/write direction flag: userspace calls it before reading an output > buffer as well as before overwriting an input buffer for reuse. > > Since commit 4d8cb7be620e ("accel/rocket: publish read fences for input > buffers"), in-flight jobs attach DMA_RESV_USAGE_READ fences to their > input BOs. Waiting only for DMA_RESV_USAGE_WRITE therefore returns > immediately while an NPU job is still reading the buffer. > > Wait for DMA_RESV_USAGE_READ so PREP_BO waits for both write and read > fences before transferring ownership back to the CPU. > > Fixes: 4d8cb7be620e ("accel/rocket: publish read fences for input buffers= ") > Signed-off-by: Sidong Yang [Severity: Low] Should the Fixes tag cite 525ad89dd904 ("accel/rocket: Add IOCTLs for synchronizing memory accesses") instead? Commit 4d8cb7be620e ("accel/rocket: publish read fences for input buffers") only added read fences in rocket_job.c and did not introduce the bug in rocket_ioctl_prep_bo(). The DMA_RESV_USAGE_WRITE wait in rocket_ioctl_prep_bo() was introduced by 525ad89dd904 ("accel/rocket: Add IOCTLs for synchronizing memory accesses"), and already missed read fences such as those attached by a foreign PRIME importer reading an exported BO. Fixes: 525ad89dd904 ("accel/rocket: Add IOCTLs for synchronizing memory a= ccesses") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204174009.2745= 09-1-sidong.yang@furiosa.ai?part=3D3