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 2C6BF606A31F for ; Sun, 6 Dec 2026 04:03:36 +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=ZUDODQ6t Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D873310E03E; Sun, 6 Dec 2026 04:03:30 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E060A10E03E; Sun, 6 Dec 2026 04:03:24 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 61C3142B00; Sun, 6 Dec 2026 04:03:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 288511F0092B; Sun, 6 Dec 2026 04:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796529804; bh=WCPQjgAZeNcCmNnoByzEozDG9W33FALoXkdw25E42oY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ZUDODQ6tEQRwXfRD0tN2pdsttujQrxiSZpe3bZquCoLWgodX0N0Lab6QWACoWsnJF bmYbiCjla+btWv8Fyo2ZGKmXgVA8LSfbb+jYQrFG/aGkE8U/GSk6GD0GPSM1gH6Mce KombWkkoSolvTKar5TC8wLxErAOeEENfZQ7BYE3hTY+tC0SSuyNJXupQceS+ycd546 pFeH0OcqzTp6ka5SQTTHyOm8xIbSeLtL0Od8A/zZ9ypWuCmY/nSNdOrmy2BmlTfll/ SJg2YLrYHMeATIcNW4Pn7Fr5RrQ8D56CKoSUY10sH2lzqWKK0Z5bfkbninHD29caHh J9DixDH6qd1sw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/xe: Lock BO in xe_bo_dma_unmap_pinned() To: "Li Sheng" , intel-xe@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261206034613.558542-1-wirsbf@gmail.com> References: <20261206034613.558542-1-wirsbf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 04:03:23 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,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] drm/xe: stale xe_oa_quiesce_gt() comment and omitted caller in commit log -- commit ea3e3665aedf57056b31951b4e309f08ebe463ae Author: Li Sheng drm/xe: Lock BO in xe_bo_dma_unmap_pinned() This commit acquires the BO reservation lock in xe_bo_dma_unmap_pinned() before reading ttm_bo->ttm and unmapping its scatter-gather table. > diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c > index c89b39b503fe1..febfda24163db 100644 > --- a/drivers/gpu/drm/xe/xe_bo.c > +++ b/drivers/gpu/drm/xe/xe_bo.c > @@ -1878,7 +1878,10 @@ int xe_bo_restore_pinned(struct xe_bo *bo) > int xe_bo_dma_unmap_pinned(struct xe_bo *bo) > { > struct ttm_buffer_object *ttm_bo =3D &bo->ttm; > - struct ttm_tt *tt =3D ttm_bo->ttm; > + struct ttm_tt *tt; > + > + xe_bo_lock(bo, false); > + tt =3D ttm_bo->ttm; > =20 > if (tt) { > struct xe_ttm_tt *xe_tt =3D container_of(tt, typeof(*xe_tt), ttm); [Severity: Low] Should this patch also update the comment in xe_oa_quiesce_gt()? drivers/gpu/drm/xe/xe_oa.c:xe_oa_quiesce_gt() { ... /* * The OA buffer stays pinned until the stream fd is released, an mmap ma= y still * hold a reference on it. Drop its DMA mapping now: the fd may be releas= ed, and * the BO unpinned, while xe_bo_pinned_fini() DMA-unmaps it without the B= O lock. */ xe_bo_dma_unmap_pinned(stream->oa_buffer.bo); ... } Once xe_bo_dma_unmap_pinned() takes xe_bo_lock(), xe_bo_pinned_fini() no longer DMA-unmaps the BO without the BO lock, which makes that comment stale and makes the early call worth re-evaluating or re-documenting. The commit message also omits xe_oa_quiesce_gt() when listing the callers of xe_bo_dma_unmap_pinned(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206034613.5585= 42-1-wirsbf@gmail.com?part=3D1